Adam Bien's Weblog

Wednesday Sep 27, 2006

Real Time deployment monitoring with glassfish

In the past I used the autodeployment feature heavily with JBoss and WLS in the development phase.
Autodeployment means: the application server scans a defined folder for new deployment artifacts every couple of seconds.
In case the content of the folder changes, the application server redeploys the whole application (=changed ear or ejb-jar).
The problem here: you have to wait a couple of seconds until the application is available for testing.
You can, of course, hit the reload button every couple of seconds. I tried something different with glassfish,
which works well for me. I use JConsole (a part of Java SE 5) to monitor the deployment state and success in real time.
To achieve this, you need only the serviceurl, which is suggested by the glassfish in the boot phase.
In my case the url is: service:jmx:rmi:///jndi/rmi://merlin:8686/jmxrmi. merlin is the name of my machine,
so you have only to replace it. In the MBean tab you find the StatelessSessionBean folder, which is synchronized in real time
with the deployment progress.

You can also watch the screencast to see how it looks like.

Regardless how well it works, you should not always trust it. Redeployment relies on unloading and loading classes dynamically,
which is not trivial. So if the structure of the application (EJB3) changes significantly,
I would restart the server and not rely on autodeployment features.


[my tweets]  Rss My book: Real World Java EE - Rethinking Best Practices

Kommentare:

Depending on what you change you can even have remote debugging and make use of the hot code replacment to instantly see the effect of changes without any redeployment. Beware: Do not confuse hot deployment (app-server feature) with hot code replacement (JVM feature). Also be aware, that a server restart or a hot deployment most likely undos your hot code replacments.

Gesendet von Tobias am September 27, 2006 at 03:19 PM CEST #

Hi Tobias,

I do not confused both. I even didn't mentioned the code replacement capabilities. I only explained here the JMX monitoring - nothing else.

Gesendet von Adam Bien am September 27, 2006 at 08:40 PM CEST #

Senden Sie einen Kommentar:
  • HTML Syntax: Ausgeschaltet
Meta-stuff / Interviews
My Recent Book
Java One 2009
CommunityOne East N.Y.C
JavaONE 2008 Interview
Search
...the last 150 posts
...the last 10 comments
greenfire.dev.java.net
Links
my.netbeans.org
Visitors
License