ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Inskeep <>
Subject Re: Ant EjbJar task problem
Date Wed, 13 Dec 2000 23:16:10 GMT

As noted in another reply you DO want to exclude the *weblogic-ejb-jar.xml 
file. In addition I have only gotten this to work using the prefixed naming 
convention, where instead of ejb-jar.xml and weblogic-ejb-jar.xml you have 
beanjarname-ejb-jar.xml and beanjarname-weblogic-ejb-jar.xml. I've pasted 
my target for this below, you'll notice only one real difference between 
yours and mine, that's use of classpathref's instead of the classpath 
attribute, which only started working for me with builds after 11-20-2000. 
Contrary to another reply, I have had fine success with the nightly builds, 
I have not had to build ant from CVS source.

I think if you just follow the beanjarname- prefix naming convention it 
should work fine for you. If you don't want to use that naming convention, 
I think you can only have one set of xml descriptor files and have to set 
the basejarname attribute to <ejbjar>.

Good Luck,

<target name="ejbs" depends="compile">
     <mkdir dir="${ejbjar.jar.dir}" />
     <ejbjar srcdir="${build.dir}"
             descriptordir="${src.dir}" flatdestdir="true">
       <include name="**/*ejb-jar.xml"/>
       <exclude name="**/*weblogic-ejb-jar.xml"/>
       <exclude name="**/ejb-jar.xml"/>
       <weblogic destdir="${ejbjar.jar.dir}" >
         <classpath refid="classpath.ejb.ref" />

At 11:09 AM 12/13/00 +0100, you wrote:
>Hi All,
>I'm using Ant in a project for quite a while and we had developed our own
>EJBJAR task. I recently discovered that the Ant1.2 distribution contains an
>EJB task that does exactly what we need: thanks for the good work!
>Unfortunately I can't get it to work for our situation and I think i'm
>making a simple mistake somewhere. Could you take a look at the following?
>The target I use in the Ant build xml file is as follows:
>   <target name="ejbc" depends="compile">
>     <mkdir dir="${ejblib.dir}"/>
>     <ejbjar srcdir="${classes.dir}" descriptordir="${src.dir}" >
>       <weblogic destdir="${ejblib.dir}" classpath="${java.class.path}" />
>       <include name="**/ejb-jar.xml"/>
>       <exclude name="**/weblogic*.xml"/>
>     </ejbjar>
>   </target>
>The classfiles of the ejbs are in the ejblib.dir subdirectories and the
>describtors in the src.dir subdirectories. When I run ant I get the
>following output:
>    [ejbjar] deleting generic jar
>    [ejbjar] descriptorFileName:
>    [ejbjar] File.separator: \
>    [ejbjar] baseNameTerminator: -
>    [ejbjar] usingBaseJarName(): false
>    [ejbjar] baseName: com\cgeyc\banking\bfl\icp\ems\corporation\ejb
>    [ejbjar] getBaseNameTerminator(): -
>    [ejbjar] ddPrefix: com\cgeyc\banking\bfl\icp\ems\corporation\ejb-
>    [ejbjar] WL_DD: weblogic-ejb-jar.xml
>    [ejbjar] Checking for file:
>    [ejbjar] building ejb.jar with 4 files
>    [ejbjar] adding file
>    [ejbjar] adding file 'META-INF/ejb-jar.xml'
>    [ejbjar] adding file
>    [ejbjar] adding file
>    [ejbjar] Calling weblogic.ejbc for
>      [java] Forking java -classpath
>~1\lib\jaxp.jar;D:\java\junit\junit3.2\junit.jar weblogic.ejbc -noexit
>      [java] weblogic.utils.compiler.ToolFailureException: ERROR:
>r.xml was not found in the jar file.
>      [java]     at weblogic.ejbc.runBody(, Compiled Code)
>      [java]     at
>      [java]     at weblogic.ejbc.main(
>      [java] Java Result: 1
>Note: I added some extra log messages to the WebLogicDeploymentTools class.
>It reports that the weblogic-ejb-jar.xml file is not included in the generic
>jar file. I checked the generic jar file, and it is not included.
>The directory containing the descriptor files looks like this (all other ejb
>directories are similar):
>  Directory of
>09/29/2000  15:03       <DIR>          .
>09/29/2000  15:03       <DIR>          ..
>09/29/2000  13:50                  672
>09/29/2000  11:55                1,712
>09/29/2000  11:55                  606
>09/29/2000  15:10                1,169 ejb-jar.xml
>12/08/2000  10:19                  612 weblogic-ejb-jar.xml
>                5 File(s)          4,771 bytes
>                2 Dir(s)     973,287,424 bytes free
>However, I can't get the EjbJar task to include weblogic-ejb-jar.xml. I
>tried several combinations of in/exclude tags bu nothing seems to work.
>Do you have any idea what I'm doing wrong? Any help is greatly appreciated.
>Gero Vermaas

View raw message