Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Exploded EAR / hot swapping
Exploded EAR / hot swapping [message #198749] Wed, 22 August 2007 15:06 Go to next message
Eclipse User
Originally posted by: nospam.nospam.de

Hi all,

Is there a way to deploy an exploded ear? I want to hot swap JSPs and Java
code. If this is not possible, how can I speed up development/test cylce?
Reloading the whole application takes time (at least in JBoss 4.2 - even
with stript down config).

Regards
Patrick
Re: Exploded EAR / hot swapping [message #198995 is a reply to message #198749] Mon, 27 August 2007 15:35 Go to previous messageGo to next message
Eclipse User
Originally posted by: adam.hardy.no.spam.cyberspaceroad.spam

Patrick Ruhkopf on 22/08/07 16:06, wrote:
> Hi all,
>
> Is there a way to deploy an exploded ear? I want to hot swap JSPs and Java
> code. If this is not possible, how can I speed up development/test cylce?
> Reloading the whole application takes time (at least in JBoss 4.2 - even
> with stript down config).

This is something that would make my development cycle alot quicker at the
moment too.

It should be possible to hotswap Java classes too - it is in a stand-alone
tomcat, JBoss, websphere etc - but in some configurations, WTP will restart the
server.

At the moment, I have tomcat allowing hot deployment of JSPs, as in the
stand-alone tomcat. There is no direct WTP configuration option available to
specify this, it occurs with the default configuration when you do the following:

(1) create a new instance of the server (delete the old ones)
(2) start it up with no apps deployed
(3) open it (from the Servers view) to get to the config set-up dialog
(4) specify that WTP controls the server - the radio button for tomcat says "use
tomcat installation" so presumably for JBoss it's similar
(5) under 'Automatic Publishing', select all options with 1 second intervals :)
(6) right click the server and choose properties
(7) in the Info dialog, make sure the location is at localhost.server (probably
irrelevant, but who knows)
(8) add the project

This works for me at the moment for tomcat. When I edit a JSP in some situations
though, it is automatically deployed which is great, but then WTP automatically
does a context reload and so my session is lost.

And in other situations, WTP doesn't automatically deploy edited JSPs (or
restart the server). I haven't managed to isolate the reason why this occurs.

There are quite a few rough edges to v3.3.0 which give the impression that this
is currently as good as it gets. What is puzzling me currently is why WTP puts a
<Context> element for my webapp in both tomcat's server.xml and in the
conf/Catalina/localhost/webapp-name.xml - this must be a bug.
Re: Exploded EAR / hot swapping [message #199031 is a reply to message #198995] Tue, 28 August 2007 12:28 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
adam hardy wrote:
> Patrick Ruhkopf on 22/08/07 16:06, wrote:
>> Hi all,
>>
>> Is there a way to deploy an exploded ear? I want to hot swap JSPs and
>> Java code. If this is not possible, how can I speed up
>> development/test cylce? Reloading the whole application takes time (at
>> least in JBoss 4.2 - even with stript down config).
>
> This is something that would make my development cycle alot quicker at
> the moment too.
>
> It should be possible to hotswap Java classes too - it is in a
> stand-alone tomcat, JBoss, websphere etc - but in some configurations,
> WTP will restart the server.
>
> At the moment, I have tomcat allowing hot deployment of JSPs, as in the
> stand-alone tomcat. There is no direct WTP configuration option
> available to specify this, it occurs with the default configuration when
> you do the following:
>
> (1) create a new instance of the server (delete the old ones)
> (2) start it up with no apps deployed
> (3) open it (from the Servers view) to get to the config set-up dialog
> (4) specify that WTP controls the server - the radio button for tomcat
> says "use tomcat installation" so presumably for JBoss it's similar

Still on the to-do list is to add a Q/A to the Tomcat FAQ for a side
effect of the "Use tomcat installation" option. Since the destination
is outside of the workspace, the publishing code is a little different
for that choice. One impact of this is that utility jars are always
rewritten during publishing. This may explain one of the behaviors you
mention below. When I get around to updating the Tomcat FAQ for WTP
2.0, I'll try to include this. The Tomcat FAQ is at
http://www.eclipse.org/webtools/faq/TomcatServerFAQ.php. Though it
covers just WTP 1.5, a lot of the information still applies.

> (5) under 'Automatic Publishing', select all options with 1 second
> intervals :)
> (6) right click the server and choose properties
> (7) in the Info dialog, make sure the location is at localhost.server
> (probably irrelevant, but who knows)
> (8) add the project
>
> This works for me at the moment for tomcat. When I edit a JSP in some
> situations though, it is automatically deployed which is great, but then
> WTP automatically does a context reload and so my session is lost.

Using "Use tomcat installation" and having a utility project dependency
can cause this behavior, as mentioned above. Just changing a JSP
shouldn't cause a reload or restart.

>
> And in other situations, WTP doesn't automatically deploy edited JSPs
> (or restart the server). I haven't managed to isolate the reason why
> this occurs.

I haven't been able to duplicate this, so open a Bugzilla if you come
upon the reason.

>
> There are quite a few rough edges to v3.3.0 which give the impression
> that this is currently as good as it gets. What is puzzling me currently
> is why WTP puts a <Context> element for my webapp in both tomcat's
> server.xml and in the conf/Catalina/localhost/webapp-name.xml - this
> must be a bug.

Why contexts are saved in server.xml is covered by
http://www.eclipse.org/webtools/faq/TomcatServerFAQ.php#info _09.
Tomcat, not WTP, is creating the file under "conf/Catalina/localhost"
since it is needed for context reloading. In WTP 2.0 for Tomcat 5.0 and
later, you have the option of checking "Publish module contexts to
separate XML files". This will cause the publish operation to extract
the contexts for added projects from the server.xml under the Servers
project in your workspace and write them to separate files under
"conf/Catalina/localhost".

Cheers,
Larry

>
>
>
>
Previous Topic:Suggested webtools redesign
Next Topic:cleaning deployment
Goto Forum:
  


Current Time: Thu Oct 02 02:23:32 GMT 2014

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

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