You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Sailer <d....@comcast.net> on 2007/08/24 23:14:35 UTC

java.lang.NoClassDefFoundError

I have a webapp that is working but I wanted to update a servlet jar so:

jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib

No I get the exception shown below. I have MyServlet stripped down so
the only imports are:
import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;


I can't see how replacing one servlet that has few dependencies is
causing an unrelated NoClassDefFoundError.




javax.servlet.ServletException:
net/whohah/portal/exceptions/MyServletException
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause 

java.lang.NoClassDefFoundError:
net/whohah/portal/exceptions/MyServletException
	java.lang.Class.getDeclaredConstructors0(Native Method)
	java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
	java.lang.Class.getConstructor0(Class.java:2671)
	java.lang.Class.newInstance0(Class.java:321)
	java.lang.Class.newInstance(Class.java:303)
	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:142)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: java.lang.NoClassDefFoundError

Posted by Martin Gainty <mg...@hotmail.com>.
Dave-

Same thing happened when I tried to build php with some old rhino.jars
If the vendor is silent on what version he is supporting check the signature 
for the class

javap fubar
will show you the signatures for all the methods

HTH/
M
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Dave sailer" <d....@comcast.net>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Saturday, August 25, 2007 10:13 PM
Subject: Re: java.lang.NoClassDefFoundError


> ah, I see now. I mucked up the path with "jar uf" and didn't notice cuz I 
> was checking by doing "jar xf" instead of "jar tfv".
>
> doh!
>
> ----- Original Message ----- 
> From: "Manivannan Palanichamy" <ma...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Saturday, August 25, 2007 4:33 PM
> Subject: Re: java.lang.NoClassDefFoundError
>
>
>> just do, jar -tvf MyJar.jar and see whether it lists the class.
>>
>> -- 
>> Manivannan Palanichamy
>> http://mani.gw.googlepages.com/index.html
>>
>> On 8/25/07, Dave Sailer <d....@comcast.net> wrote:
>>>
>>> it does. And if it didn't "jar uf" is broken, I would think.
>>>
>>> On Fri, 2007-08-24 at 15:20 -0600, Filip Hanik - Dev Lists wrote:
>>> > better check your Jar to make sure it has the MyServletException.class
>>> > file still in it.
>>> >
>>> > Filip
>>> >
>>> > Dave Sailer wrote:
>>> > > I have a webapp that is working but I wanted to update a servlet jar
>>> so:
>>> > >
>>> > > jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
>>> > > cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
>>> > >
>>> > > No I get the exception shown below. I have MyServlet stripped down 
>>> > > so
>>> > > the only imports are:
>>> > > import java.io.*;
>>> > >
>>> > > import javax.servlet.*;
>>> > > import javax.servlet.http.*;
>>> > >
>>> > >
>>> > > I can't see how replacing one servlet that has few dependencies is
>>> > > causing an unrelated NoClassDefFoundError.
>>> > >
>>> > >
>>> > >
>>> > >
>>> > > javax.servlet.ServletException:
>>> > > net/whohah/portal/exceptions/MyServletException
>>> > > 
>>> > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
>>> > >     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>> > >
>>> > > root cause
>>> > >
>>> > > java.lang.NoClassDefFoundError:
>>> > > net/whohah/portal/exceptions/MyServletException
>>> > >     java.lang.Class.getDeclaredConstructors0(Native Method)
>>> > >     java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
>>> > >     java.lang.Class.getConstructor0(Class.java:2671)
>>> > >     java.lang.Class.newInstance0(Class.java:321)
>>> > >     java.lang.Class.newInstance(Class.java:303)
>>> > >     org.apache.jasper.servlet.JspServletWrapper.getServlet(
>>> JspServletWrapper.java:142)
>>> > >     org.apache.jasper.servlet.JspServletWrapper.service(
>>> JspServletWrapper.java:311)
>>> > >     org.apache.jasper.servlet.JspServlet.serviceJspFile(
>>> JspServlet.java:315)
>>> > > 
>>> > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>>> > >     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>> > >
>>> > >
>>> > > ---------------------------------------------------------------------
>>> > > To start a new topic, e-mail: users@tomcat.apache.org
>>> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> > > For additional commands, e-mail: users-help@tomcat.apache.org
>>> > >
>>> > >
>>> > >
>>> > >
>>> >
>>> >
>>> > ---------------------------------------------------------------------
>>> > To start a new topic, e-mail: users@tomcat.apache.org
>>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> > For additional commands, e-mail: users-help@tomcat.apache.org
>>> >
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>>
>> -- 
>> Manivannan.Palanichamy (@) Oracle.com
>> http://mani.gw.googlepages.com/index.html
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: java.lang.NoClassDefFoundError

Posted by Dave sailer <d....@comcast.net>.
ah, I see now. I mucked up the path with "jar uf" and didn't notice cuz I 
was checking by doing "jar xf" instead of "jar tfv".

doh!

----- Original Message ----- 
From: "Manivannan Palanichamy" <ma...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Saturday, August 25, 2007 4:33 PM
Subject: Re: java.lang.NoClassDefFoundError


> just do, jar -tvf MyJar.jar and see whether it lists the class.
>
> -- 
> Manivannan Palanichamy
> http://mani.gw.googlepages.com/index.html
>
> On 8/25/07, Dave Sailer <d....@comcast.net> wrote:
>>
>> it does. And if it didn't "jar uf" is broken, I would think.
>>
>> On Fri, 2007-08-24 at 15:20 -0600, Filip Hanik - Dev Lists wrote:
>> > better check your Jar to make sure it has the MyServletException.class
>> > file still in it.
>> >
>> > Filip
>> >
>> > Dave Sailer wrote:
>> > > I have a webapp that is working but I wanted to update a servlet jar
>> so:
>> > >
>> > > jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
>> > > cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
>> > >
>> > > No I get the exception shown below. I have MyServlet stripped down so
>> > > the only imports are:
>> > > import java.io.*;
>> > >
>> > > import javax.servlet.*;
>> > > import javax.servlet.http.*;
>> > >
>> > >
>> > > I can't see how replacing one servlet that has few dependencies is
>> > > causing an unrelated NoClassDefFoundError.
>> > >
>> > >
>> > >
>> > >
>> > > javax.servlet.ServletException:
>> > > net/whohah/portal/exceptions/MyServletException
>> > >     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
>> > >     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> > >
>> > > root cause
>> > >
>> > > java.lang.NoClassDefFoundError:
>> > > net/whohah/portal/exceptions/MyServletException
>> > >     java.lang.Class.getDeclaredConstructors0(Native Method)
>> > >     java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
>> > >     java.lang.Class.getConstructor0(Class.java:2671)
>> > >     java.lang.Class.newInstance0(Class.java:321)
>> > >     java.lang.Class.newInstance(Class.java:303)
>> > >     org.apache.jasper.servlet.JspServletWrapper.getServlet(
>> JspServletWrapper.java:142)
>> > >     org.apache.jasper.servlet.JspServletWrapper.service(
>> JspServletWrapper.java:311)
>> > >     org.apache.jasper.servlet.JspServlet.serviceJspFile(
>> JspServlet.java:315)
>> > >     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>> > >     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To start a new topic, e-mail: users@tomcat.apache.org
>> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > > For additional commands, e-mail: users-help@tomcat.apache.org
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To start a new topic, e-mail: users@tomcat.apache.org
>> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> -- 
> Manivannan.Palanichamy (@) Oracle.com
> http://mani.gw.googlepages.com/index.html
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: java.lang.NoClassDefFoundError

Posted by Manivannan Palanichamy <ma...@gmail.com>.
just do, jar -tvf MyJar.jar and see whether it lists the class.

-- 
Manivannan Palanichamy
http://mani.gw.googlepages.com/index.html

On 8/25/07, Dave Sailer <d....@comcast.net> wrote:
>
> it does. And if it didn't "jar uf" is broken, I would think.
>
> On Fri, 2007-08-24 at 15:20 -0600, Filip Hanik - Dev Lists wrote:
> > better check your Jar to make sure it has the MyServletException.class
> > file still in it.
> >
> > Filip
> >
> > Dave Sailer wrote:
> > > I have a webapp that is working but I wanted to update a servlet jar
> so:
> > >
> > > jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
> > > cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
> > >
> > > No I get the exception shown below. I have MyServlet stripped down so
> > > the only imports are:
> > > import java.io.*;
> > >
> > > import javax.servlet.*;
> > > import javax.servlet.http.*;
> > >
> > >
> > > I can't see how replacing one servlet that has few dependencies is
> > > causing an unrelated NoClassDefFoundError.
> > >
> > >
> > >
> > >
> > > javax.servlet.ServletException:
> > > net/whohah/portal/exceptions/MyServletException
> > >     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
> > >     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > >
> > > root cause
> > >
> > > java.lang.NoClassDefFoundError:
> > > net/whohah/portal/exceptions/MyServletException
> > >     java.lang.Class.getDeclaredConstructors0(Native Method)
> > >     java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
> > >     java.lang.Class.getConstructor0(Class.java:2671)
> > >     java.lang.Class.newInstance0(Class.java:321)
> > >     java.lang.Class.newInstance(Class.java:303)
> > >     org.apache.jasper.servlet.JspServletWrapper.getServlet(
> JspServletWrapper.java:142)
> > >     org.apache.jasper.servlet.JspServletWrapper.service(
> JspServletWrapper.java:311)
> > >     org.apache.jasper.servlet.JspServlet.serviceJspFile(
> JspServlet.java:315)
> > >     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> > >     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To start a new topic, e-mail: users@tomcat.apache.org
> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > > For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Manivannan.Palanichamy (@) Oracle.com
http://mani.gw.googlepages.com/index.html

Re: java.lang.NoClassDefFoundError

Posted by Dave Sailer <d....@comcast.net>.
it does. And if it didn't "jar uf" is broken, I would think.

On Fri, 2007-08-24 at 15:20 -0600, Filip Hanik - Dev Lists wrote:
> better check your Jar to make sure it has the MyServletException.class 
> file still in it.
> 
> Filip
> 
> Dave Sailer wrote:
> > I have a webapp that is working but I wanted to update a servlet jar so:
> >
> > jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
> > cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
> >
> > No I get the exception shown below. I have MyServlet stripped down so
> > the only imports are:
> > import java.io.*;
> >
> > import javax.servlet.*;
> > import javax.servlet.http.*;
> >
> >
> > I can't see how replacing one servlet that has few dependencies is
> > causing an unrelated NoClassDefFoundError.
> >
> >
> >
> >
> > javax.servlet.ServletException:
> > net/whohah/portal/exceptions/MyServletException
> > 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > root cause 
> >
> > java.lang.NoClassDefFoundError:
> > net/whohah/portal/exceptions/MyServletException
> > 	java.lang.Class.getDeclaredConstructors0(Native Method)
> > 	java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
> > 	java.lang.Class.getConstructor0(Class.java:2671)
> > 	java.lang.Class.newInstance0(Class.java:321)
> > 	java.lang.Class.newInstance(Class.java:303)
> > 	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:142)
> > 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
> > 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> > 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> > 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: java.lang.NoClassDefFoundError

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
better check your Jar to make sure it has the MyServletException.class 
file still in it.

Filip

Dave Sailer wrote:
> I have a webapp that is working but I wanted to update a servlet jar so:
>
> jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
> cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
>
> No I get the exception shown below. I have MyServlet stripped down so
> the only imports are:
> import java.io.*;
>
> import javax.servlet.*;
> import javax.servlet.http.*;
>
>
> I can't see how replacing one servlet that has few dependencies is
> causing an unrelated NoClassDefFoundError.
>
>
>
>
> javax.servlet.ServletException:
> net/whohah/portal/exceptions/MyServletException
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> root cause 
>
> java.lang.NoClassDefFoundError:
> net/whohah/portal/exceptions/MyServletException
> 	java.lang.Class.getDeclaredConstructors0(Native Method)
> 	java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
> 	java.lang.Class.getConstructor0(Class.java:2671)
> 	java.lang.Class.newInstance0(Class.java:321)
> 	java.lang.Class.newInstance(Class.java:303)
> 	org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:142)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org