How to deploy exploded archives JBoss EAP 6

This is a how to deploy an archive in an exploded format in either standalone or domain mode, albeit I am only going to show standalone.

Deploy application
This is the process to deploy an exploded archive

Build Archive

I will not go through the mechanics of creating an archive, but for my quick how to I used the helloworld war example from

  1. Archive Name: jboss-helloworld.war
  2. Create exploded archive
$ cd jboss-helloworld.war/
  1. Extract archive into directory
$ jar -xvf ~/projects/community/jboss-as-quickstart/helloworld/target/jboss-helloworld.war
  1. Copy base configuration Good practice for testing
$ cd /../jboss-eap-6.1
$ cp ./standalone/configuration/standalone.xml ./standalone/configuration/exploded_test.xml
  1. Start EAP
[jboss-eap-6.1]$ ./bin/ -c exploded_test.xml
Deploy Archive
[jboss-eap-6.1]$ cp -r /workspace/exploded_archives/jboss-helloworld.war/ ./standalone/deployments/
  1. Review output The application should have deployed correctly and to verify review output.
11:44:47,471 INFO  [] (DeploymentScanner-threads - 2) JBAS015003: Found jboss-helloworld.war in deployment directory. To trigger deployment create a file called jboss-helloworld.war.dodeploy
Take notice how nothing was actually deployed when an exploded archive is copied into the deployments folder
Create dodeploy file

Basically we need to tell the server to explode a particular archive and the way we do this is creating a dodeploy for a particular archive, otherwise EAP will keep a reference to the archive as <archive-name>.<archive-extension> under the deployments folder.

$ touch ./standalone/deployments/jboss-helloworld.war.dodeploy
  1. Review output
11:47:27,525 INFO  [] (MSC service thread 1-3) JBAS015876: Starting deployment of "jboss-helloworld.war" (runtime-name: "jboss-helloworld.war")
11:47:27,560 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment jboss-helloworld.war
11:47:27,571 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016005: Starting Services for CDI deployment: jboss-helloworld.war
11:47:27,582 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment jboss-helloworld.war
11:47:27,635 INFO  [org.jboss.web] (ServerService Thread Pool -- 75) JBAS018210: Register web context: /jboss-helloworld
11:47:27,719 INFO  [] (DeploymentScanner-threads - 1) JBAS018559: Deployed "jboss-helloworld.war" (runtime-name : "jboss-helloworld.war")
Verify exploded archive
[jboss-eap-6.1]$ tree standalone/deployments/
├── jboss-helloworld.war
│   ├── index.html
│   ├── META-INF
│   │   ├── MANIFEST.MF
│   │   └── maven
│   │       └── org.jboss.quickstarts.eap
│   │           └── jboss-helloworld
│   │               ├──
│   │               └── pom.xml
│   └── WEB-INF
│       ├── beans.xml
│       └── classes
│           └── org
│               └── jboss
│                   └── as
│                       └── quickstarts
│                           └── helloworld
│                               ├── HelloService.class
│                               └── HelloWorldServlet.class
├── jboss-helloworld.war.deployed
└── README.txt

12 directories, 9 files
if the archive is updated the .dodeploy also needs to have an updated time stamp. The easiest way is to simply retouch the file *touch .dodeploy*

Author: jasonmarley

I have been with Red Hat since 2010 and love it! My day to day is consulting on RHEL/JBoss/OpenShift, but I work on open source projects in my free time. The best part about my job are my awesome colleagues and our community.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s