tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38630] - Environment (java:comp/env/) sometimes not available
Date Mon, 16 Oct 2006 14:37:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38630>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38630





------- Additional Comments From nicolas.damour@free.fr  2006-10-16 07:37 -------
Hi!

I had the same problem too, and I tracked this down to a possible problem
related to the persistence mechanism. My guess is that this bug happens only
when objects having static initializers that need application resources have
been persisted. If the server is shut down and such , the next time the server
starts up, it tries to deserialize these objects before the resources of the
application are available, and to invoke the static initializers before these
have all the necessary resources available. I wrote a small testcase application.

Instructions:
- have your Tomcat (I tested this on 5.0.28) shut down.
- copy the file Bug38630TestApp.war into your TOMCAT_HOME/webapps directory
- copy the file Bug38630TestApp.xml into your
TOMCAT_HOME/conf/Catalina/localhost directory (or whatever directory applicable)
- start your Tomcat
- access the application Bug38630TestApp; this should send you to a page called
index.jsp saying "This is only a test welcome file"; in the log, you will see
that the application resource has been accessed, and that an object has been
stored in the session
- shut your Tomcat down
- check in your TOMCAT_HOME/work/Catalina/localhost/Bug38630TestApp directory,
you will now probably find the following file: SESSIONS.ser; I guess this is the
serialized object
- start your Tomcat up again

There you are:

16.10.2006 16:27:43 org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\Programme\Jakarta-Tomcat
5.0\conf\Catalina\localhost\Bug38630TestApp.xml
2006-10-16 16:27:43,191 INFO  my.test.InitClass - Looking up
java:comp/env/myResource
javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
        at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at my.test.InitClass.getParamForTestClass(Unknown Source)
        at my.test.TestClass.<clinit>(Unknown Source)
        at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
        at java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1641)
        at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:47)
        at java.io.ObjectStreamClass$1.run(ObjectStreamClass.java:175)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.io.ObjectStreamClass.getSerialVersionUID(ObjectStreamClass.java:172)
        at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:515)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
        at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1342)
        at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:885)
        at
org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:416)
        at
org.apache.catalina.session.StandardManager.load(StandardManager.java:343)
        at
org.apache.catalina.session.StandardManager.start(StandardManager.java:657)
        at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:499)
        at
org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:315)
        at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:635)
        at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
        at
org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903)
        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:585)
        at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
        at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
        at org.apache.commons.digester.Rule.end(Rule.java:276)
        at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
        at
org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.commons.digester.Digester.parse(Digester.java:1567)
        at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
        at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
        at org.apache.catalina.core.StandardService.start(StandardService.java:480)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)


I hope this will help, I don't know if this is normal or faulty behaviour, just
thought this could help identify the bug, if there is any, or at least the
problem reported.

Best regards,

Nicolas.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message