This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Error" Watch "Tomcat Error" New topic
Author

Tomcat Error

pankaj patil
Ranch Hand

Joined: Dec 19, 2004
Posts: 98
hi
i am getting this error when start my tomcat

javax.servlet.ServletException: javax/servlet/Servlet
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


java.lang.NoClassDefFoundError: javax/servlet/Servlet
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:299)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
java.lang.ClassLoader.loadClass(ClassLoader.java:299)
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
java.lang.ClassLoader.loadClass(ClassLoader.java:299)
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1319)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:150)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:158)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



can any one sort out this problem


Regards,
Pankaj Patil
Manoj Kumkumath
Ranch Hand

Joined: Dec 01, 2005
Posts: 71
Pankaj,

java.lang.NoClassDefFoundError: javax/servlet/Servlet

So Servlet class is not in your class path. So servlet-api.jar is not in your classpth(jakarta-tomcat-5.0.28). J

Check your classpth
Anupam Bhatt
Ranch Hand

Joined: Mar 12, 2004
Posts: 81
Thats right.
Servlet.jar is not included in your class path. Download it if you do not have it [quite rare if you use lot of java ide and tools],
and then add it to your classpath.
Restart tomcat and you are done !

Thanks,
Anupam Bhatt
pankaj patil
Ranch Hand

Joined: Dec 19, 2004
Posts: 98
hi
Still i am getting the same error

with regards
pankaj
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
Exactly how are you trying to start Tomcat?
How did you install Tomcat - from zip or exe?
Which version of Tomcat? Which operating system? Which SDK version?
Have you defined JAVA_HOME and CATALINA_HOME environment variables?
Bill
Jack Straw
Greenhorn

Joined: Mar 06, 2006
Posts: 1
I'm having similar trouble with Tomcat 5.0.28.

The 'servlet-api.jar' IS present in the '/common/lib' directory, but I continue to get "NoClassDefError javax/servlet/Servlet" errors. I have other web apps that are functioning properly ... except this one.

I also receive the following error:

Error deploying application at context path null
java.lang.reflect.InvocationTargetException
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
.
.
.
etc.

and this one:

org.apache.commons.digester.Digester.endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:39)
.
.
.
etc.

I'm on Windows XP. I installed Tomcat 5 as an NT service, but I can no longer use that service as I have to configure my Java options differently from what the service was configured to use. Therefore, I run Tomcat 5 from the command line with the 'startup.bat' file.

Any thoughts on why Tomcat can't find the Servlet right under it's nose???

Thanks!

- JS
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Error
 
Similar Threads
weblogic 10 web service Standalone client issue
"Unknown constant tag 108" error !! What is it about ?
Junit testing
Sealing Violation
Help using htmlunit