Getting a handle to Session when wo app deployed on a J2EE container
Getting a handle to Session when wo app deployed on a J2EE container
- Subject: Getting a handle to Session when wo app deployed on a J2EE container
- From: "Alex Finkel" <email@hidden>
- Date: Thu, 1 May 2008 12:02:16 -0400
Hi there. Any help would be appreciated.
We are trying to get a handle to the
WebObjects Session object from within a direct action. There is an applet that
calls a direct action to upload chunks of data along with other parameters
including the wosid.
We use the following lines of code
to get the Session object. Note that strSessionId has the wosid parameter passed
from above.
Application
tApp = (Application)WOApplication.application();
WOContext
woContext = new
WOContext(null);
Session tSession =
(Session)tApp.restoreSessionWithID(strSessionId,
woContext);
It works well
when deployed on monitor but does not work well on a J2EE container. ( tomcat
)
Please note
that we can use the session() method of the WODirectAction to get the handle.
This works well but we want to take a generic approach to get Session objects
from sessionid string as we may not always need to do this from within a direct
action.
Stack trace is
below:
java.lang.NullPointerException
at com.webobjects.jspservlet.WOServletSessionStore.restoreSessionWithID(WOServletSessionStore.java:43)
at com.webobjects.appserver.WOSessionStore.checkOutSessionWithID(WOSessionStore.java:198)
at com.webobjects.appserver.WOApplication.restoreSessionWithID(WOApplication.java:1546)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden