Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with Tomcat 5.5.26

 
Tonya Johnson
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  •  
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic