File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes How to hot redeploy an app to JBoss? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to hot redeploy an app to JBoss?" Watch "How to hot redeploy an app to JBoss?" New topic
Author

How to hot redeploy an app to JBoss?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using JBoss 5.1 on Mac 10.5.6 (Java 1.6). Right now, I'm using Maven 2.2 as my biuld tool. Does anyone know how to hot-redeploy an app without having to restart the server? I'm noticing that whenever I make a change to my WAR file, install and deploy using

mvn install jboss:deploy

I'm having to restart my JBoss server in order to see those changes. I was hoping someone could suggest a more efficient workflow.

Thanks, - Dave
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5838
    
    7

JBoss AS, by default, hot deploys applications. By default, it scans the deploy directory every 5 seconds to see if an app was updated, and if so, redeploys it. By "if an app was updated" I mean either:

a) the app is packaged and deployed an an archive file and the archive file's timestamp changed

b) the app is packaged and deployed as an exploded directory, and the key configuration file (web.xml for war, application.xml for ear) has it's timestamp changed.

I have no idea what Maven does with the "jboss:deploy" directive. If there are no responses here, I might move this question to the Maven forum. (Please do not repost this question in that forum.)


JBoss In Action
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Where is this "5 seconds" setting ?
If i want to change it to 30 seconds for instance, which file holds that information ?

Thanks

EDIT:
cannot find this info in jboss-5.1.0.GA.jdk6\server\default\conf\bootstrap\profile.xml and jboss-5.1.0.GA.jdk6\server\default\conf\bootstrap\deployers

Peter Johnson wrote:JBoss AS, by default, hot deploys applications. By default, it scans the deploy directory every 5 seconds to see if an app was updated, and if so, redeploys it. By "if an app was updated" I mean either:

a) the app is packaged and deployed an an archive file and the archive file's timestamp changed

b) the app is packaged and deployed as an exploded directory, and the key configuration file (web.xml for war, application.xml for ear) has it's timestamp changed.

I have no idea what Maven does with the "jboss:deploy" directive. If there are no responses here, I might move this question to the Maven forum. (Please do not repost this question in that forum.)


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5838
    
    7

In 5.1.0.GA, this setting (scanPeriod) was move tho the HDScanner bean in server/xxx/deploy/hdscanner-jboss-beans.xml. (Yes, keeping up with "configuration settings' musical chairs" is almost a full-time job.)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to hot redeploy an app to JBoss?