Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 43393 invoked from network); 5 Aug 2004 20:14:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 5 Aug 2004 20:14:32 -0000 Received: (qmail 58489 invoked by uid 500); 5 Aug 2004 20:14:09 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 58265 invoked by uid 500); 5 Aug 2004 20:14:07 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 58247 invoked by uid 99); 5 Aug 2004 20:14:07 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO,NO_REAL_NAME,SPF_HELO_PASS X-Spam-Check-By: apache.org Received: from [212.227.126.187] (HELO moutng.kundenserver.de) (212.227.126.187) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 05 Aug 2004 13:14:02 -0700 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Bsoch-0001Og-00 for tomcat-user@jakarta.apache.org; Thu, 05 Aug 2004 22:13:59 +0200 Received: from [80.136.247.33] (helo=nic.nac.wdyn.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1Bsocg-00070A-00 for tomcat-user@jakarta.apache.org; Thu, 05 Aug 2004 22:13:58 +0200 Received: (qmail 22027 invoked by uid 4207); 5 Aug 2004 20:13:55 -0000 From: bgood@nic-nac-project.de Date: Thu, 5 Aug 2004 22:13:55 +0200 To: Tomcat Users List Subject: Re: classloader hangs Message-ID: <20040805201355.GA20814@nic-nac-project.de> References: <9C5166762F311146951505C6790A9CF80229BE0C@US-VS1.corp.mpi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9C5166762F311146951505C6790A9CF80229BE0C@US-VS1.corp.mpi.com> User-Agent: Mutt/1.3.28i X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:c9c8b863173b56dc4a0242d71aa058ab X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, I know this is naive of me, but how does one get a thread dump of the JVM? Anyway, as for the other comments, do I have to do something different to use URLClassLoader under Tomcat than I do in a console application? I kept getting this same problem under Tomcat before when I was creating URLClassLoaders without specifying Thread.currentThread().getContextClassLoader() as the parent, but by adding it, the error went away. It just seems strange that code that worked fine stopped working when the only change I made was to insert a package statement. As for the NoClassDefFoundError vs ClassNotFoundException, I do have exception handling code around the loadClass method, and it is not reporting anything, and to the best of my knowledge, an error should terminate the JVM right? Thanks, Ben On Thu, Aug 05, 2004 at 11:22:03AM -0400, Shapira, Yoav wrote: > > Hi, > If you get a thread dump of the JVM while it's hanging, what does it > show? > > 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: bgood@nic-nac-project.de [mailto:bgood@nic-nac-project.de] > >Sent: Thursday, August 05, 2004 11:17 AM > >To: tomcat-user@jakarta.apache.org > >Subject: classloader hangs > > > >Hello, > >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: tomcat-user-unsubscribe@jakarta.apache.org > >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > > > > 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: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org