ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Flemetakis" <cflem...@hotmail.com>
Subject Re: ejbjar and weblogic element error help
Date Thu, 23 Aug 2001 20:05:25 GMT
You need to rename your descriptors in order for Ant to properly build the 
bean...

The way it works is as follows (I'll show you by example)

If your descriptors are named like this:

AuthorizationEJB-ejb-jar.xml
AuthorizationEJB-weblogic-ejb-jar.xml
ExampleBean-ejb-jar.xml
ExampleBean-weblogic-ejb-jar.xml

Then ant will create a jar file named AuthorizationEJB.jar and another one 
named ExampleBean.jar .. inside the archive the descriptors will be named 
ejb-jar.xml and weblogic-ejb-jar.xml as usual.

So for every bean you should have a pair of descriptors where the beginning 
part is unique. Ant uses that first string before the first dash to name the 
resulting ejb and renames the descriptors to their proper name before 
including them in the jar file.

The advantage is that you can add more ejb's to your beans just by adding 
more descriptors to you src directory and a single task will always handle 
it.

Based on what I said, by not renaming the descriptors you noticed that Ant 
was trying to create a jar file named ejb.jar (based on the naming of 
ejb-jar.xml) but it was not finding it's expected pair descriptor 
ejb-weblogic-ejb-jar.xml..


>From: "T Master" <tmaster@iknowledgeinc.com>
>Reply-To: ant-user@jakarta.apache.org
>To: "ant user mailist" <ant-user@jakarta.apache.org>
>Subject: ejbjar and weblogic element error help
>Date: Thu, 23 Aug 2001 11:27:50 -0600
>
>This is my first time using this task.
>It is apparently looking for a wenlogic deployment descriptor called:
>     ejb-weblogic-ejb-jar.xml
>This is the wrong name.
>
><ejbjar descriptordir="${src.dir}/com/iknowledge/inext/server/ejb"
>                 srcdir="${src.dir}/com/iknowledge/inext/server/ejb">
>             <!--support dir="${build.classes.server}">
>                 <include name="**/*.class"/>
>             </support-->
>             <include name="**/ejb-jar.xml"/>
>             <include name="**/weblogic-ejb-jar.xml"/><!-- was exclude
>weblogic-ejb-jar.xml in example -->
>             <weblogic destdir="${deployment.dir}"
>                      keepgeneric="false"
>                      suffix=".jar"
>                      rebuild="false">
>                 <classpath>
>                     <pathelement path="${build.dir}"/>
>                 </classpath>
>                 <wlclasspath>
>                     <pathelement path="${weblogic.classes}"/>
>                 </wlclasspath>
>             </weblogic>
>             <dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise
>JavaBeans 1.1//EN"
>                  location="${buildfile.dir}/xml/ejb-jar_2_0.dtd"/>
>             <dtd publicId="-//BEA Systems, Inc.//DTD WebLogic 5.1.0 
>EJB//EN"
>                  location="${buildfile.dir}/xml/weblogic-ejb-jar.dtd"/>
>         </ejbjar>
>
>
>
>init:
>
>jarAppServer:
>
>init:
>
>compileResource:
>
>compileProject:
>     [javac] Compiling 1 source file to
>C:\dev\iknowledge\V2.0\iNEXT\java\class
>
>jarProject:
>    [ejbjar] Could not resolve ( publicId: -//Sun Microsystems, Inc.//DTD
>Enterpr
>ise JavaBeans 2.0//EN, systemId: http://java.sun.com/dtd/ejb-jar_2_0.dtd) 
>to
>a l
>ocal entity
>    [ejbjar] Unable to locate weblogic deployment descriptor. It was 
>expected
>to
>be in
>C:\dev\iknowledge\V2.0\iNEXT\java\src\com\iknowledge\inext\server\ejb\ejb-
>weblogic-ejb-jar.xml
>    [ejbjar] building ejb.jar with 7 files
>    [ejbjar] WARNING: IOException while adding entry
>com\iknowledge\inext\server\
>ejb\SystemObjectTypeHome.class to jarfile from
>C:\dev\iknowledge\V2.0\iNEXT\java
>\src\com\iknowledge\inext\server\ejb\com\iknowledge\inext\server\ejb\SystemO
>bjec
>tTypeHome.class
>java.io.FileNotFoundException-C:\dev\iknowledge\V2.0\iNEXT\java\
>src\com\iknowledge\inext\server\ejb\com\iknowledge\inext\server\ejb\SystemOb
>ject
>TypeHome.class (The system cannot find the path specified)
>
>BUILD FAILED
>
>java.lang.NullPointerException
>         at
>org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.writ
>eJar(GenericDeploymentTool.java, Compiled Code)
>         at
>org.apache.tools.ant.taskdefs.optional.ejb.WeblogicDeploymentTool.wri
>teJar(WeblogicDeploymentTool.java:477)
>         at
>org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.proc
>essDescriptor(GenericDeploymentTool.java:358)
>         at
>org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java
>, Compiled Code)
>         at org.apache.tools.ant.Task.perform(Task.java:217)
>         at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
>         at org.apache.tools.ant.Target.performTasks(Target.java:182)
>         at org.apache.tools.ant.Project.executeTarget(Project.java, 
>Compiled
>Cod
>e)
>         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java, Compiled
>Code)
>         at org.apache.tools.ant.Task.perform(Task.java:217)
>         at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
>         at org.apache.tools.ant.Target.performTasks(Target.java:182)
>         at org.apache.tools.ant.Project.executeTarget(Project.java, 
>Compiled
>Cod
>e)
>         at org.apache.tools.ant.Project.executeTargets(Project.java,
>Compiled Co
>de)
>         at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
>         at org.apache.tools.ant.Main.start(Main.java, Compiled Code)
>         at org.apache.tools.ant.Main.main(Main.java:176)
>
>Total time: 4 seconds
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


Mime
View raw message