wood burning stoves*
The moose likes Tomcat and the fly likes Hi Servlet invoke error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Hi Servlet invoke error" Watch "Hi Servlet invoke error" New topic
Author

Hi Servlet invoke error

Shaan patil
Ranch Hand

Joined: Dec 22, 2007
Posts: 58
Hi, I am getting the following error when I try to invoke a servlet(ThreeParams) in the coreservletes package.



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/coreservlets.ThreeParams
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:388)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.UnsupportedClassVersionError: coreservlets/ThreeParams (Unsupported major.minor version 50.0)
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:539)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
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.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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


Waiting for the solution,


Regards
[ January 28, 2008: Message edited by: Shaan patil ]

"You cannot change the truth but truth can change you "
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410




This happens when you try to run a class that was compiled with a more recent version of java than the JRE you're using.

Example:
If you compiled your servlet with the javac that came with jdk1.5 and then tried to run it in Tomcat under jdk1.4.x.


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: Hi Servlet invoke error