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);

