Java JBoss Geek Trick du jour

I'm doing a lot of work in JBoss, and one of the bugs I've run into is that if an applications initial deployment fails, JBoss refuses to un-deploy it. It throws this error when you try to redeploy the app (in this case, the app is called 'app1' and is deployed as an EAR file) :


23:19:23,054 ERROR [MainDeployer] Could not initialise deployment: file:/home/dbs/jboss/jboss-4.0.1sp1/server/default/deploy/app1.ear
org.jboss.deployment.DeploymentException: Error in accessing application metadata: ; - nested throwable: (javax.management.InstanceAlreadyExistsException: jboss.j2ee:service=EARDeployment,url='app1.ear' already registered.)

Sometimes restarting JBoss appserver from scratch will fix it, but only if you've remembered to delete the .ear file before restart.

JBoss comes with a great little tool called 'twiddle'. It sends commands via JMX right into the appserver. You can force an app to unregister right from the command line:

twiddle.sh unregister jboss.j2ee:service=EARDeployment,url='app1.ear'

Voila :)


Twitter

Sponsors!

About this Entry

This page contains a single entry by dbs published on June 10, 2005 11:26 PM.

5watt GMRS radios. Any opinions? was the previous entry in this blog.

It amazes me... is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.