Hot Redeployment for exploded deployments in JBoss EAP 4 does not appear to work

Solution Verified - Updated -

Environment

  • JBoss Enterprise Application Platform (EAP) 4.3
  • Application archive deployed as an exploded directory such as any of the following
    • Web application archive (WAR) deployed as an exploded directory
    • Enterprise application archive (EAR) deployed as an exploded directory which contains an exploded web application archive (WAR)

Issue

  • We have an exploded WAR file deployed and we are trying to update the .class file changes in the directory structure but JBoss Enterprise Application Platform (EAP) hot deployment is very sporadic detecting class file changes for redeployment
  • We have set <attribute name="RecursiveSearch">True</attribute> for org.jboss.deployment.scanner.URLDeploymentScanner MBean service in jboss-service.xml but class file changes in our exploded WAR do not cause the WAR to be redeployed
  • We have an exploded EAR file deployed which contains an exploded WAR file and when the web.xml of our WAR is touched, the WAR is not redeployed

Resolution

To have an exploded application archive hot redeployed, you will need to update the time stamp of the deployment descriptor for its parent or top most exploded archive.  Additionally you can update the time stamp of the root directory containing the exploded application archive's contents.  This would be the directory directly beneath the deploy directory.  For example, ${JBOSS_HOME}/server/${JBOSSCONF}/deploy/my-exploded-app.ear.

If the exploded application archive contains a child exploded application archive, only the parent will be checked for redeployment.  So, for example, if you have an exploded EAR which contains an exploded WAR, changes to the WAR's deployment descriptor, WEB-INF/web.xml, will not trigger redeployment.

The RecursiveSearch attribute of the URLDeploymentScanner MBean Service only affects how deep within the deployment directory to look for a valid root or top level deployment. 

Root Cause

Once a deployment is found, URLDeploymentScanner will not scan any deeper for valid deployments regardless of the value for RecursiveSearch attribute.  If the RecursiveSearch attribute is set to True and URLDeploymentScanner can not associate a directory entry with a Deployer, it will recursively look for deployments within the directory.  For example, you could place your deployments in ${JBOSS_HOME}/server/${JBOSSCONF}/deploy/MySpecialApps/ and they would be scanned by URLDeploymentScanner if RecursiveSearch is True and ignored if RecursiveSearch is False.

Redeployment will only occur when the DeploymentScanner notices a change in a deployment that it originally found.  For exploded application archives, it only checks the time stamp of the root or top most deployment descriptor and the time stamp of the root or top most exploded deployment directory.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments