Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 1.0-beta-5
-
Fix Version/s: None
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Environment:Using Pico 1.0-SNAPSHOT, Pico extras 1.0-alpha-1-SNAPSHOT, WebWork 2.0-beta2 and XWork 1.0-beta2, Tomcat 4.1.29
-
Number of attachments :
Description
When using Pico container in a WW2 web application, the following exception is thrown when the servlet container shuts down (see below for a description of web.xml):
Session event listener threw exception
java.lang.RuntimeException: Cannot shutdown container
at org.picoextras.integrationkit.DefaultLifecycleContainerBuilder.killContainer(DefaultLifecycleContainerBuilder.java:57)
at org.picoextras.servlet.ServletContainerListener.sessionDestroyed(ServletContainerListener.java:74)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:659)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:608)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:793)
at org.apache.catalina.session.StandardManager.run(StandardManager.java:870)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.IllegalStateException: getAttribute: Session already invalidated
at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:954)
at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:171)
at org.picoextras.servlet.SessionScopeObjectReference.get(SessionScopeObjectReference.java:36)
at org.picoextras.integrationkit.DefaultLifecycleContainerBuilder.killContainer(DefaultLifecycleContainerBuilder.java:46)
... 6 more
--------
Extract from WW2/Pico environment setup (web.xml):
<context-param>
<param-name>assembler</param-name>
<param-value>mypackage.MyContainerAssembler</param-value>
</context-param>
<!-- PicoContainer Hook -->
<listener>
<listener-class>
org.picoextras.webwork2.WebWork2ContainerListener
</listener-class>
</listener>
<servlet>
<servlet-name>webwork</servlet-name>
<!-- PicoContainer enabled dispatcher -->
<servlet-class>
org.picoextras.webwork2.PicoServletDispatcher
</servlet-class>
</servlet>
Issue Links
Activity
Assignee | Joe Walnes [ jwalnes1 ] |
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Duplicate [ 3 ] | |
Assignee | Joe Walnes [ jwalnes1 ] | Aslak Hellesoy [ rinkrank ] |
To reproduce this issue,
PICO-74needs to be resolved.Here's a quick hack to get through
PICO-74and get this error:public class PicoActionInvocation extends DefaultActionInvocation implements KeyConstants {
<snip/>
/**
*/
private OgnlValueStack getStackSafely() {
OgnlValueStack stack = getStack();
if (stack != null) return stack;
if ((extraContext != null) && (extraContext.containsKey(ActionContext.VALUE_STACK))) {
stack = (OgnlValueStack) extraContext.get(ActionContext.VALUE_STACK);
if (stack == null)
{ throw new IllegalStateException("There was a null Stack set into the extra params."); }} else
{ // create the value stack // this also adds the ValueStack to its context stack = new OgnlValueStack(); }// put extraContext in
{ stack.getContext().putAll(extraContext); }if (extraContext != null)
return stack;
}
private MutablePicoContainer getParentContainer()
{ HttpServletRequest request = (HttpServletRequest) getStackSafely().getContext().get(WebWorkStatics.HTTP_REQUEST); ObjectReference ref = new RequestScopeObjectReference(request, REQUEST_CONTAINER); return (MutablePicoContainer) ref.get(); }}