[ http://issues.apache.org/jira/browse/TUSCANY-936?page=comments#action_12450646 ] Jim Marino commented on TUSCANY-936: ------------------------------------
It looks like the session scope container has not been completely integrated into the web app runtime and LazyHTTPSessionId was left out. To fix this: 1. Copy over LazyHTTPSessionId from the old code base 2. In TuscanyRequestListener, line 61: runtime.httpRequestStarted(session == null ? null : session.getId()); Instead of passing in a null id, pass in an insance of LazyHTTPSessionId. 3. HttpSessionScopeContainer.getInstanceWrapper() needs to check the id if it is an instanceof LazyHTTPSessionId and call getId() on it, and doing a lookup on the value returned. Note calling Servlet.getSession(true) will cause sessions to be created even if they are not accessed which may be a performance issue so it is probably best that this fix is done. > HttpSessionScopeContainer requires a session to exist > ----------------------------------------------------- > > Key: TUSCANY-936 > URL: http://issues.apache.org/jira/browse/TUSCANY-936 > Project: Tuscany > Issue Type: Bug > Components: Java SCA Core > Affects Versions: Java-Mx > Reporter: Greg Dritschler > Priority: Minor > > In M1, the HttpSessionScopeContainer was able to lazy-initialize an HTTP > session. (Look at the class LazyHTTPSessionId to see how it worked.) Now > the HttpSessionScopeContainer requires a preexisting session. If a session > does not exist, a NullPointerException occurs when it tries to look up the > instance using a null key. > InstanceWrapper ctx = wrappers.get(key); > The problem can be circumvented by creating a session in the web app client. > JSPs have sessions by default. Servlets can call getSession(true) to ensure > a session exists before invoking an SCA component that requires session scope. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
