tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: classloader hangs
Date Thu, 05 Aug 2004 15:22:03 GMT

If you get a thread dump of the JVM while it's hanging, what does it

The URLClassLoader is intended for use within Tomcat.  It's nice that
you have a program using outside Tomcat, but it's not that meaningful
for comparison testing.  The ClassLoading scheme and hierarchy inside a
servlet container is significantly different from the one inside a
console Java application.

NoClassDefFound is not an exception, it's an Error.  It's different from
ClassNotFoundException.  And that difference (see the JavaDoc for both)
may be the root of your problem.

Yoav Shapira
Millennium Research Informatics

>-----Original Message-----
>From: []
>Sent: Thursday, August 05, 2004 11:17 AM
>Subject: classloader hangs
>I am writing a class to be deployed with the Tomcat SOAP web app (I'll
>call this class A).  It uses a URLClassloader to load classes from a
>directory (i call them modules).  I initialize my class loader with
>URLClassLoader initialLoader = new URLClassLoader(urls,
>           Thread.currentThread().getContextClassLoader());
>	   This worked fine for a while.  However, when I decided that
>	   my class A needed to have a package statement (I wanted to
>	   put it in a jar file along with some libraries for easy
>	   distribution), I was very much dismayed when the class
>	   loading did not work.  Yet the strange part is that it is not
>	   the usual NoClassDefFound exception, instead the entire
>	   program just seems to hang upon trying to load one of the
>	   modules.  I am very dismayed as what was once working code is
>	   now almost useless.  Chances are, I'm just making a stupid
>	   mistake, however if anyone could please help me I would be
>	   grateful.
>	   Thanks,
>	   Ben
>	   P.S. This works fine when I don't run it under Tomcat, that
>	   was my reason for posting it here.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message