You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Manohar Kamath <ma...@yahoo.com> on 2003/04/08 14:12:38 UTC
java.lang.ClassFormatError on Servlet
Dear All,
I am finding a strange problem with a servlet.
No problem while compiling, but i am getting problem while calling the servlet
throws error :
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/MyServlet at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:435) at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
root cause
java.lang.ClassFormatError: MyServlet (Extra bytes at the end of the class file) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
will anyone can help on this
thanks in advance,
Manohar Kamath
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
RE: java.lang.ClassFormatError on Servlet
Posted by James Lewis <ja...@goodtechnology.com>.
I believe this may be something to do with using a different class at
compile and run time.
E.g. When the class was compiled it used one version of a jar it depends on,
but when called as a servlet, the class it depends on is a different
version.
Check that Tomcat is using the same version as your compiler did.
James
Ps I may be entirely wrong about this.
> -----Original Message-----
> From: Manohar Kamath [mailto:manoharusas@yahoo.com]
> Sent: 08 April 2003 13:13
> To: tomcat-user@jakarta.apache.org
> Subject: java.lang.ClassFormatError on Servlet
>
>
>
> Dear All,
>
> I am finding a strange problem with a servlet.
>
> No problem while compiling, but i am getting problem while
> calling the servlet
>
> throws error :
>
> 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/MyServlet at
> org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerSe
> rvlet.java:435) at
> org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.j
> ava:180) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>
> root cause
> java.lang.ClassFormatError: MyServlet (Extra bytes at the end of
> the class file) at
> java.lang.ClassLoader.defineClass0(Native Method) at
> java.lang.ClassLoader.defineClass(ClassLoader.java:509) at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
>
>
>
> will anyone can help on this
>
>
>
> thanks in advance,
>
> Manohar Kamath
>
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org