Re: HttpServlet not found?

2005-11-29 Thread Sebastian Funk

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?

2005-11-29 Thread Martin Gainty
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 users@tomcat.apache.org
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?

2005-11-29 Thread Caldarale, Charles R
 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]