> -----Original Message-----
> From: Mikael Hansen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 08, 2002 5:34 AM
> To: Ant Users List
> Subject: Strange build error from ejbjar task
> 
> 
> Hi
> 
> I have a target like this:
> 
> <target name="beans-jboss" depends="xdoclet-generate">
>       <javac srcdir="src/ejb/src">
>       </javac>
>       <ejbjar descriptordir="src/ejb/descriptor" srcdir="src/ejb/src"
>               destdir="src/ejb/deploy" naming="ejb-name"
>               flatdestdir="true">
>               <jboss destdir="${jboss.deploy}/"/>
>               <include name="**/jboss.xml"/>
>               <include name="**/ejb-jar.xml"/>
>               <dtd publicId="-//JBoss//DTD JBOSS//EN" 
> location="http://localhost/DTD/jboss.dtd"/>
>               <dtd publicId="-//Sun Microsystems, Inc.//DTD 
> Enterprise JavaBeans 2.0//EN" 
> location="http://localhost/DTD/ejb-jar_2_0.dtd"/>
>       </ejbjar>
> </target>
> 
> The xdoclet-generate target generates deployment descriptors 
> (jboss.xml
> and ejb-jar.xml) as well as the home and remote interface 
> java files from
> the bean implementation using Xdoclet.
> 
> When I run this task I get the following error, but the 
> strange thing is
> that the jar file is created, named correctly, and deployed 
> succesfully.
> Why does this error appear?
> 
> beans-jboss:
> 
> BUILD FAILED
> java.lang.NullPointerException
>         at
> org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTo
> ol.processDescriptor(GenericDeploymentTool.java:453)
>         at
> org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJ
> ar.java:592)
>         at org.apache.tools.ant.Task.perform(Task.java:319)
>         at org.apache.tools.ant.Target.execute(Target.java:309)
>         at org.apache.tools.ant.Target.performTasks(Target.java:336)
>         at 
> org.apache.tools.ant.Project.executeTarget(Project.java:1306)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1250)
>         at org.apache.tools.ant.Main.runBuild(Main.java:610)
>         at org.apache.tools.ant.Main.start(Main.java:196)
>         at org.apache.tools.ant.Main.main(Main.java:235)
> 
> Total time: 13 seconds
> java.lang.NullPointerException
>         at
> org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTo
> ol.processDescriptor(GenericDeploymentTool.java:453)
>         at
> org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJ
> ar.java:592)
>         at org.apache.tools.ant.Task.perform(Task.java:319)
>         at org.apache.tools.ant.Target.execute(Target.java:309)
>         at org.apache.tools.ant.Target.performTasks(Target.java:336)
>         at 
> org.apache.tools.ant.Project.executeTarget(Project.java:1306)
>         at 
> org.apache.tools.ant.Project.executeTargets(Project.java:1250)
>         at org.apache.tools.ant.Main.runBuild(Main.java:610)
>         at org.apache.tools.ant.Main.start(Main.java:196)
>         at org.apache.tools.ant.Main.main(Main.java:235)
> 
> 
> Using the verbose or debug option to ant shows nothing more than the
> above.
> 
> Any help is greatly appreciated.
> 
> Best regards
>       Mikael M. Hansen
> 
> 

Try changing it to be:

<ejbjar descriptordir="src/ejb/descriptor"
        srcdir="src/ejb/src"
        destdir="src/ejb/deploy"
        naming="ejb-name"
        flatdestdir="true">
  <include name="**/ejb-jar.xml" />
  <exclude name="**/*jboss.xml />
  <jboss destdir="${jboss.deploy}/"/>
    <dtd publicId="-//JBoss//DTD JBOSS//EN"
         location="http://localhost/DTD/jboss.dtd"/>
    <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" 
         location="http://localhost/DTD/ejb-jar_2_0.dtd"/>
</ejbjar>

I had the same problem (with WebLogic) until I excluded all the other descriptor files.

/mike

Reply via email to