You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by S Arvind <ar...@gmail.com> on 2011/04/07 15:32:27 UTC

frequent Class unloading/classnotfound problem

Hi All,


Recently in our web application deployed in tomcat, some weird problem is
raising very frequently.
Some of the servlet <http://www.coderanch.com/forums/f-7/Servlets> or class
in that web app <http://en.wikipedia.org/wiki/Web_app> are getting unloaded.
So when the request comes it is sending 404 status or class-not-found
exception.
So what we do is reload the context/application from the tomcat manager and
then it will work fine.

Searched lot but cant able to find solution to this unloading or
classnotfound problem.
Can anyone suggest me why this is happening.


Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison

RE: Fwd: frequent Class unloading/classnotfound problem

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: S Arvind [mailto:arvindwill@gmail.com] 
> Subject: Re: Fwd: frequent Class unloading/classnotfound problem

> Is there any relation between max-open-files in linux
> and NoClassDefFoundError in runtime.

There certainly can be.  Are your webapps failing to close files (including sockets) when they're done with them?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


RE: Fwd: frequent Class unloading/classnotfound problem

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: S Arvind [mailto:arvindwill@gmail.com] 
> Subject: Re: Fwd: frequent Class unloading/classnotfound problem

> Exception Cause-java.lang.NoClassDefFoundError:
> com/XXXXX/hcare/actions/QuickLoginModel

The usual cause is either the class really doesn't exist, or that it exists in more than place.  Make sure it's not in multiple locations of a given branch of the classloader tree.  Also check for permissions on the one location it should be in.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Fwd: frequent Class unloading/classnotfound problem

Posted by S Arvind <ar...@gmail.com>.
Chris,
        The stack trace at the error moment

requestURI-/TempContext/jsp/QuickLoginAction
Exception-Servlet execution threw an exception
Exception Cause-java.lang.NoClassDefFoundError:
com/XXXXX/hcare/actions/QuickLoginModel
javax.servlet.ServletException: Servlet execution threw an exception
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
com.xxxxxxxx.hcare.design.RequestContextFilter.doFilter(RequestContextFilter.java:75)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
        at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
        at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
        at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
        at
com.xxxxxxxx.ForwardServlet.yyyyyForward.performAction(yyyyyForward.java:51)
        at
com.xxxxxxxx.ForwardServlet.yyyyyForward.doPost(yyyyyForward.java:32)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError:
com/xxxxxxxx/hcare/actions/QuickLoginModel
        at
com.xxxxxxxx.hcare.actions.QuickLoginActionNew.performAction(QuickLoginActionNew.java:120)
        at
com.xxxxxxxx.hcare.actions.QuickLoginActionNew.doPost(QuickLoginActionNew.java:57)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        ... 25 more


Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison


On Thu, Apr 14, 2011 at 4:11 PM, S Arvind <ar...@gmail.com> wrote:

> Hi Chris/All,
>
>        Actually we are getting
>
> Exception-Servlet execution threw an exception
> Exception Cause-java.lang.NoClassDefFoundError:
>
> We are running tomcat in centos.
> Web app initially running fine, and in the high load time this error is
> happeningo some of the class files randomly.
> Is there any relation between max-open-files in linux
> and NoClassDefFoundError in runtime.
>
>
> Arvind S
>
> "Many of lifes failure are people who did not realize how close they were
> to success when they gave up."
> -Thomas Edison
>
>
> On Mon, Apr 11, 2011 at 8:24 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Arvind,
>>
>> On 4/11/2011 2:04 AM, S Arvind wrote:
>> > Attached the screenshot of the stacktrace for additional details.
>>
>> This list strips most attachments, including screenshots. How about
>> copy/paste the text?
>>
>> To my knowledge, Tomcat will not unload any classes other than possibly
>> JSPs. If you are talking about a standard POJO, then Tomcat should not
>> be interfering with them at all.
>>
>> Are you using RMI or some other process that involves object
>> serialization? If you have mismatched object class versions, you can
>> have weird things like this happen.
>>
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.10 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAk2jFjQACgkQ9CaO5/Lv0PBQswCcCjygCcMGHa2icXbMuW/gPMrH
>> W5IAnjaevcBw4w1dWJqJfch5kOcIJW6Y
>> =3Ndh
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: Fwd: frequent Class unloading/classnotfound problem

Posted by S Arvind <ar...@gmail.com>.
Hi Chris/All,

       Actually we are getting

Exception-Servlet execution threw an exception
Exception Cause-java.lang.NoClassDefFoundError:

We are running tomcat in centos.
Web app initially running fine, and in the high load time this error is
happeningo some of the class files randomly.
Is there any relation between max-open-files in linux
and NoClassDefFoundError in runtime.


Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison


On Mon, Apr 11, 2011 at 8:24 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Arvind,
>
> On 4/11/2011 2:04 AM, S Arvind wrote:
> > Attached the screenshot of the stacktrace for additional details.
>
> This list strips most attachments, including screenshots. How about
> copy/paste the text?
>
> To my knowledge, Tomcat will not unload any classes other than possibly
> JSPs. If you are talking about a standard POJO, then Tomcat should not
> be interfering with them at all.
>
> Are you using RMI or some other process that involves object
> serialization? If you have mismatched object class versions, you can
> have weird things like this happen.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2jFjQACgkQ9CaO5/Lv0PBQswCcCjygCcMGHa2icXbMuW/gPMrH
> W5IAnjaevcBw4w1dWJqJfch5kOcIJW6Y
> =3Ndh
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Fwd: frequent Class unloading/classnotfound problem

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Arvind,

On 4/11/2011 2:04 AM, S Arvind wrote:
> Attached the screenshot of the stacktrace for additional details.

This list strips most attachments, including screenshots. How about
copy/paste the text?

To my knowledge, Tomcat will not unload any classes other than possibly
JSPs. If you are talking about a standard POJO, then Tomcat should not
be interfering with them at all.

Are you using RMI or some other process that involves object
serialization? If you have mismatched object class versions, you can
have weird things like this happen.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2jFjQACgkQ9CaO5/Lv0PBQswCcCjygCcMGHa2icXbMuW/gPMrH
W5IAnjaevcBw4w1dWJqJfch5kOcIJW6Y
=3Ndh
-----END PGP SIGNATURE-----

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


Fwd: frequent Class unloading/classnotfound problem

Posted by S Arvind <ar...@gmail.com>.
Chris,
       Attached the screenshot of the stacktrace for additional details.

Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison


---------- Forwarded message ----------
From: S Arvind <ar...@gmail.com>
Date: Sun, Apr 10, 2011 at 12:12 PM
Subject: Re: frequent Class unloading/classnotfound problem
To: Tomcat Users List <us...@tomcat.apache.org>



Chris,
    > So when the request comes it is sending 404 status or
class-not-found exception.
->-Can you give some specifics?
>>Assume we have a class called Sample.class, so when trying to create the
object it is giving classnotfound exception. Then i have to again  compile
the java in the runtime itself then only it works, thou the class file are
present in the classes folder packages. seems like these classes becoming
invisible to tomcat by some means.



> So what we do is reload the context/application from the tomcat manager
and  then it will work fine.
->-Do those same requests then respond the way you expect?
>>No until i reload the context/app in tomcat manager or compile the
corresponding java file. (isreloadable=true) . Which is the main problem in
the production time.

->-What version of Tomcat are you running? Does this happen only
under certain circumstances (high load? no load? when re-deploying a
JSP, etc.) or does it happen all the time? Please post a full stack trace
of any exception you have  encountered.
>>tomcat 6.0.20  . Cant surely tell that its happening in high load, as we
found that independent to load of the system. There are weeks this didnt
happen and also in some week it will happen for 5days and in few days lot
too.. so we cant able to find the meaning behind its randomness. And
unfortunately i missed the stack trace which ws generated, if it occurred in
this week i will mail it instantly. And till now it didnt happen in the JSP
file, it only happened in servlet or plain java class.



Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison


On Fri, Apr 8, 2011 at 12:41 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Arvind,
>
> On 4/7/2011 9:32 AM, S Arvind wrote:
> > Recently in our web application deployed in tomcat, some weird problem is
> > raising very frequently.
> > Some of the servlet <http://www.coderanch.com/forums/f-7/Servlets> or
> class
> > in that web app <http://en.wikipedia.org/wiki/Web_app> are getting
> unloaded.
>
> Most folks on the list have heard of servlets and web apps, but thanks
> for the references.
>
> > So when the request comes it is sending 404 status or class-not-found
> > exception.
>
> Can you give some specifics?
>
> > So what we do is reload the context/application from the tomcat manager
> and
> > then it will work fine.
>
> Do those same requests then respond the way you expect?
>
> > Searched lot but cant able to find solution to this unloading or
> > classnotfound problem.
> > Can anyone suggest me why this is happening.
>
> What version of Tomcat are you running? Does this happen only under
> certain circumstances (high load? no load? when re-deploying a JSP,
> etc.) or does it happen all the time? Please post a full stack trace of
> any exception you have encountered.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2eDE0ACgkQ9CaO5/Lv0PCXtgCfdbe3a0zEkpVch2FDDKoD6P0a
> zQ8AoL9OGteRqgDWY/sWbYz1I1IrSEKh
> =oev/
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: frequent Class unloading/classnotfound problem

Posted by S Arvind <ar...@gmail.com>.
Chris,
    > So when the request comes it is sending 404 status or
class-not-found exception.
->-Can you give some specifics?
>>Assume we have a class called Sample.class, so when trying to create the
object it is giving classnotfound exception. Then i have to again  compile
the java in the runtime itself then only it works, thou the class file are
present in the classes folder packages. seems like these classes becoming
invisible to tomcat by some means.



> So what we do is reload the context/application from the tomcat manager
and  then it will work fine.
->-Do those same requests then respond the way you expect?
>>No until i reload the context/app in tomcat manager or compile the
corresponding java file. (isreloadable=true) . Which is the main problem in
the production time.

->-What version of Tomcat are you running? Does this happen only
under certain circumstances (high load? no load? when re-deploying a
JSP, etc.) or does it happen all the time? Please post a full stack trace
of any exception you have  encountered.
>>tomcat 6.0.20  . Cant surely tell that its happening in high load, as we
found that independent to load of the system. There are weeks this didnt
happen and also in some week it will happen for 5days and in few days lot
too.. so we cant able to find the meaning behind its randomness. And
unfortunately i missed the stack trace which ws generated, if it occurred in
this week i will mail it instantly. And till now it didnt happen in the JSP
file, it only happened in servlet or plain java class.



Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison


On Fri, Apr 8, 2011 at 12:41 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Arvind,
>
> On 4/7/2011 9:32 AM, S Arvind wrote:
> > Recently in our web application deployed in tomcat, some weird problem is
> > raising very frequently.
> > Some of the servlet <http://www.coderanch.com/forums/f-7/Servlets> or
> class
> > in that web app <http://en.wikipedia.org/wiki/Web_app> are getting
> unloaded.
>
> Most folks on the list have heard of servlets and web apps, but thanks
> for the references.
>
> > So when the request comes it is sending 404 status or class-not-found
> > exception.
>
> Can you give some specifics?
>
> > So what we do is reload the context/application from the tomcat manager
> and
> > then it will work fine.
>
> Do those same requests then respond the way you expect?
>
> > Searched lot but cant able to find solution to this unloading or
> > classnotfound problem.
> > Can anyone suggest me why this is happening.
>
> What version of Tomcat are you running? Does this happen only under
> certain circumstances (high load? no load? when re-deploying a JSP,
> etc.) or does it happen all the time? Please post a full stack trace of
> any exception you have encountered.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk2eDE0ACgkQ9CaO5/Lv0PCXtgCfdbe3a0zEkpVch2FDDKoD6P0a
> zQ8AoL9OGteRqgDWY/sWbYz1I1IrSEKh
> =oev/
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: frequent Class unloading/classnotfound problem

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Arvind,

On 4/7/2011 9:32 AM, S Arvind wrote:
> Recently in our web application deployed in tomcat, some weird problem is
> raising very frequently.
> Some of the servlet <http://www.coderanch.com/forums/f-7/Servlets> or class
> in that web app <http://en.wikipedia.org/wiki/Web_app> are getting unloaded.

Most folks on the list have heard of servlets and web apps, but thanks
for the references.

> So when the request comes it is sending 404 status or class-not-found
> exception.

Can you give some specifics?

> So what we do is reload the context/application from the tomcat manager and
> then it will work fine.

Do those same requests then respond the way you expect?

> Searched lot but cant able to find solution to this unloading or
> classnotfound problem.
> Can anyone suggest me why this is happening.

What version of Tomcat are you running? Does this happen only under
certain circumstances (high load? no load? when re-deploying a JSP,
etc.) or does it happen all the time? Please post a full stack trace of
any exception you have encountered.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2eDE0ACgkQ9CaO5/Lv0PCXtgCfdbe3a0zEkpVch2FDDKoD6P0a
zQ8AoL9OGteRqgDWY/sWbYz1I1IrSEKh
=oev/
-----END PGP SIGNATURE-----

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