File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Error allocating a servlet instance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Error allocating a servlet instance" Watch "Error allocating a servlet instance" New topic
Author

Error allocating a servlet instance

vishnu bhavani
Greenhorn

Joined: May 17, 2006
Posts: 1
I am new to VTL(Velocity Template Language) when I am trying to access Velocity template through the servlet it throwing an error as shown and the environment using is jdk1.5.0_06, eclipse editor(3.1 +WTP) and velocity(1.4) jar files integrated with eclipse editor.

javax.servlet.ServletException: Error allocating a servlet instance
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:595)


root cause

java.lang.NoClassDefFoundError: org/apache/velocity/servlet/VelocityServlet
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Looks like Tomcat can't see the velocity code. Try putting the jars in the tomcat_home/webapps/content/WEB-INF/lib directory
Sandeep Sundaram
Greenhorn

Joined: Mar 22, 2005
Posts: 9
Looks like the environment is not set up properly. Make sure that all required jar-files are present in ur CLASSPATH.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"vishnu",
Please change your display name back. Accounts with invalid display names get deleted.

Dave
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Please heep discussion on the board, I only check my email every few days.

I all ready put velocity jars in the classpath through the eclipse editor even though it is showing the same error.


The Eclipse classpath is not the same as the suggestion we made. You have set it up to work atcompile time, but you need to place them where we said for them to be found at run time.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
Make sure that all required jar-files are present in ur CLASSPATH.

No - Tomcat ignores the environment CLASSPATH setting - see the ..\tomcat-docs\class-loader-howto.html file in a typical Tomcat distribution.
Bill
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

vishnu,
Welcome to JavaRanch!

We're pleased to have you here with us in the servlets forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

vishnu bhavani,
Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error allocating a servlet instance
 
Similar Threads
My First WebApplication Exception
Servlet error or class path?
tomcat error 500- when executing loginservlet example
Name based virtual hosts
I really stuck and need help