Need help w/ getting session ID/Information.

I have the following code in a servlet that is sitting on the external web

server. I am using a URL Scraper channel to access the servlet. I have

modified the extrnal web servers servlets.properties file and

rules.properties to know about the servlet.

try {

Cookie[] cookies = request.getCookies();

for (int i=0;i<cookies.length; i ++ ) {

System.out.println("**** Cookie: " + cookies.getName());

}

SessionID sid = new SessionID(request);

if (sid.getRandomString() != null || sid.getRandomString() != "") {

System.out.println("**** Session ID: " + sid.toString());

Session sess = Session.getSession(sid);

int state = sess.getState(false);

if (state != Session.VALID) {

System.out.println("%%%%% Session Not Valid %%%%%");

} else {

Profile p = sess.getUserProfile();

System.out.println("**** Got Profile ****");

String office2 =

p.getAttributeString("LocalOffice-localOffice");

System.out.println("**** Local-Office: " + office2);

}

}

} catch ( com.iplanet.portalserver.session.SessionException se) {

System.out.println("%%%%% Session Exception: " + se);

} catch ( com.iplanet.portalserver.profile.ProfileException pe) {

System.out.println("%%%%% Profile exception: " + pe);

}

I get the iPlanetPortalServer cookie, and I get a print of: **** Session ID:

But then I get a session exception. From all the code that I have seen on

how to do this mine is very similar. Does anyone know what I am doing wrong?>

[1621 byte] By [708789] at [2007-11-25 4:29:35]
# 1

I ran into the same problem. I originally posted to the newsgroup on

7/20/2001. I took the sso servlet example and accessed it using URLScraper.

The servlet was running on a WebSphere app server on a Solaris platform.

I did two things to get the user information off of the profile.

1. Took and registered the iPlanet jars in WebSphere.(I grabbed them all)

2. Set up the following directories on the web server:

/opt/SUNWips

/opt/SUNWips/lib

/opt/SUNWips/locale

/etc/opt/SUNWips

The platform.conf file was copied to /etc/opt/SUNWips with the

ips.notification.urlparameter changed to the FQDN of the host server.

The following files were copied to /opt/SUNWips/locale

iwtP11.properties

iwtProfile.properties

iwtSession.properties

iwtLogging.properties

iwtNaming.properties

The following files were copied to /opt/SUNWips/lib

ips_jdk.jar

ips_services.jar

jndi.jar

xml.jar

The problem with my solution is that it is a shotgun approach. I'm not sure if

it was getting the correct jars into the web app server, or the local file and

directory setup on the web server, or some combo thereof, that allowed me to get

the profile info. Maybe someone can point out the correct combo.

Best of luck,

John

708778 at 2007-6-29 2:32:53 > top of Java-index,Web & Directory Servers,Portal Servers...