Mar 08 2007
The Deployment scanner – jboss
Start
The conf/jboss-service.xml file is full of options. One of these ones is about the deployment scanner. If you make any change in a jboss config file then you’ll have to restart the server.
Open the conf/jboss-service.xml in vi or some text editor capable of saving in plain text. Scroll near the bottom to the MBean definition for the DeploymentScanner:
Deployment Sorter
As you scroll down you should see some comments followed by this:
org.jboss.deployment.DeploymentSorter
This is the deployment sorter which enforces the default deployment order. Starting from 4.0.1, it gets the sort order from the MainDeployerss EnhancedSuffixOrder. If you prefer a UNIX System-V init style you can comment this sorter and uncomment the following line:
org.jboss.deployment.scanner.PrefixDeploymentSorter
This sorter will use a numeric prefix-based order. If you wish to use this sort, you should read further on the prefix deployment order.
Scan Period
As you scroll further you will find:
5000
The default value is 5000 milliseconds or 5 seconds. This determines how frequently the directories which the Deployment Scanner is watching (/deploy) will be polled. Of course it very usefull when you are under development. But when you a production server this option should be disable (because of waste CPU, or protect from unwanted productions changes)
URLs
As you scroll further you will find:
deploy/
It will defined where data (such as .ear or .war) for hot deployments will be used.
It could even be http://url or webdav url.
For example, if you wanted to protect the database passwords you might do this:
deploy/,datasources/
You could set the file system permissions on datasources/ such that JBoss could read them, but developers could not.
Recursive
Finally, you should see:
True
This will cause the deployment scanner to recurse into subdirectories. Read this for more informaton on the drawbacks.
Disable Hot Deployment
Add the following attribute:
false

