Bugs item #795775, was opened at 2003-08-26 20:11 Message generated for change (Comment added) made by starksm You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=795775&group_id=22866
Category: JBossWeb Group: v3.2 >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Brian Stansberry (bstansberry) >Assigned to: Scott M Stark (starksm) Summary: Webapp's ENC destroyed before ServletContextListener invoked Initial Comment: For a webapp I wrote a ServletContextListener that attempts to access an EJB when it's contextDestroyed() method is invoked. The call fails because the EmbeddedTomcatService's performUndeploy() method is unbinding the webapp's ENC before the listener gets invoked. >From what I read in the Servlet 2.3 spec and the ServletContextListener JavaDoc, contextDestroyed() is meant to be called, despite the past tense name, when "the servlet context is about to be shut down", not after it's shut down. Actually, from looking at the EmbeddedTomcatService.performUndeploy() code, it looks like the ENC will be gone before any servlet's destroy() method is invoked. The spec and the JavaDoc state that one of the purposes of destroy() is to allow a servlet to save any persistent state, so it would seem logical that the servlet should still have access to its ENC when destroy() is called. I'm going to start preparing and testing a patch for this, but if any of the gurus out there disagree with my interpretation of the spec, please let me know. Here's a stack trace. (Please note that c.w.jboss.tomcat.tc4.SingleSignOnTomcatService reference in the trace is 99.9% identical to o.j.web.tomcat.tc4.EmbeddedTomcatService; the differences don't impact this case) [19:03:21,507,ResourceTreeLoader] Intranet/ROOT: javax.naming.NameNotFoundException thrown during menu link clearing javax.naming.NameNotFoundException: env not bound at org.jnp.server.NamingServer.getBinding (NamingServer.java:495) at org.jnp.server.NamingServer.getBinding (NamingServer.java:503) at org.jnp.server.NamingServer.getObject (NamingServer.java:509) at org.jnp.server.NamingServer.lookup (NamingServer.java:253) at org.jnp.interfaces.NamingContext.lookup (NamingContext.java:528) at org.jnp.interfaces.NamingContext.lookup (NamingContext.java:642) at org.jnp.interfaces.NamingContext.lookup (NamingContext.java:507) at javax.naming.InitialContext.lookup (InitialContext.java:347) at com.wanconcepts.j2ee.util.NamingDelegate.lookup (NamingDelegate.java:71) at com.wanconcepts.j2ee.util.NamingDelegate.getEJBHome (NamingDelegate.java:54) at com.wanconcepts.j2ee.util.LocalRemoteHelper.getHome (LocalRemoteHelper.java:266) at com.wanconcepts.wcss.ejb.menu.ResourceTreeHelper.ge tResourceTreeFacade(ResourceTreeHelper.java:250) at com.wanconcepts.wcss.ejb.menu.ResourceTreeHelper.cle arMenuLinkChildren(ResourceTreeHelper.java:225) at com.wanconcepts.xnet.listener.ResourceTreeLoader.cont extDestroyed(ResourceTreeLoader.java:142) at org.apache.catalina.core.StandardContext.listenerStop (StandardContext.java:3310) at org.apache.catalina.core.StandardContext.stop (StandardContext.java:3663) at org.apache.catalina.core.ContainerBase.removeChild (ContainerBase.java:1036) at org.apache.catalina.core.StandardHostDeployer.remove (StandardHostDeployer.java:470) at org.apache.catalina.core.StandardHost.remove (StandardHost.java:852) at com.wanconcepts.jboss.tomcat.tc4.SingleSignOnTomcat Service.performUndeploy (SingleSignOnTomcatService.java:346) at org.jboss.web.AbstractWebContainer.stop (AbstractWebContainer.java:476) at org.jboss.deployment.MainDeployer.stop (MainDeployer.java:489) at org.jboss.deployment.MainDeployer.stop (MainDeployer.java:504) at org.jboss.deployment.MainDeployer.undeploy (MainDeployer.java:472) at org.jboss.deployment.MainDeployer.shutdown (MainDeployer.java:359) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke (ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke (MBeanServerImpl.java:546) at org.jboss.system.server.ServerImpl$ShutdownHook.shutd ownDeployments(ServerImpl.java:849) at org.jboss.system.server.ServerImpl$ShutdownHook.shutd own(ServerImpl.java:824) at org.jboss.system.server.ServerImpl$ShutdownHook.run (ServerImpl.java:812) ---------------------------------------------------------------------- >Comment By: Scott M Stark (starksm) Date: 2003-09-03 07:49 Message: Logged In: YES user_id=175228 The unbinding of the enc context has been moved to after the webapp shutdown for 3.2.2RC4. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=795775&group_id=22866 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
