aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes using ant to generate ejb deploy code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "using ant to generate ejb deploy code " Watch "using ant to generate ejb deploy code " New topic
Author

using ant to generate ejb deploy code

Bondu Sam
Greenhorn

Joined: Jan 24, 2003
Posts: 8
hi,

Iam getting errors when trying to generate deploy code for EJB. I am using the jdk that comes with webpshere. The ejb jar file is created successfully with the deploy code but does not include ibm-ejb-jar-bnd.xmi, although the ejb-jar.xml and the ibm-ejb-jar-bnd.xmi reside in the same directory

my build file looks like this -
######################################################
<ejbjar srcdir="${test.srcEJB}" descriptordir="${project.ejb.dir}/ejbModule/META-INF" destdir="${build.dir}/lib">
<include name="${build.ejb.classes}/**/*.class" />
<include name="*ejb-jar.xml" />
<include name="*-ejb-jar-bnd.xmi" />
<websphere dbvendor="DB2UDBOS390_V6" ejbdeploy="true" destdir="${dist.dir}">
<wasclasspath>
<pathelement location="${websphere.home}/deploytool/itp/plugins/org.eclipse.core.boot_2.1.3/boot.jar"/>
<pathelement location="${websphere.home}/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime/batch.jar"/>
<pathelement location="${websphere.home}/lib/xerces.jar"/>
<pathelement location="${websphere.home}/lib/ivjejb35.jar"/>
<pathelement location="${websphere.home}/lib/j2ee.jar"/>
<pathelement location="${websphere.home}/lib/vaprt.jar"/>
<pathelement location="${project.utilities}/rt.jar" />
</wasclasspath>
</websphere>
<dtd publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" location="${dtd.location}"/>
</ejbjar>
####################################################


When this task is executed I get the following error -

########################################################
[ejbjar] building ejb.jar with 4 files
[ejbdeploy] 0 Errors, 0 Warnings, 0 Informational Messages
[ejbjar] building ibm.jar with 1 files

[ejbdeploy]

[ejbdeploy] [*Error] An unexpected exception was thrown. Halting execution.

[ejbdeploy] Error importing: Error importing Module File.
[ejbdeploy] >com.ibm.etools.ejbdeploy.EJBDeploymentException (Error importing: E
rror importing Module File.)
[ejbdeploy] >com.ibm.etools.wft.util.WFTWrappedException (Error importing Module
File)
[ejbdeploy] com.ibm.etools.archive.exception.DeploymentDescriptorLoadException:
META-INF/ejb-jar.xml
[ejbdeploy] Stack trace of nested exception:
[ejbdeploy] com.ibm.etools.j2ee.exception.WrappedRuntimeException: IWAE0099E An
Exception occurred while parsing xml: Line #: 2 :Column #: 159
[ejbdeploy] Stack trace of nested exception:
[ejbdeploy] org.xml.sax.SAXParseException: Document root element "ejbbnd:EJBJarB
inding", must match DOCTYPE root "null".
[ejbdeploy] at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
[ejbdeploy] at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Sour
ce)
#############################################

Where am I going wrong?
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
I wont be sure of what is wrong in the script, but when I tried using the ejbjar task, I could not get it to working. So I used the ejbdeploy batch file that comes packaged with WSAD. This got my script working to generate complete deplyment code.
This has the disadvantage though, that you need WSAD to be installed on your build box.

Heres my script extract for ejbdeploy

<target name="deploy" depends ="ejbJarforCompile">
<echo>Deploying EJB JAR file</echo>
<exec executable="${WAS_HOME}/bin/ejbdeploy.bat" >
<arg value="${build.dir}\strideEJB.jar"/>
<arg value="${srcDir}"/>
<arg value="${build.dir}\strideEJB1.jar"/>
</exec>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using ant to generate ejb deploy code