Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Tomcat Error

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Still i am getting the same error

with regards
pankaj
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
    Bookmark Topic Watch Topic
  • New Topic