How to do deployments on JBoss Application Server

Deployment is a two-step process

  1. First we notify JBoss that of the application we want to deploy by copying it to ${jboss.server.home.url}/deploy/ or any of its subdirectories
  2. Then, JBoss performs the necessary steps to make that application ready for our use

Reverting the deployment is also a two-step process

  1. First we notify JBoss that of the application we want to undeploy by removing it from ${jboss.server.home.url}/deploy/ directory
  2. Then, JBoss performs the necessary steps to stop the application and unload its resources

Alternatively, applications can be deployed/undeployed/and re-deployed via jboss.system:service=MainDeployer JMX MBean (more on this later). This mechanism also support remote management of JBoss deployments

  1. Supports deployment dependencies
  2. Hot-deployment vs. cold-deployment

Archived components are uncompressed (a.k.a. exploded) under ${jboss.server.temp.dir}/deploy/

  1. JBoss deletes (or at least it is supposed to delete) ${jboss.server.temp.dir}/deploy/ deployments upon restart
  2. It is recommended to deploy applications already uncompressed (exploded) for to avoid the overhead of uncompression, and provide easy access to deployment descriptors and JSP files

Interested in mastering JBOSS?

Learn more about JBOSS Tutorial in this blog post.

The deployed components are automatically redeployed if their deployment descriptors are modified while JBoss AS is running

JBoss supports nested deployments (e.g. WAR under EAR) regardless of whether they are compressed into archives or deployed uncompressed

With clustering enabled, JBoss AS also supports farmed deployment - that is, pushing applications across the entire cluster when deployed on any single member of that cluster

JBoss supports JSR-88 (Java EE application deployment spec) but

There are no tools that make this kind of deployment easy - requires writing code

The resulting deployments go into the tmp/ directory - making redeployments harder

Deployers on JBoss AS

  1. JBoss has an extensible deployment architecture that allows components to be easily integrated into the core JBoss Microcontainer
  2. Deployers for: WARs, EARs, EJBs, JAR libraries, RARs, SARs, XML-based services, HARs, Aspects, Client, BeanShell scripts

The deployers are deployed themselves as *.deployer or *-deployer-beans.xml under ${jboss.server.home.url}/deployers/ directory

For indepth understanding on JBoss click on: