Re: must restart tomcat
hin, "Shkuro, Yuri" wrote: Tomcat 3.2 only supports hot-swapping of servlet classes, but not their dependencies like bean classes, so you either have to restart Tomcat, or use its admin interface to remove your application context and add it again. it's not necc. to remove the app. context. just add it again. that makes it a lot faster. g. Note that the latter is not necessarily faster (usually takes me four hits on the URL: list/delete/add/list), unless you have many applications in your webapp directory (and you shouldn't if you plan to restart often). Also, I noticed that when a context is added via admin interface, Tomcat does not set init parameters for this context, which my application depends on. YS. -Original Message- From: Maya Muchnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
Re: must restart tomcat
gustav spellauge wrote: i just downloaded and installed tomcat 4.0 - the examples work fine BUT there seem to be a problem with struts - *.tld has changed ? i get the error: apache.jasper.JasperException: XML parsing error on file /WEB-INF/struts-html.tld: (line 2, col -1): Element type "document" is not declared. at org.apache.jasper.compiler.JspUtil.parseXMLDocJaxp(JspUtil.java:225) at org.apache.jasper.compiler.JspUtil.parseXMLDoc(JspUtil.java:198) The TLDs have not changed. What is even more interesting is that there is no document element anywhere in any of the TLDs -- are you sure that you did not accidentally copy the "struts-html.xml" file and rename it instead? how to fix this ? thanks in advance g. Craig Tom Janofsky wrote: Just FYI - it's not that hard. toolkits to get this info http://www.inf.fu-berlin.de/~dahm/JavaClass/ (lgpl'd byte code tools) or CFParse from IBM alphaworks (both can be used the get all the classes used by a class) some tools that do this sort of thing... http://vorlon.eecs.cwru.edu/~jrl7/java/ImportMin.txt (tells you what you need to import) Dash-o also does something like this to clean up imports, and woodenchair's Utility+ Although I'd bet my $.02 that all tomcat 4.x does is watch timestamps on all the files under classes. And slightly OT - wasn't life nice and simple in Java before you had to understand class loaders...? --tom "Shkuro, Yuri" wrote: I am not aware of any mechanisms in Java to inspect a class and determine its dependencies (although javac obviously has to do it, but its proprietory). I think this issue is too difficult for any container to handle automatically. -Original Message- From: gustav spellauge [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 3:21 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat thanks, that's what i thught but now i can be quit shure. do you think/know if tmcat 4.x will support hotswapping of all dependencies ? g. "Shkuro, Yuri" wrote: Tomcat 3.2 only supports hot-swapping of servlet classes, but not their dependencies like bean classes, so you either have to restart Tomcat, or use its admin interface to remove your application context and add it again. Note that the latter is not necessarily faster (usually takes me four hits on the URL: list/delete/add/list), unless you have many applications in your webapp directory (and you shouldn't if you plan to restart often). Also, I noticed that when a context is added via admin interface, Tomcat does not set init parameters for this context, which my application depends on. YS. -Original Message- From: Maya Muchnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
Re: must restart tomcat
gustav spellauge wrote: "Craig R. McClanahan" wrote: gustav spellauge wrote: thanks, that's what i thught but now i can be quit shure. do you think/know if tmcat 4.x will support hotswapping of all dependencies ? Tomcat 4.0 supports autoreload when any class (not just a servlet) is updated, as long as that class is unpacked in WEB-INF/classes. There is a background thread that checks for updates, by default every 15 seconds. i just tried tomcat 4.0b1 it starts up fine but doesn't fix the restart problem. Well, it works for me and lots of other folks. Can you provide a reprodicible test case, along with error message logs, so we can investigate? Instead of the admin application of 3.2, there is also a manager application in 4.0 that can trigger a reload with a single request: http://localhost:8080/manager/reload?path=/myapp where "/myapp" is the context path of the application you want to reload. This works even if "autoreload" is not set on the app in server.xml, so you might find it faster to trigger reloads this way. The only thing needed to make it work is to create a user in conf/tomcat-users.xml that has the role "manager" -- you will be challenged the first time you reload for the username/password, but after that you will just need to submit. this does NOT work for me ! Again, "this does NOT work for me" gives no basis on which we can investigate. What are your configuration files set up like? What did you try? What actually happened? What did you expect to have happen? What do the log files say? Craig
must restart tomcat
again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
Re: must restart tomcat
I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
RE: must restart tomcat
Tomcat 3.2 only supports hot-swapping of servlet classes, but not their dependencies like bean classes, so you either have to restart Tomcat, or use its admin interface to remove your application context and add it again. Note that the latter is not necessarily faster (usually takes me four hits on the URL: list/delete/add/list), unless you have many applications in your webapp directory (and you shouldn't if you plan to restart often). Also, I noticed that when a context is added via admin interface, Tomcat does not set init parameters for this context, which my application depends on. YS. -Original Message- From: Maya Muchnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
Re: must restart tomcat
that's not the problem i duoblechecked it. see the answer of Maya Muchnik. i think that's the probalem. tanks anyway. g. Maya Muchnik wrote: I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
Re: must restart tomcat
thanks, that's what i thught but now i can be quit shure. do you think/know if tmcat 4.x will support hotswapping of all dependencies ? g. "Shkuro, Yuri" wrote: Tomcat 3.2 only supports hot-swapping of servlet classes, but not their dependencies like bean classes, so you either have to restart Tomcat, or use its admin interface to remove your application context and add it again. Note that the latter is not necessarily faster (usually takes me four hits on the URL: list/delete/add/list), unless you have many applications in your webapp directory (and you shouldn't if you plan to restart often). Also, I noticed that when a context is added via admin interface, Tomcat does not set init parameters for this context, which my application depends on. YS. -Original Message- From: Maya Muchnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
RE: must restart tomcat
I am not aware of any mechanisms in Java to inspect a class and determine its dependencies (although javac obviously has to do it, but its proprietory). I think this issue is too difficult for any container to handle automatically. -Original Message- From: gustav spellauge [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 3:21 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat thanks, that's what i thught but now i can be quit shure. do you think/know if tmcat 4.x will support hotswapping of all dependencies ? g. "Shkuro, Yuri" wrote: Tomcat 3.2 only supports hot-swapping of servlet classes, but not their dependencies like bean classes, so you either have to restart Tomcat, or use its admin interface to remove your application context and add it again. Note that the latter is not necessarily faster (usually takes me four hits on the URL: list/delete/add/list), unless you have many applications in your webapp directory (and you shouldn't if you plan to restart often). Also, I noticed that when a context is added via admin interface, Tomcat does not set init parameters for this context, which my application depends on. YS. -Original Message- From: Maya Muchnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.
Re: must restart tomcat
"Shkuro, Yuri" wrote: I am not aware of any mechanisms in Java to inspect a class and determine its dependencies (although javac obviously has to do it, but its proprietory). In Tomcat, it only works in the restricted case where the class is loaded from an individual disk file under WEB-INF/classes. Tomcat includes a custom classloader for the webapp which remembers the date/time stamp of the class file when each class was loaded, and then periodically checks the directory for files that have timestamps later than that. I think this issue is too difficult for any container to handle automatically. It's definitely a pain to implement -- be glad the containers do it for you :-) Craig
Re: must restart tomcat
Just FYI - it's not that hard. toolkits to get this info http://www.inf.fu-berlin.de/~dahm/JavaClass/ (lgpl'd byte code tools) or CFParse from IBM alphaworks (both can be used the get all the classes used by a class) some tools that do this sort of thing... http://vorlon.eecs.cwru.edu/~jrl7/java/ImportMin.txt (tells you what you need to import) Dash-o also does something like this to clean up imports, and woodenchair's Utility+ Although I'd bet my $.02 that all tomcat 4.x does is watch timestamps on all the files under classes. And slightly OT - wasn't life nice and simple in Java before you had to understand class loaders...? --tom "Shkuro, Yuri" wrote: I am not aware of any mechanisms in Java to inspect a class and determine its dependencies (although javac obviously has to do it, but its proprietory). I think this issue is too difficult for any container to handle automatically. -Original Message- From: gustav spellauge [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 3:21 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat thanks, that's what i thught but now i can be quit shure. do you think/know if tmcat 4.x will support hotswapping of all dependencies ? g. "Shkuro, Yuri" wrote: Tomcat 3.2 only supports hot-swapping of servlet classes, but not their dependencies like bean classes, so you either have to restart Tomcat, or use its admin interface to remove your application context and add it again. Note that the latter is not necessarily faster (usually takes me four hits on the URL: list/delete/add/list), unless you have many applications in your webapp directory (and you shouldn't if you plan to restart often). Also, I noticed that when a context is added via admin interface, Tomcat does not set init parameters for this context, which my application depends on. YS. -Original Message- From: Maya Muchnik [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: Re: must restart tomcat I think, you need to config your server.xml file to tell to "reload" your classes after they are changed / rebuilt. Do you config server.xml for your new application? gustav spellauge wrote: again my qustion: after a change in any of a formbean class or an action class i will have to restart tomcat (3.2) otherwise my app. runs into cast-exceptions. is there any way to avoid this restart. maybe something is wrong with my setup. thanks in advance g.