Saturday, July 10, 2010

How to use different deployment locations in JBoss


Target Audience: Beginners
JBoss version 4.x

We normally would have a build system which builds the application, creates the distribution files ( war, sar ,ear...) and then copies the distribution files to server/xxx/deploy directory. In JBoss, We used to deploy our applications under server/xxx/deploy.
E.g: D:/Tools/jboss-4.2.0.GA/server/default/deploy
Alternatively we can tell( configure) JBoss to deploy the application from our preferred location ( somewhere from outside of the JBoss).

How can we do that?
There is a MBean with name “jboss.deployment:type=DeploymentScanner” has been defined in conf/jboss-service.xml. This MBean is responsible for hot deployments. This MBean has a attribute “URLs” which accepts comma separated values. We can add our values too along with the existing values. Suppose our distribution files are built under c:/myproject/dist, then we can configure the DeploymentScanner as given bellow.


Don’t forget to restart the JBoss server after the changes were made. The DeploymentScanner will scan the configured URLs and deploy the possible applications.

If you want to configure the location without restating the application as hot deployment then you would have to do it through the JMX-Console. Please find the details here

Hope this will be helpful.

No comments:

Post a Comment