Re: classloader hangs
loadClass method, and it is not reporting anything, and to the best of my knowledge, an error should terminate the JVM right? No, it shouldn't. You can catch errors also by catching Throwable instead of Exception. Thanks very much for this bit of advice, as it turns out it was throwing a ClassDefNotFoundError. However, now that I am catching this error, I am still bewildered. When I am trying to load class A, the message in the ClassDefNotFoundError is simply B which is the class that A extends (which is present in the directory containing the loading code). If Tomcat's webapp loader loaded the loading code, why isn't it loading class B as well? Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader hangs
My attempts to abate this error are proving quite fruitless. So I was wondering... what is the preferred method to programatically reload a class in Tomcat? I've searched the web but I am stuck. Thanks Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classloader hangs
Hi, You can simply set reloadable=true for your Context and Tomcat will monitor your classes and reload the webapp (not just the class) as needed. You can also programmatically invoke the Manager webapp and use its reload feature. Yoav Shapira Millennium Research Informatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 06, 2004 9:36 AM To: Tomcat Users List Subject: Re: classloader hangs My attempts to abate this error are proving quite fruitless. So I was wondering... what is the preferred method to programatically reload a class in Tomcat? I've searched the web but I am stuck. Thanks Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader hangs
You can simply set reloadable=true for your Context and Tomcat will monitor your classes and reload the webapp (not just the class) as needed. You can also programmatically invoke the Manager webapp and use its reload feature. What if these classes aren't located in the Tomcat directory? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classloader hangs
Hi, Then you have to write your own custom Loader to handle this. But don't expect much help or support, as you're going outside the Servlet Spec and most people stop caring as much ;) Yoav Shapira Millennium Research Informatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 06, 2004 10:09 AM To: Tomcat Users List Subject: Re: classloader hangs You can simply set reloadable=true for your Context and Tomcat will monitor your classes and reload the webapp (not just the class) as needed. You can also programmatically invoke the Manager webapp and use its reload feature. What if these classes aren't located in the Tomcat directory? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader hangs
Why must I write a custom Loader, isn't URLClassLoader already suited for this task? What is it about URLClassLoader that makes it incompatable with Tomcat? Then you have to write your own custom Loader to handle this. But don't expect much help or support, as you're going outside the Servlet Spec and most people stop caring as much ;) Yoav Shapira Millennium Research Informatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 06, 2004 10:09 AM To: Tomcat Users List Subject: Re: classloader hangs You can simply set reloadable=true for your Context and Tomcat will monitor your classes and reload the webapp (not just the class) as needed. You can also programmatically invoke the Manager webapp and use its reload feature. What if these classes aren't located in the Tomcat directory? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classloader hangs
Hi, URLClassLoader is not a reloader. Why did you get the idea it is? There's nothing in it that's incompatible with Tomcat, in fact Tomcat just extends it and uses its code. Yoav Shapira Millennium Research Informatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 06, 2004 10:18 AM To: Tomcat Users List Subject: Re: classloader hangs Why must I write a custom Loader, isn't URLClassLoader already suited for this task? What is it about URLClassLoader that makes it incompatable with Tomcat? Then you have to write your own custom Loader to handle this. But don't expect much help or support, as you're going outside the Servlet Spec and most people stop caring as much ;) Yoav Shapira Millennium Research Informatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 06, 2004 10:09 AM To: Tomcat Users List Subject: Re: classloader hangs You can simply set reloadable=true for your Context and Tomcat will monitor your classes and reload the webapp (not just the class) as needed. You can also programmatically invoke the Manager webapp and use its reload feature. What if these classes aren't located in the Tomcat directory? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader hangs
I apologize for not being clear the first time. My class loading scheme works by first loading classes with a URLClassLoader and then when the program wants to reload them, it creates a new URLClassLoader whose parent is the first URLClassLoader, thus staying within the delegation model of class loaders (i hope?). URLClassLoader is not a reloader. Why did you get the idea it is? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classloader hangs
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 11:17 AM To: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader hangs
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 11:17 AM To: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classloader hangs
Hi, I know this is naive of me, but how does one get a thread dump of the JVM? Send a SIGQUIT to the JVM process. 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? No, it shouldn't. You can catch errors also by catching Throwable instead of Exception. Yoav 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader hangs
On Windows XP? :-( (my employer doesn't enjoy linux) Send a SIGQUIT to the JVM process. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: classloader hangs
if you've got it running in a DOS window (which you might want to do, for just this purpose), you can try either the Pause/Break key, and if that doesn't do it, try 'Cntrl-C' in the DOS window. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 4:10 PM To: Tomcat Users List Subject: Re: classloader hangs On Windows XP? :-( (my employer doesn't enjoy linux) Send a SIGQUIT to the JVM process. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]