Unable to 'UNDEPLOY' application in JBOSS through code.

Hi,

I'm developing "JMX Server Console" Application in which I'm connecting to Appln. Server JBoss. Here i'm trying to get the statistics of Application deployed on it (JBoss) as well as trying to deploy,undeploy and redeploy application through code, etc.

I'm getting the exception, when i try toUndeploy Appln. through code. The Exception isjava.net.MalformedURLException , i think the application name that i'm giving is not correct. so could anyone plz tell me how to overcome this exception.

here is the following code:

//for connecting to JBoss...

MBeanServerConnection mBeanServerConn=(MBeanServerConnection)new InitialContext().lookup("jmx/rmi/RMIAdaptor");

//for getting the ObjectName of 'MainDeployer' MBean...

MBeanInfo beanInfo=mBeanServerConn.getMBeanInfo("jboss.system:service=MainDeployer");

//for deploying application...its working fine and myServlet.war is getting deployed..

Object arguments[]={"\\D:\\jboss examples\\myServlet\\myServlet.war"};

String signatures[]={"java.lang.String"};

mBeanServerConn.invoke("deploy",arguments,signatures);

//for undeploying application...here its giving java.net.MalformedURLException..

Object arguments[]={"myServlet.war"};

String signatures[]={"java.lang.String"};

mBeanServerConn.invoke("undeploy",arguments,signatures);

[1407 byte] By [Jay.Jambaa] at [2007-11-27 4:48:49]
# 1
write this :- "file://myServlet.war"always append "file:// to the begining of it :)P.S. Hi Jay... Parth Here, friend of Himanshu Patel... How is Munal and Nitesh and Jalpesh doing at Impetus.... tell them parth was remembering them :)
AUTOMATONa at 2007-7-12 10:01:48 > top of Java-index,Core,Monitoring & Management...
# 2

Hie Parth,

Thanks for replying...

The operation was invoked but it didn't actually undeployed the application. By giving file://myServlet.war it solved the exception called MalFormedURLException but it didn't undeployed the application from jboss..

plzz reply as soon as possible..

Jay.Jambaa at 2007-7-12 10:01:48 > top of Java-index,Core,Monitoring & Management...