You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Remo Liechti <re...@swisslog.com> on 2008/04/04 10:55:16 UTC

How to prevent tomcat from restarting after hot code replacement?

Hi guys
 
I have the problem that always when I start tomcat in debug mode, and
change some java files, tomcat restarts after some seconds after the
code was replaced.
In that very small timeframe between code replacement and restart I can
execute the new code, but tomcat restarts(or re init the context)
anyway.
 
How can this be turned off? I just want my code to be hot deployed and
not restarting tomcat. If JSP files are hot eployed, tomcat does not
start, so why should it start by java files?
 
Thanks guys!
 
Remo
 
 
Remo Liechti
Application Developer
Swisslog Warehouse and Distribution Solutions

Direct: +41 (0)62 837 4345
Mobile: +41 (0)76 329 8660
CH Fax: +41 (0)62 837 4197
Internet:
<file:///C:/Documents%20and%20Settings/LiechtiR/Application%20Data/Micro
soft/Signatures/www.swisslog.com> www.swisslog.com
<http://www.swisslog.com------------------------------------------------
----------------about/> 
----------------------------------------------------------------
About Swisslog
Swisslog is a global provider of logistic solutions for warehouses,
distribution centers and hospitals. Swisslog's solutions increase their
customers' flexibility, responsiveness, and quality of service, while
minimizing logistics costs. 

 

This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.


RE: How to prevent tomcat from restarting after hot code replacement?

Posted by Remo Liechti <re...@swisslog.com>.
Sorry forgot to say: Using eclipse(3.3.2) with WTP (2.0.2 sdk version).




Remo Liechti
Application Developer
Swisslog Warehouse and Distribution Solutions

Direct: +41 (0)62 837 4345
Mobile: +41 (0)76 329 8660
CH Fax: +41 (0)62 837 4197
Internet: www.swisslog.com
----------------------------------------------------------------
About Swisslog
Swisslog is a global provider of logistic solutions for warehouses,
distribution centers and hospitals. Swisslog's solutions increase their
customers' flexibility, responsiveness, and quality of service, while
minimizing logistics costs. 


-----Original Message-----
From: Remo Liechti [mailto:remo.liechti@swisslog.com] 
Sent: Freitag, 4. April 2008 10:55
To: users@tomcat.apache.org
Subject: How to prevent tomcat from restarting after hot code
replacement?

Hi guys
 
I have the problem that always when I start tomcat in debug mode, and
change some java files, tomcat restarts after some seconds after the
code was replaced.
In that very small timeframe between code replacement and restart I can
execute the new code, but tomcat restarts(or re init the context)
anyway.
 
How can this be turned off? I just want my code to be hot deployed and
not restarting tomcat. If JSP files are hot eployed, tomcat does not
start, so why should it start by java files?
 
Thanks guys!
 
Remo
 
 
Remo Liechti
Application Developer
Swisslog Warehouse and Distribution Solutions

Direct: +41 (0)62 837 4345
Mobile: +41 (0)76 329 8660
CH Fax: +41 (0)62 837 4197
Internet:
<file:///C:/Documents%20and%20Settings/LiechtiR/Application%20Data/Micro
soft/Signatures/www.swisslog.com> www.swisslog.com
<http://www.swisslog.com------------------------------------------------
----------------about/>
----------------------------------------------------------------
About Swisslog
Swisslog is a global provider of logistic solutions for warehouses,
distribution centers and hospitals. Swisslog's solutions increase their
customers' flexibility, responsiveness, and quality of service, while
minimizing logistics costs. 

 

This message may contain legally privileged or confidential information
and is therefore addressed to the named persons only. The recipient
should inform the sender and delete this message, if he/she is not named
as addressee.
The sender disclaims any and all liability for the integrity and
punctuality of this message. The sender has activated an automatic virus
scanning, but does not guarantee the virus free transmission of this
message.


This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to prevent tomcat from restarting after hot code replacement?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remo,

Remo Liechti wrote:
| When using reloadable=false  I'm not able to hot deploy java code, so
| this doesnt solve the problem. As far as I see there is no way to
| prevent tomcat from reinit the context.

Your two previous statements are at odds with each other.

| The myeclipse guys wrote an own
| tomcat server handleing plugin with managers and all that stuff, so they
| made some tricks there I guess...

Yes, they did.

| Any other idea?

Yes. Run Tomcat with reloadable="false". Reload Tomcat explicitly when
you want to re-load the classes. Like I said at the beginning, the only
way to get what you want is to hack around with Tomcat's internal
ClassLoaders. Replacing class definitions at runtime is a tricky
business, so be careful what you do. I find it easier to simply reload
my application. It only takes a few seconds.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf7fC8ACgkQ9CaO5/Lv0PC7VACfdnIuHmHsUHv1MjzQmOiJ4/zC
ERsAnjxwVrcCn8IEOPGJjKlMuU1nrYzN
=vlPO
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to prevent tomcat from restarting after hot code replacement?

Posted by Remo Liechti <re...@swisslog.com>.
Chris,

When using reloadable=false  I'm not able to hot deploy java code, so
this doesnt solve the problem. As far as I see there is no way to
prevent tomcat from reinit the context. The myeclipse guys wrote an own
tomcat server handleing plugin with managers and all that stuff, so they
made some tricks there I guess...

Any other idea?

Thanks,
Remo



Remo Liechti
Application Developer
Swisslog Warehouse and Distribution Solutions

Direct: +41 (0)62 837 4345
Mobile: +41 (0)76 329 8660
CH Fax: +41 (0)62 837 4197
Internet: www.swisslog.com
----------------------------------------------------------------
About Swisslog
Swisslog is a global provider of logistic solutions for warehouses,
distribution centers and hospitals. Swisslog's solutions increase their
customers' flexibility, responsiveness, and quality of service, while
minimizing logistics costs. 


-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Montag, 7. April 2008 17:07
To: Tomcat Users List
Subject: Re: How to prevent tomcat from restarting after hot code
replacement?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remo,

Remo Liechti wrote:
| |The best you can do is to turn off auto-reload.
|
| Where do I turn of auto reload? Will class files still be published to

| tomcat after they changed?

Set reloadable="false" in your <Context>.

| || I just want my code to be hot deployed and not restarting tomcat.
| |You cannot do this unless you hack Tomcat or your webapp to re-load 
| |class files when they change.
|
| Well, using the MyEclipse bundle it works! But not using WTP standard?

This is because Eclipse performs some trickery to replace classes during
runtime.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf6OJAACgkQ9CaO5/Lv0PBPkACfXJrWJ7nRbp+6N7uigB0F7G20
wvkAn36WuQtgb0p60ZyF9HhtCxUvivFo
=vkgu
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to prevent tomcat from restarting after hot code replacement?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remo,

Remo Liechti wrote:
| |The best you can do is to turn off auto-reload.
|
| Where do I turn of auto reload? Will class files still be published to
| tomcat after they changed?

Set reloadable="false" in your <Context>.

| || I just want my code to be hot deployed and not restarting tomcat.
| |You cannot do this unless you hack Tomcat or your webapp to re-load
| |class files when they change.
|
| Well, using the MyEclipse bundle it works! But not using WTP standard?

This is because Eclipse performs some trickery to replace classes during
runtime.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf6OJAACgkQ9CaO5/Lv0PBPkACfXJrWJ7nRbp+6N7uigB0F7G20
wvkAn36WuQtgb0p60ZyF9HhtCxUvivFo
=vkgu
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: How to prevent tomcat from restarting after hot code replacement?

Posted by Remo Liechti <re...@swisslog.com>.
Hi Chris,

|Remo Liechti wrote:
|| I have the problem that always when I start tomcat in debug mode, and

|| change some java files, tomcat restarts after some seconds after the 
|| code was replaced.

|Do you mean that your /webapp/ restarts? Tomcat should not restart
itself for any reason.
Yes, it restarts /webapps

|| How can this be turned off?
|The best you can do is to turn off auto-reload.
Where do I turn of auto reload? Will class files still be published to
tomcat after they changed?

|| I just want my code to be hot deployed and not restarting tomcat.
|You cannot do this unless you hack Tomcat or your webapp to re-load
class files when they change.
Well, using the MyEclipse bundle it works! But not using WTP standard?

Thanks,
Remo


This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee.
The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning, but does not guarantee the virus free transmission of this message.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: How to prevent tomcat from restarting after hot code replacement?

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Remo,

Remo Liechti wrote:
| I have the problem that always when I start tomcat in debug mode, and
| change some java files, tomcat restarts after some seconds after the
| code was replaced.

Do you mean that your /webapp/ restarts? Tomcat should not restart
itself for any reason.

| How can this be turned off?

The best you can do is to turn off auto-reload.

| I just want my code to be hot deployed and
| not restarting tomcat.

You cannot do this unless you hack Tomcat or your webapp to re-load
class files when they change.

| If JSP files are hot deployed, tomcat does not
| start, so why should it start by java files?

JSPs are treated specially. Sorry :(

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf2efYACgkQ9CaO5/Lv0PCuAACeN6uD4mMD+y3/iKoRaGI4EjOy
1fQAn00mTlSBtt0ye5+QCT49I6UED6vK
=lbFE
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org