Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Ant 1.5.2 and ejbjar task  RSS feed

 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to create one jar "etdummypc-ejb.jar" using <ejbjar> and run <weblogic> task on it. During the ant build process, only two files (DD) are added to the jar file and hence <weblogic> task fails complaining "No Enterprise Java Beans were found the jar file".
Below is my directory structure:
EJBs ->
.\Build\classes\com\icechill\sweep\exptrans\services\dummy\*.class
DD ->
.\Build\classes\com\icechill\sweep\exptrans\services\dummy\META-INF\*.xml
Below is the part of ant build script:

Below is the target where I invoke the above target:

When I execute "ant -buildfile wlbuild.xml doEJB",
<ejbjar> task only include the 2 DD xml files. (ejb-jar.xml and weblogic-ejb-jar.xml). It never includes any of the ejb classes. Please help me with a solution. Thanks a lot.
Note: I do read some properties from a file which is not mentioned in the code above.
ebj-jar.xml
-----------

weblogic-ejb-jar.xml
--------------------

[ March 12, 2003: Message edited by: Sai Prasad ]
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone post me a sample build.xml using <ejbjar> task? I am trying to get some answers to my earlier question. Moving up the queue...
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Come on experts...answer my question. Thanks.
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<target name="ejb-jar" depends="compile-ejb" description="Make ejb jar file">
<mkdir dir="${ejb.dir}"/>
<jar
jarfile="${ejb.jar.file}"
>
<fileset dir="${build.classes.dir}">
<include name="**/ejb/**/*"/>
<include name="**/interfaces/**/*"/>
</fileset>
<fileset dir="${build.ejb-meta.dir}"/>
</jar>
</target>

<!-- =================================================================== -->
<!-- Compile business logic (ejb) -->
<!-- =================================================================== -->
<target name="compile-ejb" depends="ejbdoclet" description="Compile business logic (ejb)">
<path id="compile.class.path">
<pathelement path="${lib.dir}/ejb.jar"/>
<pathelement path="${lib.dir}/struts.jar"/>
<pathelement path="${lib.dir}/jdbc2_0-stdext.jar"/>
</path>
<javac
srcdir="${build.gen-src.dir}"
destdir="${build.classes.dir}"
classpathref="compile.class.path"
>
<include name="**/ejb/**/*"/>
<include name="**/interfaces/**/*"/>
</javac>
</target>
 
Matthew X. Brown
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry-I grabbed the wrong text....
<weblogic-ejb-jar>
<description><![CDATA[Generated by XDoclet]]></description>
<weblogic-enterprise-bean>
<ejb-name>Sequence</ejb-name>
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
</entity-descriptor>
<reference-descriptor>
</reference-descriptor>
<local-jndi-name>middlegen.sequencegenerator.ejb.SequenceLocalHome</local-jndi-name>
</weblogic-enterprise-bean>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!