3 Replies Latest reply on Jan 6, 2005 11:41 AM by starksm64

    How to deploy programmatically in JBoss 4.0.1

      Hi,

      JBoss 3.2.x used to have this nice Class RemoteDeployer that you could use to deploy something in a running JBoss. This class has obviously been removed in JBoss 4.0.1. Does anybody know how I can deploy something without copying it to the deploy directory?

      Thanks

      Michael

        • 1. Re: How to deploy programmatically in JBoss 4.0.1
          starksm64

          Use the RMIAdaptor to talk to the MainDeployer. This is what the testsuite does. See the org.jboss.test.JBossTestServices class from the testsuite module of the source download on online cvs on sourceforge.

          • 2. Re: How to deploy programmatically in JBoss 4.0.1

            Just in case anybody else is searching: here is what you have to do in a build.xml:

             <taskdef name="jboss-jmx" classname="org.jboss.ant.JMX">
             <classpath>
             <fileset dir="${jboss.home}/client" includes="*.jar"/>
             </classpath>
             </taskdef>
            
             <target name="deploy" depends="setup">
             <!-- Need absolute file name! -->
             <property name="ear-file" location="${jboss-ear}"/>
             <jboss-jmx adapterName="jmx/invoker/RMIAdaptor">
             <invoke target="jboss.system:service=MainDeployer" operation="deploy">
             <parameter type="java.lang.String" arg="file:${ear-file}"/>
             </invoke>
             </jboss-jmx>
             </target>
            



            • 3. Re: How to deploy programmatically in JBoss 4.0.1
              starksm64

              You should also be able to use the twiddle.sh/bat invoke command to do this without ant.