Tuesday, May 13, 2008

If your JBossAS does not want to redeploy embedded war archives ...

JBossAS has since I remember a cool feature called Hot-Deploy. When you want to deploy an archive (EJB-Jar, Webarchive or else), you just throw it into the deploy/ directory of the server config. JBossAS will detected (by default within 5 secs) and deploy it. Same if you have updated an existing archive.
To just force a redploy, you can just touch the archive.

JBossAS has a second cool feature around this: exploded archives. Here you don't need to zip up the archive to deploy it, but you can just deploy a flat directory hierarchy (which of course needs to follow the required archive structure). To redeploy a changed archive, you don't touch the archive directory, but the descriptor file in it (e.g. web.xml for a .war archive).

Now lets imagine you want to update a few files (like struts config) in an exploded .war within a .ear. You'd expect to just touch the web.xml file of the war an be done. But sometimes this just does not work. If this is the case, but normal redeploys of e.g. the ear work, then go and check deploy/jboss-web.deployer/context.xml

This needs to read:

<Context cookies="true" crossContext="true" reloadable="true">

After changing this, restart the JBossAS and the redeploy of the embedded war will work.

No comments: