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 6614] New: - Have Bootstrap and StandardClassLoader use the same ClassLoader
Date Thu, 21 Feb 2002 16:20:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6614>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6614

Have Bootstrap and StandardClassLoader use the same ClassLoader

           Summary: Have Bootstrap and StandardClassLoader use the same
                    ClassLoader
           Product: Tomcat 4
           Version: 4.0.2 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: KAnderson@bbn.com


I'm starting tomcat through a URLClassLoader than knows where the
tomcat Bootstrap.jar and tools.jar are.

However, tomcat fails to start because it can't find 
org.apache.catalina.loader.Reloader (see the backtrace at the end of the 
message).

I believe the problem is because of the lines in Bootstrap:

            commonLoader =
                ClassLoaderFactory.createClassLoader(unpacked, packed, null);

Since the parent classloader is null, a StandardclassLoader is created that uses 
the ClassLoader.getSystemClassLoader() rather than my class loader.

I think if you change the line from null to
this.getClass().getClassLoader() it would then use my class loader and tomcat 
could start.



java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: 
org/apache/catalina/loader/Reloader
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
	at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at 
org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.jav
a:671)
	at 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.jav
a:1090)
	at 
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.jav
a:989)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
	at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3313)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
	at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
	at 
org.apache.catalina.core.StandardService.start(StandardService.java:388)
	at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
	at TomcatBootstrap.start(TomcatBootstrap.java:8)

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


Mime
View raw message