ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Ammons <>
Subject RE: Ant EjbJar task problem
Date Wed, 13 Dec 2000 20:24:44 GMT
Believe it or not, you DO want to exclude the file...

There are really two things happening: 1) EJBJAR is packing up the 
*generic* jar file and 2) A sub-task is doing all the Weblogic specific 
stuff. The exclude file is telling EJBJAR not to mistake the weblogic xml 
file for an ejb-jar.xml file and try to make a separate bean out of it.

I've spent the last few days banging my head on the rock of EJBJAR and have 
FINALLY gotten it working after much code reading and debugging (go open 

Two notes:

1) Download the latest CVS code and compile it (using ant, naturally). I 
could never get the released code to work.
2) If you have any container managed persistence entity beans, you will 
want to flatten your directories before you start EJBJAR.

What I do is copy all my xml files to the same directory using the copy 
task with flatten="yes". This of course assumes that you are using the 
naming convention for your XML files and letting EJBJAR scan through them 
(see the /ant/docs/ejb.html file for more info). If you don't flatten the 
directories, then EJBJAR can't find the *-weblogic-cmp-rdbms-ejb-jar.xml 
file (or whatever you call it in your *-weblogic-ejb-jar.xml file's 
<type-storage> element).

Hope this helps,

At 11:20 AM 12/13/00 -0800, you wrote:
>         Two things I noticed here.
>1.  The error seems to be that you're missing weblogic-ejb-jar.xml in your
>jar file.
>2.  One of the lines of your build is the following:
>         <exclude name="**/weblogic*.xml"/>
>3.  The string "weblogic-ejb-jar.xml" matches your exclude pattern.
>I bet if you remove that line, and change
><include name="**/ejb-jar.xml"/>
><include name="**/*ejb-jar.xml"/>
>it will probably work.
>-----Original Message-----
>From: Gero Vermaas []
>Sent: Wednesday, December 13, 2000 2:09 AM
>Subject: Ant EjbJar task problem
>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