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 20:29

Message:
Logged In: YES 
user_id=391187

I mapped JBoss'es java:DefaultDS to 
name /jdbc/expound/advisor/AdvisorDS 
and /jdbc/expound/advisor/AnalyticsDS in web.xml.
I hope this ENC entries will be enough for test.

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2001-12-08 17:45

Message:
Logged In: YES 
user_id=175228

Attach the complete war with web.xml that establishes the 
ENC entries and I'll look at it under JBoss/Tomcat-4.0.1

----------------------------------------------------------------------

Comment By: Alex Pavlov (apavlov)
Date: 2001-12-08 17:33

Message:
Logged In: YES 
user_id=391187

Please find part of log file for Orion, Tomcat4 and Tomcat3:
ORION v 1.5.2
Bound into session: EOKPGNBAIAGF
Is session new: true
Event name: TestSessionScopeJNDI
ClassLoader: [ThreadContextLoader, current context: 
[ClassLoader: [[F:\SE_Messag
eServer\mr\dist\orion-message-router.ear\advisor\WEB-
INF\lib/advisor-client.jar]
, [F:\SE_MessageServer\mr\dist\orion-message-
router.ear\advisor\WEB-INF\classes]
]]]
 +- PSBean (class: com.evermind._xa)
 +- jdbc/AnalyticsDS (class: 
com.evermind.sql.DriverManagerDataSource)
 +- jdbc/AdvisorDS (class: 
com.evermind.sql.DriverManagerDataSource)

Unbound from session: EOKPGNBAIAGF
Event name: TestSessionScopeJNDI
ClassLoader: [ThreadContextLoader, current context: 
[ClassLoader: [[F:\SE_Messag
eServer\mr\dist\orion-message-router.ear\advisor\WEB-
INF\lib/advisor-client.jar]
, [F:\SE_MessageServer\mr\dist\orion-message-
router.ear\advisor\WEB-INF\classes]
]]]
 +- PSBean (class: com.evermind._xa)
 +- jdbc/AnalyticsDS (class: 
com.evermind.sql.DriverManagerDataSource)
 +- jdbc/AdvisorDS (class: 
com.evermind.sql.DriverManagerDataSource)

Log file of Tomcat 4.0.1:
Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
Starting service Tomcat-Apache
Apache Tomcat/4.0.1
Bound into session: 04C46173A2F1381392C4C9A843D517F7
Is session new: true
Event name: TestSessionScopeJNDI
ClassLoader: WebappClassLoader
  available:
  delegate: false
  repositories:
    /WEB-INF/classes/
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
  delegate: true
  repositories:
    file:F:\tools\catalina\classes\
    file:F:\tools\catalina\lib\jasper-compiler.jar
    file:F:\tools\catalina\lib\jasper-runtime.jar
    file:F:\tools\catalina\lib\naming-factory.jar
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
    Extension[javax.mail, implementationVendor=Sun 
Microsystems, Inc., implement
ationVendorId=com.sun, implementationVersion=1.2, 
specificationVendor=Sun Micros
ystems, Inc., specificationVersion=1.2]
  delegate: true
  repositories:
    file:F:\tools\catalina\common\classes\
    file:F:\tools\catalina\common\lib\activation.jar
    file:F:\tools\catalina\common\lib\jdbc2_0-stdext.jar
    file:F:\tools\catalina\common\lib\jta.jar
    file:F:\tools\catalina\common\lib\mail.jar
    file:F:\tools\catalina\common\lib\naming-common.jar
    file:F:\tools\catalina\common\lib\naming-resources.jar
    file:F:\tools\catalina\common\lib\servlet.jar
    file:F:\tools\catalina\common\lib\tyrex-0.9.7.0.jar
    file:F:\tools\catalina\common\lib\xerces.jar
  required:
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader@71732b




Unbound from session: 04C46173A2F1381392C4C9A843D517F7
Event name: TestSessionScopeJNDI
ClassLoader: StandardClassLoader
  available:
  delegate: true
  repositories:
    file:F:\tools\catalina\server\classes\
    file:F:\tools\catalina\server\lib\catalina.jar
    file:F:\tools\catalina\server\lib\jakarta-regexp-1.2.jar
    file:F:\tools\catalina\server\lib\servlets-common.jar
    file:F:\tools\catalina\server\lib\servlets-default.jar
    file:F:\tools\catalina\server\lib\servlets-invoker.jar
    file:F:\tools\catalina\server\lib\servlets-manager.jar
    file:F:\tools\catalina\server\lib\servlets-snoop.jar
    file:F:\tools\catalina\server\lib\servlets-webdav.jar
    file:F:\tools\catalina\server\lib\tomcat-ajp.jar
    file:F:\tools\catalina\server\lib\tomcat-util.jar
    file:F:\tools\catalina\server\lib\warp.jar
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
    Extension[javax.mail, implementationVendor=Sun 
Microsystems, Inc., implement
ationVendorId=com.sun, implementationVersion=1.2, 
specificationVendor=Sun Micros
ystems, Inc., specificationVersion=1.2]
  delegate: true
  repositories:
    file:F:\tools\catalina\common\classes\
    file:F:\tools\catalina\common\lib\activation.jar
    file:F:\tools\catalina\common\lib\jdbc2_0-stdext.jar
    file:F:\tools\catalina\common\lib\jta.jar
    file:F:\tools\catalina\common\lib\mail.jar
    file:F:\tools\catalina\common\lib\naming-common.jar
    file:F:\tools\catalina\common\lib\naming-resources.jar
    file:F:\tools\catalina\common\lib\servlet.jar
    file:F:\tools\catalina\common\lib\tyrex-0.9.7.0.jar
    file:F:\tools\catalina\common\lib\xerces.jar
  required:
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader@71732b


javax.naming.NameNotFoundException: Name java:comp is not 
bound in this Context
        at org.apache.naming.NamingContext.lookup
(NamingContext.java:811)
        at org.apache.naming.NamingContext.lookup
(NamingContext.java:194)
        at javax.naming.InitialContext.lookup
(InitialContext.java:350)
        at JndiPrintBean.valueUnbound(JndiPrintBean.java:50)
        at 
org.apache.catalina.session.StandardSession.removeAttribute
(StandardS
ession.java:1073)
        at 
org.apache.catalina.session.StandardSession.expire
(StandardSession.ja
va:596)
        at 
org.apache.catalina.session.StandardManager.processExpires
(StandardMa
nager.java:755)
        at org.apache.catalina.session.StandardManager.run
(StandardManager.java:
831)
        at java.lang.Thread.run(Thread.java:484)


Log file of Tomcat 3.2.3:
Bound into session: vuzjrtza31
Is session new: true
Event name: TestSessionScopeJNDI
ClassLoader: sun.misc.Launcher$AppClassLoader@71732b
javax.naming.NoInitialContextException: Need to specify 
class name in environmen
t or system property, or as an applet parameter, or in an 
application resource f
ile:  java.naming.factory.initial
        at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:6
43)
        at javax.naming.InitialContext.getDefaultInitCtx
(InitialContext.java:246
)
        at 
javax.naming.InitialContext.getURLOrDefaultInitCtx
(InitialContext.jav
a:283)
        at javax.naming.InitialContext.lookup
(InitialContext.java:350)
        at JndiPrintBean.valueBound(JndiPrintBean.java:32)
        at 
org.apache.tomcat.session.StandardSession.setAttribute
(StandardSessio
n.java:734)
        at _0002fsnoop_0002ejspsnoop_jsp_0._jspService
(_0002fsnoop_0002ejspsnoop
_jsp_0.java:180)
        at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
        at 
org.apache.jasper.servlet.JspServlet$JspCountedServlet.servi
ce(JspSer
vlet.java:130)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
        at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.servi
ce(JspSer
vlet.java:282)
        at 
org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:4
29)
        at org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:500)
        at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:4
05)
        at org.apache.tomcat.core.Handler.service
(Handler.java:287)
        at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372
)
        at 
org.apache.tomcat.core.ContextManager.internalService
(ContextManager.
java:812)
        at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:758
)
        at 
org.apache.tomcat.service.http.HttpConnectionHandler.process
Connectio
n(HttpConnectionHandler.java:213)
        at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:
416)
        at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java
:501)
        at java.lang.Thread.run(Thread.java:484)
Unbound from session: vuzjrtza31
Event name: TestSessionScopeJNDI

ClassLoader: sun.misc.Launcher$AppClassLoader@71732b
javax.naming.NoInitialContextException: Need to specify 
class name in environmen
t or system property, or as an applet parameter, or in an 
application resource f
ile:  java.naming.factory.initial
        at javax.naming.spi.NamingManager.getInitialContext
(NamingManager.java:6
43)
        at javax.naming.InitialContext.getDefaultInitCtx
(InitialContext.java:246
)
        at 
javax.naming.InitialContext.getURLOrDefaultInitCtx
(InitialContext.jav
a:283)
        at javax.naming.InitialContext.lookup
(InitialContext.java:350)
        at JndiPrintBean.valueUnbound(JndiPrintBean.java:50)
        at 
org.apache.tomcat.session.StandardSession.removeAttribute
(StandardSes
sion.java:670)
        at org.apache.tomcat.session.StandardSession.expire
(StandardSession.java
:383)
        at org.apache.tomcat.session.StandardManager.stop
(StandardManager.java:4
28)
        at 
org.apache.tomcat.session.StandardSessionInterceptor.context
Shutdown(
StandardSessionInterceptor.java:238)
        at 
org.apache.tomcat.core.ContextManager.shutdownContext
(ContextManager.
java:517)
        at 
org.apache.tomcat.core.ContextManager.removeContext
(ContextManager.ja
va:591)
        at org.apache.tomcat.core.ContextManager.shutdown
(ContextManager.java:47
0)
        at org.apache.tomcat.core.ContextManager.stop
(ContextManager.java:539)
        at 
org.apache.tomcat.service.connector.AJP12RequestAdapter.read
NextReque
st(Ajp12ConnectionHandler.java:400)
        at 
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.p
rocessCon
nection(Ajp12ConnectionHandler.java:147)
        at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:
416)
        at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java
:501)
        at java.lang.Thread.run(Thread.java:484)

In last logs I've got exception, but this happened because 
Tomcat has no built in JNDI context. 
Will you consider this test, if I setup JNP as default JNDI 
for Tomcat 3.2.3. and run test one more time.

----------------------------------------------------------------------

Comment By: Scott M Stark (starksm)
Date: 2001-12-08 16:38

Message:
Logged In: YES 
user_id=175228

BEA and Orion have tightly integrated web containers. 
Unless you can demonstrate that Jetty, Tomcat or whatever 
servlet container you are embedding in JBoss uses a thread 
with the correct class loader, this is not something we 
will fix as it requires changes to the internals of the 
servlet container.


----------------------------------------------------------------------

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

Reply via email to