tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Wilson" <vickowil...@hotmail.com>
Subject problems with ClassLoader???
Date Sat, 05 Jul 2003 18:34:09 GMT
hi all,

I'm having problems when loading classes through ClassLoaders.  The 
following code (when compiled as a normal java file) works fine, and allows 
me to instantiate any java object where the bytecode is in the directory 
specified by 'url'.

*****************
URL[] url = {new URL("file://C:/Program 
Files/FastObjects_Trial/Examples_ODMG/Javac2/Toons/")};

ClassLoader loader = new URLClassLoader(url);
Thread.currentThread().setContextClassLoader(loader);
******************

However, when running the above code within a web app that is running on 
Tomcat (version 4.1.18) then I get the following runtime error:

java.lang.ClassNotFoundException: Toon   at
            
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1428) 
at
            
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274) 
at
            java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at
            java.lang.Class.forName0(Native Method)   at
            java.lang.Class.forName(Class.java:140)   at
            com.poet.rt.db.LocalPersManagerFactory.loadUserClass(Unknown 
Source)   at
            com.poet.rt.db.JdoLazyUserOptionsRetriever.loadUserClass(Unknown 
Source)   at
            com.poet.rt.db.MetaDataManager.loadClass(Unknown Source)
            at com.poet.rt.db.MetaDataManager.addClassSlots(Unknown Source)  
  at
            com.poet.rt.db.MetaDataManager.addClassSlots(Unknown Source) at
            com.poet.rt.db.MetaDataManager.loadRuntimeClass(Unknown Source)  
  at
            com.poet.rt.db.ClassManager.loadRuntimeClass(Unknown Source) at
            com.poet.rt.db.MetaDataManager.getClassMetaData(Unknown Source)  
  at

....

The stack trace seems to indicate that the JVM isn't even using my declared 
URLClassLoader to find the required class definition.  Can anybody help? 
Thanks in advance ....

Regards
Andy Wilson

_________________________________________________________________
Find a cheaper internet access deal - choose one to suit you. 
http://www.msn.co.uk/internetaccess


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


Mime
View raw message