Re: Tomcat Class.forName.
Check that the class where you're trying to instanciate the one located under WEB-INF/classes is not is common/lib or common/classes. Darién Martínez Torres wrote: Hi everybody, I get a ClassNotFoundException when I try to load a class dynamically and it is not in Tomcats riguired libraries and it is under WEB-INF/classes directory of my web app. Tomcat should not look for the class under that directory? Thanks, any help or idea will be wellcome. Darien -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: java.lang.NoClassDefFoundError
I had a similar problem a few days ago when one of my class located under common/lib was implementing an interface defined in a jar located under WEB-INF/lib, this gives a java.lang.NoClassDefFoundError since the common/lib classloader can't access the jar located under WEB-INF/lib to check the class signature... Hope this helps. Korakaki Stella wrote: I've placed my servlet in the directory : $CATALINA_HOME/webapps/ROOT/WEB-INF/classes/Login.class and I've written the following at the $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml : ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-name login /servlet-name servlet-class Login /servlet-class /servlet /web-app . Also, I've placed my .jar file at the directory : $CATALINA_HOME/webapps/ROOT/WEB-INF/lib/jCo.jar . When I try to reach the address http://localhost/servlet/login it seems that tomcat can't find my .jar file. I've tried a simple servlet with no specific dependencies and worked fine. Please someone tell me what to do in order to have my servlet working... Stella Korakaki Koutoudis Consulting -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat Class.forName.
That's strange, I'm currently using version 4.0.4b1 and I don't have this kind of problem, though I'm using different packages inside my webapp and I'm dynamically loading classes located under WEB-INF/classes... Regards. Darién Martínez Torres wrote: No, the class the class was only in WEB-INF/classes. Furthermore, I couldn't any class outside the package of the servlet that load the class. I put a breackpoint in th Class.forName() line and try to load some other class. The same results. The only way I dont get an exception was putting my package in the Tomcats required libraries. Thanks for you quickly answer. Regards Darien - Original Message - From: Jean-pierre Cartal [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, March 28, 2002 11:25 AM Subject: Re: Tomcat Class.forName. Check that the class where you're trying to instanciate the one located under WEB-INF/classes is not is common/lib or common/classes. Darién Martínez Torres wrote: Hi everybody, I get a ClassNotFoundException when I try to load a class dynamically and it is not in Tomcats riguired libraries and it is under WEB-INF/classes directory of my web app. Tomcat should not look for the class under that directory? Thanks, any help or idea will be wellcome. Darien -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
webappclassloader problem
Hi, I've a webapp which contains has some jar files located in WEB-INF/lib. One of this jar file contains a class that is using class.forname method to instantiate another class located in the same jar file. Unfortunately, this gives me a java.lang.NoClassDefFoundError. As I read that previous versions had problem loading jar files located under WEB-INF/lib, I upgraded to version 4.0.4b1, but the problem was still there. So I added some code to print which classloader this class was using when trying to instantiate and the result is as follow: WebappClassLoader^M available:^M delegate: false^M repositories:^M /WEB-INF/classes/^M required:^M -- Parent Classloader:^M StandardClassLoader^M available:^M delegate: true^M repositories:^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/classes/^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/lib/naming-factory.jar^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/lib/jasper-compiler.jar^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/lib/jasper-runtime.jar^M required:^M -- Parent Classloader:^M StandardClassLoader^M available:^M Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2]^M delegate: true^M repositories:^M From what I understand, the webappclassloader does not take into account all jar files located under WEB-INF/lib, hence the NoClassDefFoundError. I'm doing something wrong or is it a problem with the classloader ? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: webappclassloader problem
I found the problem. I was trying to instantiate a class that was located in a jar in common/lib, however this class was implementing an interface located in a jar in WEB-INF/lib, and thus the signature could not be found :-( [EMAIL PROTECTED] wrote: Hi, I've a webapp which contains has some jar files located in WEB-INF/lib. One of this jar file contains a class that is using class.forname method to instantiate another class located in the same jar file. Unfortunately, this gives me a java.lang.NoClassDefFoundError. As I read that previous versions had problem loading jar files located under WEB-INF/lib, I upgraded to version 4.0.4b1, but the problem was still there. So I added some code to print which classloader this class was using when trying to instantiate and the result is as follow: WebappClassLoader^M available:^M delegate: false^M repositories:^M /WEB-INF/classes/^M required:^M -- Parent Classloader:^M StandardClassLoader^M available:^M delegate: true^M repositories:^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/classes/^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/lib/naming-factory.jar^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/lib/jasper-compiler.jar^M file:/home/cartaljp/Dev/Tomcat4.0/jakarta-tomcat-4.0.4-b1/lib/jasper-runtime.jar^M required:^M -- Parent Classloader:^M StandardClassLoader^M available:^M Extension[javax.mail, implementationVendor=Sun Microsystems, Inc., implementationVendorId=com.sun, implementationVersion=1.2, specificationVendor=Sun Microsystems, Inc., specificationVersion=1.2]^M delegate: true^M repositories:^M From what I understand, the webappclassloader does not take into account all jar files located under WEB-INF/lib, hence the NoClassDefFoundError. I'm doing something wrong or is it a problem with the classloader ? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]