Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Restart vs Republish on Tomcat with WTP 1.5
Restart vs Republish on Tomcat with WTP 1.5 [message #177098] Wed, 16 August 2006 13:39 Go to next message
Eclipse User
Originally posted by: tariq.chalabi.cheshire.pnn.police.uk

Hi

Just started using WTP plugin (1.5) with eclipse 3.1 running Tomcat 5.5

I've created a Dynamic Web Application and published it to a server.

When I make changes to JSP's and .java files - WTP recognizes that these
changes require a Republish and automatically synchronises the app with
the server.

However when I make changes to web.xml, faces-config.xml, or any other
config file - the server state just says "Restart", and I have to restart
the server for these changes to be picked up by the server. Which is a
bit tiresome after doing that 10 times an hour.

Is it possible to get WTP to republish automatically - even for when those
config files are changed

Tariq
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #177116 is a reply to message #177098] Wed, 16 August 2006 17:02 Go to previous messageGo to next message
Darryl Miles is currently offline Darryl Miles
Messages: 123
Registered: July 2009
Senior Member
Tariq Chalabi wrote:
> However when I make changes to web.xml, faces-config.xml, or any other
> config file - the server state just says "Restart", and I have to
> restart the server for these changes to be picked up by the server.
> Which is a bit tiresome after doing that 10 times an hour.
>
> Is it possible to get WTP to republish automatically - even for when
> those config files are changed

Hmm... not really.

Restarting the container is the only way to guarantee the configuration
change that have been made will be picked up and in use. The
sledgehammer approach. However...


There are a few issues here:

* Eclipse modifies the contents and/or updates the timestamp on the
web.xml files unnecessarily in some scenarios. So this aspect could be
considered eclipse fixable issues.

* Tomcat does have a feature to allow the reloading of a single web-app
(without restarting the entire container). This feature is not perfect
(I wont bore the list with the details right now) but it would be
possible to make use of this feature to shave reload times down
somewhat. But Eclipse can't do that right now.

* Then into the really distant future: Tomcat could be improved in the
area of helping developers by making it possible for it to detect the
changes in the web.xml and have fine grained support to invalidate the
affected parts of the running configuration. Many configuration changes
could actually be done hot with TC running but it would require major
infrastructure changes inside tomcat.


The changes above generally wont help you much if you are using a
complex framework like Hibernate, Spring, Struts and making
configuration changes to the framework itself, but in my experience not
much overall time is spent on configuration issue (unless you don't know
what you are doing, ha ha). However there are ways, means and trick
around some of those issues. There is also out-of-container unit
testing to speed up code/debug cycles, leaving you to bolt code into a
servlet at the last minute.


The entire process of IDE <> container hot development is something that
interests me.

It would definatly be possible to have a seamless end-to-end model for
development with a servlet container which is something I think everyone
would appreciate.

But it going to take some time to be realized.



There are a number of configuration tweaks you can make to improve the
quality of life for the developer. I'm not sure anyone has documented
these thing and maybe someone should.

* Using a META-INF/config.xml
* Setting <Context ... debug="1" reloadable="true">
* Disabling Eclipse's auto-restart and auto-redeploy.
* Enabling Eclipse's auto-publish to 1 second (it would be good to have
instant continuous automatic publishing or a milliseconds timeout value)
* Making changes to the global configuration $CATALINA_HOME/conf/web.xml
for the 'jsp' servlet I added the following (dont forget to delete your
runtime instance and recreate it when you change this):

<init-param>
<param-name>development</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>modificationTestInterval</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>reloading</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>compilerSourceVM</param-name>
<param-value>1.5</param-value>
</init-param>
<init-param>
<param-name>compilerTargetVM</param-name>
<param-value>1.5</param-value>
</init-param>

This kills the default 4 second update lag you get when you modify pages.


Darryl
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #177280 is a reply to message #177116] Thu, 17 August 2006 23:14 Go to previous messageGo to next message
Darryl Miles is currently offline Darryl Miles
Messages: 123
Registered: July 2009
Senior Member
Darryl L. Miles wrote:
> * Setting <Context ... debug="1" reloadable="true">

Opps, major error from me....

* Setting <Context ... debug="1" reloadable="false">

This is to let eclipse start TC in debug mode and use JVM hotswap
capabilities, instead of TC restarting the webapp for every java code
change. Using hotswap is better.

Darryl
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #177295 is a reply to message #177116] Fri, 18 August 2006 08:24 Go to previous messageGo to next message
Eclipse User
Originally posted by: tariq.chalabi.cheshire.pnn.police.uk

Thanks for all the useful advice. I'll try some of your tips as soon as I
get a moment.

I think that one of the best features that an IDE can offer developers is
a quick code-build-reload cycle.

From that point of view WTP is a bit disappointing - and perhaps I'd be
better sticking with an ant script and using the catalina-ant tasks to
reload the app when I want to.

I've been quite impressed with the BEA Weblogic Studio plugin. They have
a thread called AppXRay which constantly scans an app for all the
dependencies that may have changed e.g. hibernate mapping files,
faces-config etc, and then does an automatic reload.

Shame it costs $900!

Cheers

Tariq
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #177544 is a reply to message #177295] Sat, 19 August 2006 11:51 Go to previous messageGo to next message
Darryl Miles is currently offline Darryl Miles
Messages: 123
Registered: July 2009
Senior Member
Tariq Chalabi wrote:
> I think that one of the best features that an IDE can offer developers
> is a quick code-build-reload cycle.
>
> From that point of view WTP is a bit disappointing - and perhaps I'd be
> better sticking with an ant script and using the catalina-ant tasks to
> reload the app when I want to.

Well I dont think its WTPs fault, it sounds like your configuration is
the problem. There isn't much more WTP can do to speed up this area
without involving the container. Start by disabling WTPs builtin
auto-restart/auto-deploy, but keep auto-publish on.

The container could:
* Allow resource invalidation (tag pools, .tag, .tld file reloading)
* Allow hot-deployment filter/servlet config changes
* Allow automatic JSP compliation on update
* Get involved with class/JAR file update


> I've been quite impressed with the BEA Weblogic Studio plugin. They
> have a thread called AppXRay which constantly scans an app for all the
> dependencies that may have changed e.g. hibernate mapping files,
> faces-config etc, and then does an automatic reload.

What does it reload ? The container or the web-app or just the parts of
the web-app which are affected.

You can get the TC container to reload automatically if you set
reloadable="true" but it quickly becomes a nusience, since Eclipse can
do hot code replace of .java/.class files. So its changes to other
files in the WEB-INF tree which really need a reload, but if you are
using xdoclet as well then you get excessive reloading for no reason.


I'm not sure how an ANT task makes the code-build-reload cycle better
for you, even if you put it on the External Tools button productivity is
less than the server tools for me.

Darryl
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #177658 is a reply to message #177544] Tue, 22 August 2006 15:45 Go to previous messageGo to next message
Eclipse User
Originally posted by: tariq.chalabi.cheshire.pnn.police.uk

Darryl L. Miles wrote:


> Well I dont think its WTPs fault, it sounds like your configuration is
> the problem. There isn't much more WTP can do to speed up this area
> without involving the container. Start by disabling WTPs builtin
> auto-restart/auto-deploy, but keep auto-publish on.

I've followed your advice on setting up eclipse configuration correctly -
and I look forward to a slicker code /debug cycle. But I still think that
in a JSF app - a developer is going to make numerous changes to
faces-config.xml - and that it will become very onerous to restart tomcat
each time he wants to see the effect of those changes, especially when all
that is needed is to reload the individual web-app

>> I've been quite impressed with the BEA Weblogic Studio plugin. They
>> have a thread called AppXRay which constantly scans an app for all the
>> dependencies that may have changed e.g. hibernate mapping files,
>> faces-config etc, and then does an automatic reload.

> What does it reload ? The container or the web-app or just the parts of
> the web-app which are affected.

AFAIK it reloads the web-app - which is a lot quicker than restarting
Tomcat

> I'm not sure how an ANT task makes the code-build-reload cycle better
> for you, even if you put it on the External Tools button productivity is
> less than the server tools for me.

Well - there is the Catalina Ant task to reload an individual app. I
think that this is often all that is needed to get the container to load
the latest version of xml config files.

Tariq
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #177797 is a reply to message #177098] Wed, 23 August 2006 22:42 Go to previous messageGo to next message
Eclipse User
Originally posted by: mattkrevs.internode.on.net

I'm not sure if this is also applicable, but you can define watched
resources in context.xml so that tomcat reloads the web app if any watched
resource is modified

eg
<WatchedResource>WEB-INF/web.xml</WatchedResource>

"Tariq Chalabi" <tariq.chalabi@cheshire.pnn.police.uk> wrote in message
news:2f0170a46656e594c44e11e21544f5ad$1@www.eclipse.org...
> Hi
>
> Just started using WTP plugin (1.5) with eclipse 3.1 running Tomcat 5.5
>
> I've created a Dynamic Web Application and published it to a server.
>
> When I make changes to JSP's and .java files - WTP recognizes that these
> changes require a Republish and automatically synchronises the app with
> the server.
>
> However when I make changes to web.xml, faces-config.xml, or any other
> config file - the server state just says "Restart", and I have to restart
> the server for these changes to be picked up by the server. Which is a
> bit tiresome after doing that 10 times an hour.
>
> Is it possible to get WTP to republish automatically - even for when those
> config files are changed
>
> Tariq
>
>
Re: Restart vs Republish on Tomcat with WTP 1.5 [message #178426 is a reply to message #177658] Fri, 01 September 2006 04:57 Go to previous message
Darryl Miles is currently offline Darryl Miles
Messages: 123
Registered: July 2009
Senior Member
Tariq Chalabi wrote:
> Darryl L. Miles wrote:
>> What does it reload ? The container or the web-app or just the parts
>> of the web-app which are affected.
>
> AFAIK it reloads the web-app - which is a lot quicker than restarting
> Tomcat

Ok thats useful to know that someone else is doing it.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=109121 is a feature
request for web-app control like this.

Darryl
Previous Topic:Re: Complex Type Parsing
Next Topic:Hot Code Replacement
Goto Forum:
  


Current Time: Fri Sep 19 01:48:10 GMT 2014

Powered by FUDForum. Page generated in 0.03857 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software