0 Replies Latest reply on Aug 10, 2004 8:56 AM by ppaulakh

    JBoss 3.23 CMP and ant ejbjar task

    ppaulakh Newbie

      I am getting a Nullpointer exception when I try to use the ant ejbjar task on a CMP 2.0 bean. I've included the relevant parts of the code. I've never used the ejb-jar task before, I've always used the jar task. It seems that the jbosscmp-jdbc.xml is getting linked in just fine, but it is dying on the parsing due to the DTD. It is well-formed XML, I included it but snipped the cmp fields for clarity.
      I'm trying to use the generic task that builds all our session EJBs. Thanks for any help,
      -P

      Ant build script

      <target name="ejbs" depends="prepareclient,jarimages,compile,checkejbs"
       unless="ejbs.notRequired"
       description="builds ejb jar files">
       <ejbjar srcdir="${build.home}"
       descriptordir="src"
       destdir="${ejb.home}"
       naming="ejb-name"
       dependency="full"
       cmpversion="2.0"
       flatdestdir="true">
       <jboss destdir="${ejb.home}"
       genericjarsuffix="Bean.jar"/>
       <include name="**/ejb-jar.xml"/>
       <include name="**/jbosscmp-jar.xml"/>
       <include name="**/jbosscmp-jdbc.xml"/>
       <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" location="src/config/ejb-jar_2_0.dtd"/>
       <dtd publicId="-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN" location="src/config/jbosscmp-jdbc_3_0.dtd"/>
       </ejbjar>
       </target>


      jbosscmp-jdbc.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE jbosscmp-jdbc PUBLIC
       "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
       "file:../../config/jbosscmp-jdbc_3_0.dtd">
      
      
      <jbosscmp-jdbc>
       <defaults>
       <datasource>OpenDS</datasource>
       <datasource-mapping>Oracle</datasource-mapping>
       <create-table>false</create-table>
       <remove-table>false</remove-table>
       <pk-constraint>true</pk-constraint>
       <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
       </defaults>
       <enterprise-beans>
      
      <!-- start of cmp bean-->
      
       <entity>
       <ejb-name>TestConfiguration</ejb-name>
       <create-table>false</create-table>
       <remove-table>false</remove-table>
       <table-name>config_table</table-name>
      <!--... irrelevant cmp fields -->
       <!--//end cmp bean-->
       </entity>
       </enterprise-beans>
       <dependent-value-classes>
       </dependent-value-classes>
      </jbosscmp-jdbc>
      

      Exception generated
      using ant -debug

      [ejbjar] Mapped publicId -//JBoss//DTD JBOSSCMP-JDBC 3.0//EN to file src\conf
      ig\jbosscmp-jdbc_3_0.dtd
       [ejbjar] Mapped publicId -//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
      2.0//EN to file src\config\ejb-jar_2_0.dtd
       [ejbjar] Resolved -//JBoss//DTD JBOSSCMP-JDBC 3.0//EN to local file src\confi
      g\jbosscmp-jdbc_3_0.dtd
      
      BUILD FAILED
      W:\Projects\ADIMSS\cm\psl\iw\java\build.xml:610: java.lang.NullPointerException
       at org.apache.tools.ant.Task.perform(Task.java:373)
       at org.apache.tools.ant.Target.execute(Target.java:341)
       at org.apache.tools.ant.Target.performTasks(Target.java:369)
       at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
       at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
       at org.apache.tools.ant.Main.runBuild(Main.java:673)
       at org.apache.tools.ant.Main.startAnt(Main.java:188)
       at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
       at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
      Caused by: java.lang.NullPointerException
       at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.proc
      essDescriptor(GenericDeploymentTool.java:416)
       at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java
      :600)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       ... 8 more
      --- Nested Exception ---
      java.lang.NullPointerException
       at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.proc
      essDescriptor(GenericDeploymentTool.java:416)
       at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java
      :600)
       at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
       at org.apache.tools.ant.Task.perform(Task.java:364)
       at org.apache.tools.ant.Target.execute(Target.java:341)
       at org.apache.tools.ant.Target.performTasks(Target.java:369)
       at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
       at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
       at org.apache.tools.ant.Main.runBuild(Main.java:673)
       at org.apache.tools.ant.Main.startAnt(Main.java:188)
       at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
       at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)