ant-user mailing list archives

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

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,
Dave

<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" />
       </weblogic>
     </ejbjar>
   </target>

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
>D:\usr\DemoDevEnv\build\ejblib\com\cgeyc\bankin
>g\bfl\icp\ems\accountgroup\ejb-generic.jar
>    [ejbjar] descriptorFileName:
>com\cgeyc\banking\bfl\icp\ems\corporation\ejb-ja
>r.xml
>    [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:
>D:\usr\DemoDevEnv\src\com\cgeyc\banking\bfl\icp\e
>ms\corporation\ejb-weblogic-ejb-jar.xml
>    [ejbjar] building ejb.jar with 4 files
>    [ejbjar] adding file
>'com\cgeyc\banking\bfl\icp\ems\corporation\CorporationBe
>an.class'
>    [ejbjar] adding file 'META-INF/ejb-jar.xml'
>    [ejbjar] adding file
>'com\cgeyc\banking\bfl\icp\ems\corporation\CorporationHo
>me.class'
>    [ejbjar] adding file
>'com\cgeyc\banking\bfl\icp\ems\corporation\Corporation.c
>lass'
>    [ejbjar] Calling weblogic.ejbc for
>D:\usr\DemoDevEnv\build\ejblib\com\cgeyc\b
>anking\bfl\icp\ems\corporation\ejb-generic.jar
>      [java] Forking java -classpath
>D:\weblogic\lib\weblogic510sp5boot.jar;D:\we
>blogic\lib\weblogic510sp5.jar;D:\weblogic\license;D:\weblogic\lib\weblogicau
>x.ja
>r;D:\weblogic\classes;D:\usr\DemoDevEnv\build\classes;D:\java\jdk1.2.2\lib\t
>ools
>.jar;D:\java\jakart~1\lib\ant.jar;D:\java\jakart~1\lib\parser.jar;D:\java\ja
>kart
>~1\lib\jaxp.jar;D:\java\junit\junit3.2\junit.jar weblogic.ejbc -noexit
>D:\usr\De
>moDevEnv\build\ejblib\com\cgeyc\banking\bfl\icp\ems\corporation\ejb-generic.
>jar
>D:\usr\DemoDevEnv\build\ejblib\com\cgeyc\banking\bfl\icp\ems\corporation\ejb
>.jar
>
>      [java] weblogic.utils.compiler.ToolFailureException: ERROR:
>weblogic-ejb-ja
>r.xml was not found in the jar file.
>      [java]     at weblogic.ejbc.runBody(ejbc.java, Compiled Code)
>      [java]     at weblogic.utils.compiler.Tool.run(Tool.java:80)
>      [java]     at weblogic.ejbc.main(ejbc.java:365)
>      [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
>D:\Usr\DemoDevEnv\src\com\cgeyc\banking\bfl\icp\ems\corporation
>
>09/29/2000  15:03       <DIR>          .
>09/29/2000  15:03       <DIR>          ..
>09/29/2000  13:50                  672 Corporation.java
>09/29/2000  11:55                1,712 CorporationBean.java
>09/29/2000  11:55                  606 CorporationHome.java
>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.
>
>Regards,
>
>Gero Vermaas


Mime
View raw message