Re: HttpServlet not found?
Hi, thanks a lot. Very quick. Only 3 minutes and I got help. Best regards, Sebastian Funk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpServlet not found?
> From: Sebastian Funk [mailto:[EMAIL PROTECTED] > Subject: Re: HttpServlet not found? > > But when I shouldn't set the $CLASSPATH, how can I load the MySQL- > Drivers? Read this: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html and then choose the appropriate spot in the Tomcat classloader hierarchy for the jar. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpServlet not found?
Hi, thanks for helping. that seems to work. I'll be watching it. But when I shouldn't set the $CLASSPATH, how can I load the MySQL- Drivers? Thanks $ Greetings, Sebastian Funk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpServlet not found?
> From: Martin Gainty [mailto:[EMAIL PROTECTED] > Subject: Re: HttpServlet not found? > > (otherwise take servlet-api.jar off CLASSPATH and put back > j2ee.jar to $J2EE_HOME\lib\j2ee.jar and place on CLASSPATH) I think you'll need to do more than that. Tomcat has a variety of class loaders, including one for each webapp, one for classes shared among all webapps, and one for classes common to the webapps and Tomcat itself. (This is in addition to the ones used by the JVM.) See: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html for details. The picture there is quite illustrative. This creates a tree of classloaders, and you will run into problems if the same classes are present in more than one place along a particular branch of the tree. I've gotten burned too many times by the CLASSPATH environment variable to use it anymore - I'd strongly suggest you delete that variable and use explicit -cp settings where necessary. This will help to prevent any classes showing up under the wrong loader inadvertently. The gist of all this is that you don't want both j2ee.jar and servlet-api.jar to be available to either your compilations or during Tomcat execution. It's possible that you might be able to replace servlet-api.jar with j2ee.jar in Tomcat's common/lib, but I haven't personally tried it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpServlet not found?
yes if you're going to implement a simple servlet and you will not be implementing any (entity) beans (otherwise take servlet-api.jar off CLASSPATH and put back j2ee.jar to $J2EE_HOME\lib\j2ee.jar and place on CLASSPATH) Martin- - Original Message - From: "Caldarale, Charles R" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Tuesday, November 29, 2005 11:07 AM Subject: RE: HttpServlet not found? > From: Sebastian [mailto:[EMAIL PROTECTED] > Subject: HttpServlet not found? > > I compiled it with > "javac -cp /home/tomcat/j2ee/lib/j2ee.jar:/home/tomcat/mysql > MyServlet.java". Using j2ee.jar with Tomcat usually results in much grief, since it contains many classes that conflict with those supplied by Tomcat. Suggest removing it from your system, or at least taking it out of your classpath. Use Tomcat's common/lib/servlet-api.jar instead. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpServlet not found?
HI, On Nov 29, 2005, at 5:07 PM, Caldarale, Charles R wrote: From: Sebastian [mailto:[EMAIL PROTECTED] Subject: HttpServlet not found? I compiled it with "javac -cp /home/tomcat/j2ee/lib/j2ee.jar:/home/tomcat/mysql MyServlet.java". Using j2ee.jar with Tomcat usually results in much grief, since it contains many classes that conflict with those supplied by Tomcat. Suggest removing it from your system, or at least taking it out of your classpath. Use Tomcat's common/lib/servlet-api.jar instead. that works fine, but just one time. Again, when I recompile my servlet, without any changes, I get that error. I set all $CLASSPATH's new and move j2ee.jar to another place, where it shouldn't be find. but I get the same error "NoClassDefFoundError". Thanks & Greetings, Sebastian Funk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpServlet not found?
> From: Sebastian [mailto:[EMAIL PROTECTED] > Subject: HttpServlet not found? > > I compiled it with > "javac -cp /home/tomcat/j2ee/lib/j2ee.jar:/home/tomcat/mysql > MyServlet.java". Using j2ee.jar with Tomcat usually results in much grief, since it contains many classes that conflict with those supplied by Tomcat. Suggest removing it from your system, or at least taking it out of your classpath. Use Tomcat's common/lib/servlet-api.jar instead. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HttpServlet not found?
Hi list, First of all, sorry for my English, it's not my own language. I've installed a tomcat (5.5.12) on debian/testing. Tomcat run perfectly fine with all servlets I got. But one of my "webapps" doesn't work. It connetcs to an MySQL-Database. It doesn't found the drivers. But that's not the problem. The problem is, when I try to call one of the servlets (doesn't matter wich one, even simply "Hello World" does not work) I get an NoClassDefFoundError. I compiled it with "javac -cp /home/tomcat/j2ee/lib/j2ee.jar:/home/tomcat/mysql MyServlet.java". This displays no error. But I can't access the servlet. it shows me that: exception javax.servlet.ServletException: Error allocating a servlet instance ... root cause java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet all that happens only in one "webapps"-dircetory, all others are working fine. Even when I copy one servlet from another "webapp" to it, I get that error. My $CLASSPATH is setting to this /.../j2ee/lib/j2ee.jar:/../apache-tomcat-5.5.12/common/lib/servlet- api.jar:/../mysql/com/:/../mysql/org:/../ apache-tomcat-5.5.12/common/ lib/ When I try to run that servlet with "java" I get that error: java.lang.ClassNotFoundException: LoadDriver not found in java.lang.ClassLoader$1{urls=[file: and then comes the whole $CLASSPATH Thanks for help and best regards, Sebastian Funk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]