4 Replies Latest reply on Apr 14, 2010 8:35 AM by Mads Henderson

    JBPM 4.3 command line deployment of bar

    Mads Henderson Newbie

      I need to deploy my business processes from a command line tool, both for ease of development and also to satisfy my Hudson builds for various server environments. So far I have had no luck.

       

      I have tried to use the ant file from the examples, but I can't get that to work outside eclipse, all I get is:

       

      BUILD FAILED
      java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/
      w3c/dom/UserDataHandler;)Ljava/lang/Object;

       

      In the 'good old days' I could make a deployment with ant using

      org.jbpm.ant.DeployProcessToServerTask
      But that doesn't seem to be included any more.

      Can any one tell me the intended way to push updates to various servers (development, test, production) without doing it manually using eclipse.
        • 1. Re: JBPM 4.3 command line deployment of bar
          Maciej Swiderski Master

          Hi,

           

           

          you can still use Ant task for deployments just make sure you have correctly configured class path for it.

           

          I use that approach as well, not from Hudson though. Here are two targets that I have in my ant script:

           

          <target name="jbpm.libs.path">
               <path id="jbpm.libs.incl.dependencies">
                    <pathelement location="to-deploy-conf" />
                    <fileset dir="${jbpm.home}">
                         <include name="jbpm.jar" />
                    </fileset>
                    <fileset dir="${jbpm.home}/lib" />
               </path>
          </target>
          
          <target name="deploy" depends="jbpm.libs.path">
               <taskdef name="jbpm-deploy" classname="org.jbpm.pvm.internal.ant.JbpmDeployTask" classpathref="jbpm.libs.incl.dependencies" />
               <jbpm-deploy file="${dest.dir}/bar/${bar.name}" />
          </target>
          

          Make sure that jbpm configuration files are on your class path as well, in my example it is inside to-deploy-conf directory.

           

          Cheers

          Maciej

          • 2. Re: JBPM 4.3 command line deployment of bar
            HuiSheng Xu Master

            Hi Mads,

              I think you are using a wrong version of XML parser. I saw a AbstractMethodError in the exception stack trace. You should re-check your classpath and remove the unnecessary XML parsers, e.g. xersers.jar.

            • 3. Re: JBPM 4.3 command line deployment of bar
              Mads Henderson Newbie

              I realized that eclipse was bundled with a newer version of ant than the one in my command line path - upgrading ant and adding the cfg.xml files to classpath did the trick - thank you for the help.

              • 4. Re: JBPM 4.3 command line deployment of bar
                Mads Henderson Newbie

                Just in case others would like to use a simple ant target for deploying their processes, I have made a small project with only the jars needed for deployment included.

                 

                The ant target takes the bar file as an argument so you can run it like:

                ant -Dbar_file=./jbpm-4.3/examples/target/examples.bar

                The example is configured to run against postgresql with default port and user.