facebook

Tomcat 5 Hot code deployment is causing a context reload

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #231193 Reply

    I am having an issue where compiling a java file that is part of an exploaded archive causes the Tomcat server to restart the app context. Is there any way to keep the app from restarting just because I saved. I would like to have the code just get hot replaced on the server.

    Tomcat 5.0.28
    Java 1.4.02_6

    #231206 Reply

    Riyad Kalla
    Member

    The restarting of the context is how Tomcat handles the new file, you can tell the context “reloadable=false” and it won’t reload… but then you won’t be able to see your changed class unless you manually restarted your context.

    #234187 Reply

    Finch
    Member

    @support-rkalla wrote:

    The restarting of the context is how Tomcat handles the new file

    Is it? Which file? web.xml?
    For all other files, the hot code replace works just fine for me!
    JSPs are no problem at all, but even Java files can usually be replaced without any problem. (you just cannot introduce new members or methods or change method signatures).

    For me, this even works when I hit a breakpoint and fix the next line. When I save, the Java code is replaced and the method I was in is restarted from the first line. That’s a really helpful thing sometimes!

    Which file are we talking about?

    #234195 Reply

    Riyad Kalla
    Member

    Is it? Which file? web.xml?

    It is set in your server.xml file for Tomcat 4 and set in your individual context files in Tomcat 5+

    #234201 Reply

    Finch
    Member

    @support-rkalla wrote:

    Is it? Which file? web.xml?

    It is set in your server.xml file for Tomcat 4 and set in your individual context files in Tomcat 5+

    I think (well, I know for a fact *ggg*) that the original author talked about “compiling a Java file”. Which Java file would trigger a context reload?

    #234205 Reply

    Hi all,

    There have been a number of replies since my original post. Here are some additional details. The problem began occuring when we created a context.xml file and placed it in the tomcat/conf/Catalina/localhost dir. Every change to java files in the src tree causes the server to reload the context.

    -wlolinger

    #234208 Reply

    Riyad Kalla
    Member

    wlolinger,
    First make sure you didn’t actually leave the file named context.xml, it needs to be named the same name as your web context (http://localhost:8080/myapp == myapp.xml)

    Second, edit the context file and for the context set the attribute reloadable to false (reloadable=false)

    #234219 Reply

    Riyad,

    I verified the name is correct. As for the reloadable=false, If I set false then Tomcat will not do the hot code deploy will it?
    I want the new code to be reflected, I just don’t want to reload the entire app.

    Let me know if I was not clear. In the meantime I will try setting reload to false.

    wlolinger

    #234267 Reply

    Robert Varga
    Participant

    @Finch wrote:

    @support-rkalla wrote:

    Is it? Which file? web.xml?

    It is set in your server.xml file for Tomcat 4 and set in your individual context files in Tomcat 5+

    I think (well, I know for a fact *ggg*) that the original author talked about “compiling a Java file”. Which Java file would trigger a context reload?

    I am not sure, but I can well imagine that reloading a ServletContextListener implementor class might trigger the reloading of the web-application containing the ServletContextListener.

    I also found that changing the date of web.xml does trigger the reloading of the web-application.

    Regards,

    Robert Varga

    #234474 Reply

    @wlolinger wrote:

    Riyad,

    I verified the name is correct. As for the reloadable=false, If I set false then Tomcat will not do the hot code deploy will it?
    I want the new code to be reflected, I just don’t want to reload the entire app.

    Let me know if I was not clear. In the meantime I will try setting reload to false.

    wlolinger

    Eclipse does the hot code replace, not Tomcat. So even setting reloadable=”false”, hot code replace will still work.

    HTH,
    Daniel Serodio

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Tomcat 5 Hot code deployment is causing a context reload

You must be logged in to post in the forum log in