Bugs item #487994, was opened at 2001-12-01 21:58 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=487994&group_id=22866
Category: JBossServer Group: v2.4 (stable) Status: Closed Resolution: Invalid Priority: 5 Submitted By: Alex Pavlov (apavlov) Assigned to: Scott M Stark (starksm) Summary: JNDI context problem. Initial Comment: I use SUN JDK 1.3.1_01 Server HotSpot VM, Win2K Proff. Problem exist on next bundles: JBoss 2.4.3+Tomcat 3.2 JBoss 2.4.3+Tomcat 4.01 JBoss 3.0alpaha+Jetty Problem: I put some object into HttpSession. Object implements HttpSession listener, and should perform some operation on JNDI context. Everything work fine for method 'valueBound(HttpSessionBindingEvent event)', but if I try to work with with JNDI from method 'valueUnbound(HttpSessionBindingEvent event)', I've got NameNotFoundException: conext 'env' not bound. Here is server log: [Default] Unbound from session: 0hkf2a5ei1 [Default] Event name: TestSessionScopeJNDI [Default] javax.naming.NameNotFoundException: env not bound [Default] at org.jnp.server.NamingServer.getBinding (NamingServer.java:495) [Default] [Default] at org.jnp.server.NamingServer.getBinding (NamingServer.java:503) [Default] [Default] at org.jnp.server.NamingServer.getObject (NamingServer.java:509) [Default] [Default] at org.jnp.server.NamingServer.lookup (NamingServer.java:282) [Default] [Default] at org.jnp.interfaces.NamingContext.lookup (NamingContext.java:349) [Default] [Default] at org.jnp.interfaces.NamingContext.lookup (NamingContext.java:457) [Default] [Default] at org.jnp.interfaces.NamingContext.lookup (NamingContext.java:333) [Default] [Default] at javax.naming.InitialContext.lookup (Unknown Source) [Default] [Default] at JndiPrintBean.valueUnbound(Unknown Source) [Default] [Default] at org.apache.tomcat.session.StandardSession.removeAttribu te(StandardSession.java:670) [Default] [Default] at org.apache.tomcat.session.StandardSession.expire (StandardSession.java:383) [Default] [Default] at org.apache.tomcat.session.StandardManager.processExpire s(StandardManager.java:483) [Default] [Default] at org.apache.tomcat.session.StandardManager.run (StandardManager.java:553) [Default] [Default] at java.lang.Thread.run(Unknown Source) [Default] ---------------------------------------------------------------------- >Comment By: Alex Pavlov (apavlov) Date: 2001-12-08 16:34 Message: Logged In: YES user_id=391187 I test it on BEA weblogic and orion server. This code work fine. I suspect here is a classloader issue: Print of Thread.currentThread().getContextClassLoader() for method valueBound() is here: org.mortbay.http.ContextLoader(file:/F:/tools/jboss- 3.0.0alpha/deploy/Default/advisor.ear/web1001/WEB- INF/lib/advisor-client.jar;file:/F:/tools/jboss- 3.0.0alpha/deploy/Default/advisor.ear/web1001/WEB-INF/ lib/jboss-client.jar;file:/F:/tools/jboss- 3.0.0alpha/deploy/Default/advisor.ear/web1001/WEB- INF/lib/jbosssx-client.jar;file:/F:/tools/jboss- 3.0.0alpha/deploy/Default/advisor.ear/web1001/WEB- INF/lib/jnp-client.jar;file:/F:/tools/jboss-3.0.0a lpha/deploy/Default/advisor.ear/web1001/WEB-INF/classes/) / java.net.URLClassLoader@48ef56 and list of classloaders for method valueUnbound() is much shorter: java.net.URLClassLoader@48ef56 Do you insist on running this test for standalone tomcat, or will be satisfied with log file from Orion v1.5.2 ? ---------------------------------------------------------------------- Comment By: Scott M Stark (starksm) Date: 2001-12-08 16:21 Message: Logged In: YES user_id=175228 It was not a request dispatch thread interacting with a servlet or JSP page. That is the ONLY thread that has the correct context for accessing the java:comp/env JNDI Context. Demonstrate that you can access this context in a standalone tomcat and I'll considering reopening this. ---------------------------------------------------------------------- Comment By: Alex Pavlov (apavlov) Date: 2001-12-08 16:14 Message: Logged In: YES user_id=391187 Yes, you're completly right, I know about threading restriction in J2EE. BUT IT WAS a tomcat thread(not my custon), so would you, please so kind, discuss problem instead closing bug? I bet, you didn't run test(bean&jsp) even before closing bug. ---------------------------------------------------------------------- Comment By: Scott M Stark (starksm) Date: 2001-12-08 15:22 Message: Logged In: YES user_id=175228 You cannot interact with the java:comp/env namespace outside of a thread that invokes methods on the container component(servlet, EJB). This stack trace shows some arbitrary thread from tomcat releasing the session resources. Only the tomcat thread used to invoke a servlet method can access the java:comp/env of the servlet's web application. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=487994&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development