1 Reply Latest reply on Oct 26, 2004 11:50 PM by Joan Horta Tosas

    build the ejb jar file

    a d Newbie

      hello ,

      I have got some difficulties in trying to build my ejb jar file
      I use ant and the ejbjar task provided with it
      but each time a build I have got the following error :

      C:\Java\Workspace\JFDF\com\iratensolutions\api\oriadeapi>ant
      Buildfile: build.xml

      clean:
      [delete] Deleting directory C:\Java\Workspace\JFDF\com\iratensolutions\api\or
      iadeapi\classes

      init:
      [mkdir] Created dir: C:\Java\Workspace\JFDF\com\iratensolutions\api\oriadeap
      i\classes

      compile:
      [javac] Compiling 10 source files to C:\Java\Workspace\JFDF\com\iratensoluti
      ons\api\oriadeapi\classes
      [javac] Compiling 1 source file to C:\Java\Workspace\JFDF\com\iratensolution
      s\api\oriadeapi\classes

      oriadeapijar:
      [ejbjar] Unable to locate jboss cmp descriptor. It was expected to be in C:\J
      ava\Workspace\JFDF\com\iratensolutions\api\oriadeapi\jaws.xml
      [ejbjar] building oriadeapi.jar with 12 files

      BUILD FAILED
      java.lang.NullPointerException
      at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.writ
      eJar(GenericDeploymentTool.java:788)
      at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.proc
      essDescriptor(GenericDeploymentTool.java:479)
      at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java
      :640)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
      at org.apache.tools.ant.Task.perform(Task.java:401)
      at org.apache.tools.ant.Target.execute(Target.java:338)
      at org.apache.tools.ant.Target.performTasks(Target.java:365)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
      at org.apache.tools.ant.Main.runBuild(Main.java:669)
      at org.apache.tools.ant.Main.startAnt(Main.java:220)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)

      Total time: 4 seconds
      java.lang.NullPointerException
      at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.writ
      eJar(GenericDeploymentTool.java:788)
      at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.proc
      essDescriptor(GenericDeploymentTool.java:479)
      at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java
      :640)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
      at org.apache.tools.ant.Task.perform(Task.java:401)
      at org.apache.tools.ant.Target.execute(Target.java:338)
      at org.apache.tools.ant.Target.performTasks(Target.java:365)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
      at org.apache.tools.ant.Main.runBuild(Main.java:669)
      at org.apache.tools.ant.Main.startAnt(Main.java:220)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)
      C:\Java\Workspace\JFDF\com\iratensolutions\api\oriadeapi>


      here is my build.xml
      <?xml version="1.0"?>
      <project name="Oriade EJB API with JBoss 4.0"
       default="install"
       basedir=".">
      
       <!-- build.properties hold the properties that can be customized -->
       <property file="build.properties" />
      
       <!-- some properties are build from environment variables -->
       <property environment="myenv"/>
       <property name="jboss.home" value="${myenv.JBOSS_HOME}" />
       <property name="classes.root" value="${myenv.CLASSES_ROOT}" />
       <property name="jboss.server.dir" value="${jboss.home}/server/default" />
       <property name="jboss.deploy.dir" value="${jboss.server.dir}/deploy" />
      
       <!-- Path used by ant -->
       <property name="src.dir" value=".." />
       <property name="classes.dir" value="./classes" />
       <property name="classes.dir" value="../classes" />
      
       <!-- All required path -->
       <property name="lib.dir" value="${jboss.server.dir}/lib" />
       <property name="verbose" value="true"/>
       <property name="root.dir" value="../../../.."/>
       <property name="apisrc.dir" value="${root.dir}/com/iratensolutions/api" />
      
       <property name="tools.user.dir" value="${root.dir}/com/iratensolutions/tools/user"></property>
      
       <!-- All required Jars -->
       <property name="jaxb-api.jar" value="${jonas.base}/lib/ext/jaxb-api.jar" />
       <property name="jaxb-impl.jar" value="${jonas.base}/lib/ext/jaxb-impl.jar" />
       <property name="namespace.jar" value="${jonas.base}/lib/ext/namespace.jar" />
       <property name="relaxngDatatype.jar" value="${jonas.base}/lib/ext/relaxngDatatype.jar" />
       <property name="xsdlib.jar" value="${jonas.base}/lib/ext/xsdlib.jar" />
       <property name="jdom1.jar" value="${jonas.base}/lib/ext/jdom1.jar" />
       <property name="struts.jar" value="../webGUI/WEB-INF/lib/struts.jar" />
       <property name="jakarta-oro-2.0.7.jar" value="${jonas.base}/lib/ext/jakarta-oro-2.0.7.jar" />
       <!--<property name="client.jar" value="${lib.dir}/client.jar" />-->
       <property name="quartz.jar" value="${jonas.base}/lib/ext/quartz.jar" />
       <property name="jboss-j2ee.jar" value="${lib.dir}/jboss-j2ee.jar" />
      
      
       <!-- The classpath to be used to compile -->
       <path id="base.classpath">
       <!-- General dir -->
       <pathelement location="${classes.dir}" />
       <pathelement location="${root.dir}" />
       <!-- Jaxb needed libs -->
       <pathelement location="${jaxb-api.jar}" />
       <pathelement location="${jaxb-impl.jar}" />
       <pathelement location="${jaxb-libs.jar}" />
       <pathelement location="${namespace.jar}" />
       <pathelement location="${relaxngDatatype.jar}" />
       <pathelement location="${xsdlib.jar}" />
       <!-- Jonas libs -->
       <pathelement location="${jboss-j2ee.jar}" />
       <!-- Tools libs -->
       <pathelement location="${jdom1.jar}" />
       <pathelement location="${struts.jar}" />
       <pathelement location="${jakarta-oro-2.0.7.jar}" />
       <pathelement location="${quartz.jar}" />
       </path>
      
       <!-- Use the DTD -->
       <target name="mydtd"
       description="rebuild ./build.dtd for DOCTYPE">
       <antstructure output="build.dtd"/>
       </target>
      
       <!-- Directories building -->
       <target name="init"
       depends="clean">
       <mkdir dir="${classes.dir}" />
       <copy todir="${jboss.deploy.dir}">
       <fileset dir="${src.dir}">
       <include name="*.jar" />
       </fileset>
       </copy>
       </target>
      
       <!-- Delete the generated directories -->
       <target name="clean"
       description="Removes all the generated files or directories">
       <delete dir="${classes.dir}" />
       </target>
      
       <!-- Compilation -->
       <target name="compile"
       description="Compile the Oriade classes"
       depends="init" >
       <javac srcdir="${apisrc.dir}"
       destdir="${classes.dir}" debug="on">
       <classpath refid="base.classpath" />
       </javac>
       <javac srcdir="${tools.user.dir}"
       destdir="${classes.dir}" debug="on">
       <classpath refid="base.classpath" />
       </javac>
       </target>
      <!-- Deploying ejbjars via ejbjar task -->
       <target name="oriadeapijar"
       description="Build and deploy the ejb-jars"
       depends="compile">
       <ejbjar naming="directory"
       srcdir="${classes.dir}"
       descriptordir="${src.dir}"
       dependency="full">
       <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
       location="${jboss.home}/docs/dtd/ejb-jar_2_0.dtd" />
       <jboss destdir="${src.dir}"
       suffix=".jar">
       </jboss>
       <include name="**/*.xml"/>
       <exclude name="**/jonas-*.xml"/>
       <exclude name="**/build.xml" />
       </ejbjar>
       </target>
      
      
       <!-- JAR file generation -->
       <target name="install"
       description="Build and install the ejb-jars"
       depends="oriadeapijar" >
       <!-- Copy ejbjars files in JBOSS -->
       <copy todir="${jboss.deploy.dir}">
       <fileset dir="${src.dir}">
       <include name="*.jar" />
       </fileset>
       </copy>
       </target>
      </project>
      
      


      the problem seems to come from the oriadeapijar target with the jboss ejbjar task but I can't figure it out alone
      if someone can help

      Thanks in advance