Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Hot Code Replace
Hot Code Replace [message #219938] Tue, 02 September 2008 12:02 Go to next message
Eclipse User
Originally posted by: nowhere.a.com

I am just starting to get comfortable with WPT after using MyEclipse.

However WPT does not do a hot code replace in Tomcat for me. Any code
change re-starts the Web application. I have been through every likely
looking configuration and no-where can I find a setting which resembles
hot code replace.

OTOH, I did a change in the web.xml file while the application was
running, expected a re-start, yet I had to do a manual stop/start.

This sounds backwards :-)

I did do a message search throught the group and did find several
references to this issue, but I could not make sense of the replies :-(

--
Wojtek :-)
Re: Hot Code Replace [message #219946 is a reply to message #219938] Tue, 02 September 2008 12:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: dcarver.starstandard.org

Wojtek wrote:
> I am just starting to get comfortable with WPT after using MyEclipse.
>
> However WPT does not do a hot code replace in Tomcat for me. Any code
> change re-starts the Web application. I have been through every likely
> looking configuration and no-where can I find a setting which resembles
> hot code replace.
>
> OTOH, I did a change in the web.xml file while the application was
> running, expected a re-start, yet I had to do a manual stop/start.
>
> This sounds backwards :-)
>
> I did do a message search throught the group and did find several
> references to this issue, but I could not make sense of the replies :-(
>
Have you reviewed the WTP/Tomacat FAQ?

http://wiki.eclipse.org/WTP_Tomcat_FAQ

Dave
Re: Hot Code Replace [message #219954 is a reply to message #219946] Tue, 02 September 2008 15:22 Go to previous messageGo to next message
Eclipse User
Originally posted by: nowhere.a.com

David Carver wrote :
> Wojtek wrote:
>> I am just starting to get comfortable with WPT after using MyEclipse.
>>
>> However WPT does not do a hot code replace in Tomcat for me. Any code
>> change re-starts the Web application. I have been through every likely
>> looking configuration and no-where can I find a setting which resembles hot
>> code replace.
>>
>> OTOH, I did a change in the web.xml file while the application was running,
>> expected a re-start, yet I had to do a manual stop/start.
>>
>> This sounds backwards :-)
>>
>> I did do a message search throught the group and did find several
>> references to this issue, but I could not make sense of the replies :-(
>>
> Have you reviewed the WTP/Tomacat FAQ?
>
> http://wiki.eclipse.org/WTP_Tomcat_FAQ

Why no, no I did not. I kind of assume that I am a reasonable person
who can ferret out almost any setting by simply going through the
provided dialog boxes and reading. I even did text searches within the
server setup files looking for anything which resembled hot or code or
replace. I did this off and on for several days getting frustrated,
then decided to come here. I do appreciate the tip, as it did lead me
to the right dialog where I did a "guess" that it might work. And it
did.

Ok, the path to the checkbox is:

In the Server view, click on the server name. This will open the server
properties page. At the bottom is a tab named "Modules". In the modules
view are all the projects which are attached to this server. Choose the
one you are working with and then click on the "Edit..." button on the
right.

Uncheck "Auto reloading enabled"

Can this option be added to the wizard which creates dynamic Web
Projects? With a suitable explanation?

Thanks David!

--
Wojtek :-)
Re: Hot Code Replace [message #219970 is a reply to message #219954] Wed, 03 September 2008 03:17 Go to previous messageGo to next message
Eclipse User
Originally posted by: mauro.molinari.cardinis.com

Wojtek ha scritto:
> Ok, the path to the checkbox is:
>
> In the Server view, click on the server name. This will open the server
> properties page. At the bottom is a tab named "Modules". In the modules
> view are all the projects which are attached to this server. Choose the
> one you are working with and then click on the "Edit..." button on the
> right.
>
> Uncheck "Auto reloading enabled"

Hi Wojtek!
I have a question though: I always thought that the option you mention
just enables and disables the automatic republish for the module, so I
assumed that disabling it just means that I have to manually reload the
webapp/the server when I make changes. I never associated it with "hot
code replace". Reading the Tomcat FAQ didn't help me to understand.

So:
1) isn't "auto-reloading enabled" equivalent to the "automatically
publish when resources changes" located in the server configuration, but
restricted to a single module? Or are they different things?

2) did you try and see that disabling automatic reloading of a module
enables hot code replace for it?

Thanks in advance,
Mauro.
Re: Hot Code Replace [message #219978 is a reply to message #219970] Wed, 03 September 2008 10:03 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1298
Registered: July 2009
Senior Member
Mauro Molinari wrote:
> Wojtek ha scritto:
>> Ok, the path to the checkbox is:
>>
>> In the Server view, click on the server name. This will open the
>> server properties page. At the bottom is a tab named "Modules". In the
>> modules view are all the projects which are attached to this server.
>> Choose the one you are working with and then click on the "Edit..."
>> button on the right.
>>
>> Uncheck "Auto reloading enabled"
>
> Hi Wojtek!
> I have a question though: I always thought that the option you mention
> just enables and disables the automatic republish for the module, so I
> assumed that disabling it just means that I have to manually reload the
> webapp/the server when I make changes. I never associated it with "hot
> code replace". Reading the Tomcat FAQ didn't help me to understand.
>
> So:
> 1) isn't "auto-reloading enabled" equivalent to the "automatically
> publish when resources changes" located in the server configuration, but
> restricted to a single module? Or are they different things?
>
> 2) did you try and see that disabling automatic reloading of a module
> enables hot code replace for it?
>
> Thanks in advance,
> Mauro.

I assume hot code replace is referring to the feature in a debug session
where certain updates can be applied to live classes without restarting
the JVM or Tomcat. The "auto-reloading" feature of Tomcat doesn't
directly disable hot code replace, but can indeed interfere with this
JVM debugging feature, inside or outside of Eclipse. I believe
disabling automatic publishing in the server editor would also avoid the
interference by not triggering a automatic reload of the webapp, but
runs the risk of forgetting to publish changes when Tomcat is actually
restarted. If you did restart Tomcat without forcing a publish, it
would use the last published version of a class which might not be up to
date with the version in the project.

However, if you aren't running a debug session, then having Tomcat's
"auto-reloading" feature enabled can be a benefit since you can
temporarily ignore the "Restart" indication in the Servers View and
allow the reload to pickup class or web.xml changes. Since the old
webapp is likely to leak at least its classloader, you will eventually
need to restart Tomcat, but being able to skip a few rounds might be of
value. A restart will also be necessary if the reload isn't able to
adequately restore the state of the webapp, which can be the case for
some webapps.

Cheers,
Larry
Re: Hot Code Replace [message #219986 is a reply to message #219970] Wed, 03 September 2008 10:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: nowhere.a.com

Mauro Molinari wrote :
> Wojtek ha scritto:
>> Ok, the path to the checkbox is:
>>
>> In the Server view, click on the server name. This will open the server
>> properties page. At the bottom is a tab named "Modules". In the modules
>> view are all the projects which are attached to this server. Choose the one
>> you are working with and then click on the "Edit..." button on the right.
>>
>> Uncheck "Auto reloading enabled"
>
> Hi Wojtek!
> I have a question though: I always thought that the option you mention just
> enables and disables the automatic republish for the module, so I assumed
> that disabling it just means that I have to manually reload the webapp/the
> server when I make changes. I never associated it with "hot code replace".
> Reading the Tomcat FAQ didn't help me to understand.

It is not intuitive to me. But it seems to work. And it publishes
changes made while editing with the server shut down.

> So:
> 1) isn't "auto-reloading enabled" equivalent to the "automatically publish
> when resources changes" located in the server configuration, but restricted
> to a single module? Or are they different things?
>
> 2) did you try and see that disabling automatic reloading of a module enables
> hot code replace for it?

I do not know. My use of the check box is hit/miss not theoretical. I
do not know at this time what any side effects might be.

--
Wojtek :-)
Re: Hot Code Replace [message #220096 is a reply to message #219978] Wed, 03 September 2008 11:44 Go to previous messageGo to next message
Eclipse User
Originally posted by: mauro.molinari.cardinis.com

Larry Isaacs ha scritto:
> I assume hot code replace is referring to the feature in a debug session
> where certain updates can be applied to live classes without restarting
> the JVM or Tomcat. The "auto-reloading" feature of Tomcat doesn't
> directly disable hot code replace, but can indeed interfere with this
> JVM debugging feature, inside or outside of Eclipse. I believe
> disabling automatic publishing in the server editor would also avoid the
> interference by not triggering a automatic reload of the webapp, but
> runs the risk of forgetting to publish changes when Tomcat is actually
> restarted. If you did restart Tomcat without forcing a publish, it
> would use the last published version of a class which might not be up to
> date with the version in the project.
>
> However, if you aren't running a debug session, then having Tomcat's
> "auto-reloading" feature enabled can be a benefit since you can
> temporarily ignore the "Restart" indication in the Servers View and
> allow the reload to pickup class or web.xml changes. Since the old
> webapp is likely to leak at least its classloader, you will eventually
> need to restart Tomcat, but being able to skip a few rounds might be of
> value. A restart will also be necessary if the reload isn't able to
> adequately restore the state of the webapp, which can be the case for
> some webapps.

Hi Larry,
I understood a little better now... and I see it's not a feature that
can work "out-of-the-box", because of the many implications.

Maybe a FAQ entry on this topic would be useful, especially because I
often hear about this question on the newsgroup and among my
co-workers... Also, NetBeans seems to support hot code replace in debug
mode "automatically" when debugging webapps using the internal Tomcat
server... at least this is what I have been said by my collegues that
use NetBeans.

Mauro.
Re: Hot Code Replace [message #220098 is a reply to message #219986] Wed, 03 September 2008 11:45 Go to previous message
Eclipse User
Originally posted by: mauro.molinari.cardinis.com

Wojtek ha scritto:
> It is not intuitive to me. But it seems to work. And it publishes
> changes made while editing with the server shut down.

>> So:
>> 1) isn't "auto-reloading enabled" equivalent to the "automatically
>> publish when resources changes" located in the server configuration,
>> but restricted to a single module? Or are they different things?

Thank you Wojtek! Thanks to you and Larry I now understood the
difference between automatic "reloading" of the context and "automatic
publishing".

Mauro.
Previous Topic:Cannot create an EJB3 session bean with Eclipse 3.4.0
Next Topic:Tomcat 6 web app is not started because of "java.io.IOException: invalid header"
Goto Forum:
  


Current Time: Mon Jul 28 08:36:46 EDT 2014

Powered by FUDForum. Page generated in 0.01918 seconds