Hello,

I have a ClassCast problem. I read the archive and attempted few
suggestions (like grouping everything in one jar in WEB-INF/lib) without
success.

I am using tomcat 4.0.4 and 1.3.1_02 under Solaris.

Someone suggested looking at the ClassLoaders. The following is
generated by something like: 
Log4j("MyClass " + MyClass.class.getClassLoader());

--------------------------------------------------------------------
2002-07-13 18:36:56,808 - - MyClass WebappClassLoader
  available:
  delegate: false
  repositories:
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
  delegate: true
  repositories:
    file:/serverPath/jakarta-tomcat-4.0.4/classes/
    file:/serverPath/jakarta-tomcat-4.0.4/lib/jasper-runtime.jar
    file:/serverPath/jakarta-tomcat-4.0.4/lib/jasper-compiler.jar
    file:/serverPath/jakarta-tomcat-4.0.4/lib/naming-factory.jar
  required:
----------> Parent Classloader:
StandardClassLoader
  available:
    Extension[javax.mail, implementationVendor=Sun Microsystems, Inc.,
implementationVendorId=com
.sun, implementationVersion=1.2, specificationVendor=Sun Microsystems,
Inc., specificationVersion
=1.2]
  delegate: true
  repositories:
    file:/serverPath/jakarta-tomcat-4.0.4/common/classes/
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/naming-common.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/servlet.jar
 
file:/serverPath/jakarta-tomcat-4.0.4/common/lib/naming-resources.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/jdbc2_0-stdext.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/activation.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/jta-spec1_0_1.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/xerces.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/tyrex-0.9.7.0.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/mail.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/jndi.jar
    file:/serverPath/jakarta-tomcat-4.0.4/common/lib/cos.jar
  required:
----------> Parent Classloader:
sun.misc.Launcher$AppClassLoader@3f52a5


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

just after that I try a Class.forName("MyClass"); 
but I get a ClassNotFound exception.


Is that normal that I don't see listed the webapps/myApp/WEB-INF/lib in
the repositories above?

In the ClassCast issue, both classes return the same loader.

Thanks,
Thierry


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to