You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Masters <ro...@yahoo.com> on 2009/07/29 13:39:50 UTC
Weird Intermittent NoClassDefFound
Hi All,
I'm running tomcat apache-tomcat-6.0.18 with a single application that has heavy spring and hibernate usage. One of the deployments mainly deals with batch processing from Quartz. After a couple days worth of processing I suddenly get NoClassDefFound errors (usually from some random hibernate class) for classes that have been previously loaded. The other day it occured with a class from JGroups (we use this for clustered cache communication) and it spewed out *loads* of NoClassDefFound and ended up filling up the disk.
So, a couple questions:
- has anyone else encountered this?
- could this be a tomcat class loader issue?
- any ideas? help?
Thanks in advance,
rotis23
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Weird Intermittent NoClassDefFound
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Chris,
On 7/29/2009 5:18 PM, Chris Masters wrote:
> Thanks for the quick reply Pierre - I've been reading up since,
> checked and my installation is OK.
>
> However, I think I may have found the problem. Sometimes a class
> loader will throw a NoClassDefFound when a static block throws an
> Exception. I think the hibernate and jgroup classes in question where
> trying to grab a file handle and the system limit had been reached
> (in the tomcat users case 1024).
That will certainly do it.
> This is quite a loaded box doing all
> the batch processing so not unreasonable. Does this make sense?
It does, except that I wonder where all your file handles are going. How
many <Connectors> do you have? How many simultaneous connections do each
of them allow? Do you keep a lot of files open? Do you have a lot of JAR
files in your WEB-INF/lib directory?
> I'll check the classes in question and see if that's what they're
> doing.
Always a good idea.
You can also raise the process fd limit, if this really is a "not enough
resources" issue rather than a resource leak. Just like heap space,
sometimes you really do just need more file handles.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpxwXUACgkQ9CaO5/Lv0PAr2gCeLXmbhztaslfHlD5SFQZiUX6T
Ts8AnR0lYaj0SrVKD/I7aDiudyya/995
=93h+
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Weird Intermittent NoClassDefFound
Posted by Chris Masters <ro...@yahoo.com>.
Thanks for the quick reply Pierre - I've been reading up since, checked and my installation is OK.
However, I think I may have found the problem. Sometimes a class loader will throw a NoClassDefFound when a static block throws an Exception. I think the hibernate and jgroup classes in question where trying to grab a file handle and the system limit had been reached (in the tomcat users case 1024). This is quite a loaded box doing all the batch processing so not unreasonable. Does this make sense?
I'll check the classes in question and see if that's what they're doing.
Thanks, Chris
----- Original Message ----
From: Pierre Goupil <go...@gmail.com>
To: Tomcat Users List <us...@tomcat.apache.org>
Sent: Wednesday, July 29, 2009 12:43:49 PM
Subject: Re: Weird Intermittent NoClassDefFound
Hello,
I've never encountered such a situation myself, but it may be because of a
duplicate jar in your classpath. As you may know, looking in WEB-INF/lib
should not be enough.
Maybe you should have a look at this, in order to know where to look :
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
HTH,
Pierre
On Wed, Jul 29, 2009 at 1:39 PM, Chris Masters <ro...@yahoo.com> wrote:
>
> Hi All,
>
> I'm running tomcat apache-tomcat-6.0.18 with a single application that has
> heavy spring and hibernate usage. One of the deployments mainly deals with
> batch processing from Quartz. After a couple days worth of processing I
> suddenly get NoClassDefFound errors (usually from some random hibernate
> class) for classes that have been previously loaded. The other day it
> occured with a class from JGroups (we use this for clustered cache
> communication) and it spewed out *loads* of NoClassDefFound and ended up
> filling up the disk.
>
> So, a couple questions:
>
> - has anyone else encountered this?
> - could this be a tomcat class loader issue?
> - any ideas? help?
>
> Thanks in advance,
>
> rotis23
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Sans amis était le grand maître des mondes,
Eprouvait manque, ce pour quoi il créa les esprits,
Miroirs bienveillants de sa béatitude.
Mais au vrai, il ne trouva aucun égal,
Du calice du royaume total des âmes
Ecume jusqu'à lui l'infinité.
(Schiller, "l'amitié")
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Weird Intermittent NoClassDefFound
Posted by Pierre Goupil <go...@gmail.com>.
Hello,
I've never encountered such a situation myself, but it may be because of a
duplicate jar in your classpath. As you may know, looking in WEB-INF/lib
should not be enough.
Maybe you should have a look at this, in order to know where to look :
http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html
HTH,
Pierre
On Wed, Jul 29, 2009 at 1:39 PM, Chris Masters <ro...@yahoo.com> wrote:
>
> Hi All,
>
> I'm running tomcat apache-tomcat-6.0.18 with a single application that has
> heavy spring and hibernate usage. One of the deployments mainly deals with
> batch processing from Quartz. After a couple days worth of processing I
> suddenly get NoClassDefFound errors (usually from some random hibernate
> class) for classes that have been previously loaded. The other day it
> occured with a class from JGroups (we use this for clustered cache
> communication) and it spewed out *loads* of NoClassDefFound and ended up
> filling up the disk.
>
> So, a couple questions:
>
> - has anyone else encountered this?
> - could this be a tomcat class loader issue?
> - any ideas? help?
>
> Thanks in advance,
>
> rotis23
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Sans amis était le grand maître des mondes,
Eprouvait manque, ce pour quoi il créa les esprits,
Miroirs bienveillants de sa béatitude.
Mais au vrai, il ne trouva aucun égal,
Du calice du royaume total des âmes
Ecume jusqu'à lui l'infinité.
(Schiller, "l'amitié")
RE: Weird Intermittent NoClassDefFound
Posted by Martin Gainty <mg...@hotmail.com>.
could be the class location mechanism is broken
find your class in your classloader..you could use Spring Framework's ClassLoaderUtils
http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/util/ClassLoaderUtils.htm
org.springframework.util.ClassLoaderUtils(Class.forName("Your ClassName Goes Here").getCLassLoader);
make sure all your configuration files *.hbm.xml are located in the same jar as the classes they refer to
if none of that works
you may want to use a service registry such as OSGI explained here
http://jira.springframework.org/browse/SPR-3740
not trivial as you would need to setup an OSGI Registry and register Services and place Spring Beans into the Service
any access is thru service
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefuginotte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Wed, 29 Jul 2009 04:39:50 -0700
> From: rotis23@yahoo.com
> Subject: Weird Intermittent NoClassDefFound
> To: users@tomcat.apache.org
>
>
> Hi All,
>
> I'm running tomcat apache-tomcat-6.0.18 with a single application that has heavy spring and hibernate usage. One of the deployments mainly deals with batch processing from Quartz. After a couple days worth of processing I suddenly get NoClassDefFound errors (usually from some random hibernate class) for classes that have been previously loaded. The other day it occured with a class from JGroups (we use this for clustered cache communication) and it spewed out *loads* of NoClassDefFound and ended up filling up the disk.
>
> So, a couple questions:
>
> - has anyone else encountered this?
> - could this be a tomcat class loader issue?
> - any ideas? help?
>
> Thanks in advance,
>
> rotis23
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
_________________________________________________________________
Windows Live™ SkyDrive™: Store, access, and share your photos. See how.
http://windowslive.com/Online/SkyDrive?ocid=TXT_TAGLM_WL_CS_SD_photos_072009