velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonie C Malan <malan2...@optusnet.com.au>
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(ClassLoader.java:509)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:54

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
malan2000@optusnet.com.au

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message