1 Reply Latest reply on May 22, 2013 1:01 AM by nchennareddy

    Facing issues while launching Jboss AS7 using ant script

    nchennareddy

      I downloaded AS7 and configured standalone.xml file accordingly. I am trying to launch Jboss

      using ant script.

       

      <target name="launch-jboss" description="launching jboss">

           <fail message="ERROR: 'jboss.maxmemory' property not set." unless="jboss.maxmemory" />

           <echo>starting jboss... MAXMEMORY is ${jboss.maxmemory}</echo>

           <java jar="${jboss.dir}\jboss-modules.jar" fork="true" failonerror="true" maxmemory="${jboss.maxmemory}">

                <jvmarg value="${jboss.dir}\modules"/>

                <jvmarg value="javax.xml.jaxp-provider"/>

                <jvmarg value="org.jboss.as.standalone"/>

                <jvmarg value="-Djboss.home.dir=${jboss.dir}"/>

                <jvmarg value="-Dorg.jboss.boot.log.file=${jboss.dir}\standalone\log\server.log"/>

                <jvmarg value=" Dlogging.configuration=file:${jboss.dir}\standalone\configuration\logging.properties"/>

            </java>

      </target>

       

      In the above block ${jboss.dir} variable refers to location of jboss root folder.

       

      When I launch the ant target using batch script I am getting following exception

       

      java.lang.NoClassDefFoundError: C:\jboss\modules

      [java] Caused by: java.lang.ClassNotFoundException: C:\jboss\modules

      [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

      [java] at java.security.AccessController.doPrivileged(Native Method)

      [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

      [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

      [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

      [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

      [java] Could not find the main class: C:\Portware\modules. Program will exit.

      [java] Exception in thread "main"

       

      I commented out <jvmarg value="${jboss.dir}\modules"/> and executed the ant target.

      I got the following exception.

      [java] java.lang.NoClassDefFoundError: javax/xml/jaxp-provider

      [java] Caused by: java.lang.ClassNotFoundException: javax.xml.jaxp-provider

      [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

      [java] at java.security.AccessController.doPrivileged(Native Method)

      [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

      [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

      [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

      [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

      [java] Could not find the main class: javax.xml.jaxp-provider. Program will exit.

      [java] Exception in thread "main"

       

      Clearly I am missing something. Can you tell me If I have to add anything to class path or if I am missing something here. Any help would be really appreciated

       

      -Narendra

        • 1. Re: Facing issues while launching Jboss AS7 using ant script
          nchennareddy

          okay I was able to fix the above problem. I missed few arguments "-mp" and "-jaxpmodule" and also these are arguments not jvmarg. Modifying ant task to do the following  fixed the issue.

           

           

          <java jar="${jboss.dir}\jboss-modules.jar" fork="true" failonerror="true" maxmemory="${jboss.maxmemory}">

             <jvmarg value="-Dorg.jboss.boot.log.file=${jboss.dir}\standalone\log\server.log"/>

             <jvmarg value="-Dlogging.configuration=file:${jboss.dir}\standalone\configuration\logging.properties"/>

             <arg value="-mp"/>

             <arg value="${jboss.dir}\modules"/>

             <arg value="-jaxpmodule"/>

             <arg value="javax.xml.jaxp-provider"/>

             <arg value="org.jboss.as.standalone"/>

             <arg value="-Djboss.home.dir=${jboss.dir}"/>

          </java>