ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kyle Adams" <kad...@gfs.com>
Subject weblogic.ejbc, ejbjar, and classpaths
Date Fri, 06 Jun 2003 19:56:09 GMT
This is always a tricky area I approach with fear and trembling :-)

I'm trying to really nail down how weblogic.ejbc should be called in
the most efficient manner.  That is, the various classpaths involved are
set to ONLY what they need, with no redundancies.  This is Ant 1.5.1,
using the BCEL and the dependency attribute set to "full".

Reading through the ejbjar documentation, I initially thought the
wlclasspath attribute was used ONLY for the weblogic.jar (and whatever
service packs, patches, etc that should be included):

"In that case, the standard weblogic classes should be set with this
attribute (or equivalent nested element) and the home and remote
interfaces located with the standard classpath attribute."

My initial attempt at setting up ejbjar (simplified a bit for this
e-mail):

<ejbjar>
    <include name="ejb-jar.xml"/>
    <exclude name="weblogic*.xml"/>
    <weblogic classpath="${compile.classpath}"
wlclasspath="${weblogic.classpath}"/>
</ejbjar>

${compile.classpath} includes all of the utility libraries/classes
needed to support the EJB, but (in theory) none of the classes that the
dependency analyzer will pick up for inclusion in the generic jar.
${weblogic.classpath} includes weblogic.jar and any service pack jars or
patches.

The command (with paths and names changed to protect the innocent)
generated by this setup was:

java -classpath weblogic.jar weblogic.ejbc20 -classpath
myUtil.jar:weblogic.jar myEJB-generic.jar myEJB.jar

Unfortunately, this is the error I get:

ERROR: Error from ejbc: EJB : MyEJB .Unable to initialize method info
for remote or home interface.The error is
java.lang.NoClassDefFoundError: foo/bar/MyUtil

I've confirmed MyUtil is in the myUtil.jar, so I'm puzzled about this
error since I clearly passed myUtil.jar into the classpath option of
weblogic.ejbc.

If I add myUtil.jar to both classpaths, the build works fine:

<ejbjar>
    <include name="ejb-jar.xml"/>
    <exclude name="weblogic*.xml"/>
    <weblogic classpath="${compile.classpath}"
wlclasspath="${compile.classpath}"/>
</ejbjar>

java -classpath myUtil.jar:weblogic.jar weblogic.ejbc20 -classpath
myUtil.jar:weblogic.jar myEJB-generic.jar myEJB.jar

Which doesn't make sense to me - seems like all the JVM needs to know
about is weblogic.jar, and the rest of the classpath should be passed
into weblogic.ejbc.  Am I missing something here?

Thanks,
Kyle

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message