David,
Which version of ant are you using? If it is a snapshot from CVS, then a
problem was recently introduced which has even more recently been resolved.
I have successfully been build EJBs with ejbjar way back to SP1.
Conor
----- Original Message -----
From: "Ventimiglia, David" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 13, 2001 6:48 AM
Subject: <ejbjar>, classpath, and parser.jar problems
> Hi,
>
> It seems the parser.jar used by Ant1.3 is not compatible with the one
used
> by BEA Weblogic 5.1.0. Is there a way to fix this? When I use the
<ejbjar>
> task, I get this error:
>
> [java] java.lang.ClassCastException
> [java] at
> weblogic.xml.dom.DOMUtils.getOptionalElementsByTagName(DOMUtils.java,
> Compiled Code)
> [java] at
> weblogic.xml.dom.DOMUtils.getOptionalElementByTagName(DOMUtils.java:170)
> [java] at
> weblogic.xml.dom.DOMUtils.getOptionalValueByTagName(DOMUtils.java:97)
> [java] at
>
weblogic.ejb.deployment.dd.EJBReadDOM.getDescriptionValue(EJBReadDOM.java:4
0
> 4)
> [java] at
>
weblogic.ejb.deployment.dd.DescriptorLoader.createDeploymentUnit(Descriptor
L
> oader.java:200)
> [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:353)
> [java] weblogic.utils.compiler.ToolFailureException: ERROR:
> java.lang.ClassCastException
> [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:353)
> [java] Java Result: 1
>
> BEA told me weblogic.ejbc has a problem with more recent XML parsers, but
> that it is fixed in Service Pack 8. My organization cannot go to SP8,
> however, so I'm wondering if there is a way to fix it right in my build
> file. The problem seems to be that ant.bat puts $ANT_HOME/lib/parser.jar
> into the classpath used to run ant (this much makes sense), and that this
> classpath becomes the java.class.path system property (this also makes
> sense). Though I wish it were otherwise, however, Ant seems to insist on
> prepending the java.class.path to the classpath I use in the <ejbjar>
task.
> This causes problems. If the java.class.path could be appended to the
end,
> or better yet, not included at all, that would work great.
>
> So, my main questions are these:
>
> 1. Does <ejbjar> automagically prepend the java.class.path property to
the
> classpath used to run weblogic.ejbc?
> 2. If 1, then why?
> 3. If 1 & 2, how can I make it stop?
>
> Here's how I'm using <ejbjar> in my build.xml file:
>
> <target name="ejbs" depends="init,classes">
> <echo message="Generating EJBs"/>
> <ejbjar srcdir="${build.dir}"
> flatdestdir="true"
> descriptordir="${src.dir}">
> <weblogic destdir="${build.dir}"
> keepgeneric="no"
>
>
classpath="${build.dir}:${wl.home}/license:${wl.home}/classes:${wl.home}/li
b
> /weblogicaux.jar"
> oldCMP="true"
> suffix="-weblogic-ejb.jar"/>
> <include name="**/${includes.list}/**/*-ejb-jar.xml"/>
> <exclude name="**/*weblogic*.xml"/>
> </ejbjar>
> </target>
>
> This task produces the following output:
>
> [java] Forking java -classpath
> "C:\Sybase\asep\monclass.zip;C:\Sybase\asep\3pclass.zip;C:\Program
> Files\Exceed.nt\hcljrcsv.jar;C:\Program Files\Exceed.nt;C:\Program
> Files\Rational\Rational Test
>
7;C:\dventimiglia_coreMsdw_PersonalDevStream_snapshot\coreMsdw\classes\ant\
l
>
ib\ant.jar;C:\dventimiglia_coreMsdw_PersonalDevStream_snapshot\coreMsdw\cla
s
>
ses\ant\lib\jaxp.jar;C:\dventimiglia_coreMsdw_PersonalDevStream_snapshot\co
r
>
eMsdw\classes\ant\lib\optional.jar;C:\dventimiglia_coreMsdw_PersonalDevStre
a
>
m_snapshot\coreMsdw\classes\ant\lib\parser.jar;C:\jdk1.2.2\lib\tools.jar;C:
\
>
staging;C:\weblogic\license;C:\weblogic\classes;C:\weblogic\lib\weblogicaux
.
>
jar;C:\dventimiglia_coreMsdw_PersonalDevStream_snapshot\coreMsdw\classes\lo
g
> 4j-full.jar" weblogic.ejbc -noexit C:\staging\CommandProxy-generic.jar
> C:\staging\CommandProxy-weblogic-ejb.jar
>
> Note the extra classpath elements that occur before "C:\staging", which
is
> the value of ${build.dir}. These are coming from java.class.path.
>
> Thanks!
> Cheers,
> David A. Ventimiglia