Hot Deploy Java code/ ATG components on JBoss

Pretty simple, on a production environment you start JBoss with its run file and a series of commands, which then picks up your EAR file from the deployment directory. Which...

Pretty simple, on a production environment you start JBoss with its run file and a series of commands, which then picks up your EAR file from the deployment directory. Which is a fine process to go through, but what if you’re developing code and you don’t want to wait the several minutes for a build and deployment – on a windows system this can take well over 20 minutes to achieve if you’re running things locally.

We want to do hot deployment so that when you make small changes in your java class/ ATG component you don’t have to rebuild and restart JBoss each time and you save yourself a lot of time.

We can do this by starting JBoss in the following way:

To avoid building an EAR file each time rather than using JBoss’s run file (/JBoss/bin/run.bat or run.sh) ATG provides a way to start JBoss and build the EAR on the fly from your working directory. This means that you can make changes to JSP’s etc… and see the changes instantly. To do this from your command prompt/shell go to your ATG home directory (/ATG/ATG22007.1/home/bin/) and in the bin run this file: StartDynamoOnJBoss.

In order for this to work and hot deployments to work we need to pass in a few parameters for this to work. Firstly the dynamo server to use – if you’re using one. Next set the name of the jBoss server using the -c flag. Then set the modules you want to load so your projects bin/ code source directory, ATG modules etc… and finally set the most important command -f -run-in-place which tells jBoss to compile and run the code from your projects directory rather than look for an EAR file in its deploy directory. So the start command looks like this:

startDynamoOnJBoss MY_DYNAMO_SERVER_NAME -c MY_JBOSS_SERVER_NAME -m MYPROJECT.core -f -run-in-place

And thats it. Now you can make changes to your files in Eclipse and you won’t need to restart jBoss. But there is one last thing – make sure to set your project in Eclipse to build automatically – you can set this under the project menu at the top.

This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.

Technorati Tags: , , , , , ,

  1. How to Setup Debugging in Eclipse for JBoss
  2. Setting Database Connections in JBoss/ ATG
  3. Running multiple instances of Jboss on one server.
  4. Adding and changing Mod JK JVM route, URI encoding and thread settings for JBoss
  5. Changing the HTTP port Oracle uses
  6. Setting the JDK version and compiler in JBoss for JSP pages
  7. Using Processing to Send Values using the Serial Port to Arduino