0 Replies Latest reply on Feb 18, 2009 10:52 AM by Arun Chandra Sekar

    Deploy remote files using HTTP protocol

    Arun Chandra Sekar Newbie

      In JBoss 4.x i was able to deploy my mbeans using jboss.system:service=MainDeployer's Deploy<java.net.URL> method. I will invoke this method with the url of my mbean - http://remotehost:port/file.sar and the mbean will be deployed in my jboss. However from JBoss 5 this is not working. It seems only file and vfsfile protocols are supported in MainDeployer's Deploy<java.net.URL> method and i am able to deploy that sar file if i place it in the jboss machine and mention the path as file:///c:/file.sar in this method.

      I tried to use the Deploy<org.jboss.deployment.DeploymentInfo> method but that failed. Below are the java codes i tried ( both the methods returned without any error but the remote sar file was not deployed in my jboss )

      DeploymentInfo deployInfo=new DeploymentInfo(new URL("http://remotehost:port/file.sar"), null, server); // Mbeanserver connection already present in variable server
      server.invoke(new ObjectName("jboss.system:service=MainDeployer"),"deploy",new Object[]{deployInfo},new String[]{"org.jboss.deployment.DeploymentInfo"});


      DeploymentInfo deployInfo=new DeploymentInfo(new URL("http://remotehost:port/file.sar"), null, server); // Mbeanserver connection already present in variable server
      MainDeployerMBean md = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(server, new ObjectName("jboss.system:service=MainDeployer"),MainDeployerMBean.class, false);
      md.deploy(deployInfo);


      Is there any configuration required or i am missing something here ?

      Thanks,
      Arun