-
1. Re: Deploying applications programmatically
jaikiran Feb 27, 2008 3:42 AM (in response to gav_on_rails)There's a MBean named MainDeployer which you could use to deploy the applications programatically. Access you jmx-console (http://localhost:8080/jmx-console) and on that page look for service=MainDeployer under the jboss.system domain. If you click on that link you will be forwarded to a page which shows you all the available APIs (one of which is the deploy method) on this MBean. The JBossJMX FAQ at http://wiki.jboss.org/wiki/Wiki.jsp?page=FAQJBossJMX will help you in using the MBean programatically.
-
2. Re: Deploying applications programmatically
gav_on_rails Feb 27, 2008 6:18 AM (in response to gav_on_rails)Thanks for your reply! Following your advice I have now successfully deployed a jar and custom archive using the MainDeployer and a custom deployer. For anyone interested here is a code snippet demonstrating looking up the MainDeployer mbean and using this to deploy an archive:
ObjectName objectName = new ObjectName("jboss.system:service=MainDeployer"); MBeanServer server = MBeanServerLocator.locateJBoss(); MainDeployerMBean deployerMBean = (MainDeployerMBean)MBeanServerInvocationHandler.newProxyInstance( server, objectName, MainDeployerMBean.class, false); deployerMBean.deploy("file://C:/archives/myArchive.jar");