velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonie C Malan <>
Subject Problem when accessing a servlet
Date Wed, 13 Nov 2002 13:07:44 GMT
Hi All,

I had a very unusual problem.  When accessing the servlet in Tomcat from the 
browser the following is produced (only a bit following root cause pasted):

root cause
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
	at java.lang.ClassLoader.defineClass0(Native Method)
	at java.lang.ClassLoader.defineClass(

Now HttpServlet is in the servlet.jar which is in 
/usr/local/tomcat-4.1.12/common/lib.  I even copied 
servlet.jar to the lib directory under WEB-INF - no go.  
Eventually I had both servlet.jar and velocity-dep-1.3.1-rc2.jar in 
/usr/local/tomcat-4.1.12/common/lib and added both to the classpath.
This seemed to cure the problem.  My question is, which jars need to be in the 
classpath and which should be in which directories?  As I understand it, 
having jars in /usr/local/tomcat-4.1.12/common/lib makes them accessible to 
both Tomcat and servlets using Tomcat.  Is this correct?

It is only with Velocity servlets that I had this problem.  JSPs and other 
servlets had no problems.

Please let me know what goes where so I don't spend days with a problem like 
this again.

Thanks very much,

Chris Malan

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message