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

Help with Tomcat 5.5.26

Tonya Johnson
Greenhorn

Joined: Feb 04, 2008
Posts: 16
My comapany recently upgraded to Tomcat 5.5.26 from Tomcat 4.0.4. I have been put in charge of getting our applications up and running in the new version. I am trying to run tests on the server in Tomcat to see if it is accepting .jsp and servlets. The .jsp files are working find but when I try to test a servlet I am getting an error. Can someone please help me with this? I change the web.xml file to enable the servlet and servlet-mapping elements. I also changed the context.xml file and set reloadable to true. I am going to copy in the error that I am receiving.

Thanks in advance.

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/HelloServlet
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:389)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:134)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.UnsupportedClassVersionError: Bad version number in .class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:370)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:134)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.26
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

It looks like you've compiled with a newer version of Java than the one under which Tomcat is running.
Either:
  • Upgrade the version of Java that Tomcat is using
  • Recompile with the same version that Tomcat is using
  • or.. Look into javac's -source and -target switches to create classes that are compatible with older JVMs.


  • Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Help with Tomcat 5.5.26
     
    Similar Threads
    Hi Servlet invoke error
    Loading a servlet using jdk1.4 in Tomcat
    java.lang.ClassFormatError: Incompatible magic value 13375 in class file mycontroller/ValidatorExc
    Error 500 when compiling servlet
    I'm not sure the problem is the servlet