The following code works for us to compile a generic ejb jar into weblogic ejb jar. Remember do not put those class files which are inside the jar files into COMMON_COMPILE_CLASSPATH. Put <JAVA_HOME>\bin into your system PATH as well.
<!-- targets to create weblogic specific ejb jar file --> <target name="createWlsEJBInit" depends="compile_classpath"> <property name="wl_ejbc" value="weblogic.ejbc20"/> <property name="in_jar" value="${OUTPUT_DIR}/std-ejb-${COMP_NAME}.jar"/> <property name="out_jar" value="${OUTPUT_DIR}/ejb-${COMP_NAME}.jar"/> <property name="ejb_err" value="${OUTPUT_DIR}/ejb-${COMP_NAME}.errors"/> <property name="compile_ejb_classpath" value="${COMMON_COMPILE_CLASSPATH}"/> </target> <!-- you have to run target createEJB before you run createWlsEJB target --> <target name="createWlsEJB" depends="createWlsEJBInit"> <echo message="Compiling ${COMP_NAME} generic EJB to WebLogic EJB, please wait ... "/> <java fork="yes" classpath="${compile_ejb_classpath}" failonerror="true" classname="${wl_ejbc}"> <arg line=" -compiler javac ${in_jar} ${out_jar}"/> </java> </target> <!-- END: targets to create weblogic specific ejb jar file --> thanks, Jerry Li -----Original Message----- From: Deacon, Garrett (DST-CLT) [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 11:37 AM To: 'Ant Users List' Subject: RE: ejbjar: Exception while calling weblogic.ejbc20 I have been experienceing the same errors and cannot figure the cause. I am at my wits end. Does anyone on the list have a sample project that works with the weblogic ejbc target AND ant 1.5.1 ? I am desperate Thanx in advance for you help -Garrett -----Original Message----- From: ow [mailto:[EMAIL PROTECTED]] Sent: Monday, December 23, 2002 6:53 PM To: [EMAIL PROTECTED] Subject: ejbjar: Exception while calling weblogic.ejbc20 > <ejbjar> now allows control over which additional classes and > interfaces > are added to the generated EJB jars. A new attribute "dependency" can > be > defined which controls what classes are added. The addition of classes > now uses the Jakarta-BCEL library rather than reflection, meaning bean > classes are no longer loaded into Ant's JVM. The default dependency > analyzer is known as the ancestor analyzer. It provides the same > behaviour as the 1.4.1 version of <ejbjar>. If the BCEL library is not > present, a warning will be issued stating the ancestor analyzer is not > available. In this case <ejbjar> will continue to function but will not > add super classes to the jar. W2K, JDK 131 Addeed bcel.jar to the lib directory and set dependency="none". Tried also dependency="super", the same result (see below). Ejbjar fails with "Exception while calling weblogic.ejbc20" under Ant 1.5.1. With Ant 1.4.1 the whole build works fine. Any ideas? Thanks ---------------------------------------------------------- [ejbc] Executing 'C:\Progra~1\Sun\Jdk131\jre\bin\java.exe' with arguments: [ejbc] '-classpath' [ejbc] 'C:\progra~1\Sun\Jdk131\lib\tools.jar;C:\progra~1\Sun\Jdkee13\lib\j2ee.jar;C :\apps\Bea\Wls61\lib\weblogic.ja r;C:\dev\ejb;C:\dev\classes' [ejbc] 'weblogic.ejbc20' [ejbc] '-keepgenerated' [ejbc] 'C:\dev\build\Ejb-gen.jar' [ejbc] 'C:\dev\build\Ejb.jar' [ejbc] [ejbc] The ' characters around the executable and arguments are [ejbc] not part of the command. dropping C:\apps\Bea\Wls61\lib\weblogic_sp.jar from path as it doesn't exist dropping C:\apps\Bea\Wls61\lib\weblogic_sp.jar from path as it doesn't exist [ejbc] <Dec 23, 2002 4:49:41 PM EST> <Warning> <EJB> <EJB Deployment: xxxEjb has a class xxx which is in the classpath. This class should only be located in the ejb-jar file.> // The above warning is normal, I get the same with Ant 141 [ejbc] Exec failed .. exiting BUILD FAILED file:C:/build.xml:235: Exception while calling weblogic.ejbc20. Details: Ejbc reported an error at org.apache.tools.ant.taskdefs.optional.ejb.WeblogicDeploymentTool.buildWeblo gicJar(WeblogicDeploymentTool.jav a:633) at org.apache.tools.ant.taskdefs.optional.ejb.WeblogicDeploymentTool.writeJar(W eblogicDeploymentTool.java:651) at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.processDesc riptor(GenericDeploymentTool.java :478) at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java:592) at org.apache.tools.ant.Task.perform(Task.java:319) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.Project.executeTargets(Project.java:1250) at org.apache.tools.ant.Main.runBuild(Main.java:610) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235) --- Nested Exception --- Ejbc reported an error at org.apache.tools.ant.taskdefs.optional.ejb.WeblogicDeploymentTool.buildWeblo gicJar(WeblogicDeploymentTool.jav a:627) at org.apache.tools.ant.taskdefs.optional.ejb.WeblogicDeploymentTool.writeJar(W eblogicDeploymentTool.java:651) at org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool.processDesc riptor(GenericDeploymentTool.java :478) at org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.execute(EjbJar.java:592) at org.apache.tools.ant.Task.perform(Task.java:319) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1306) at org.apache.tools.ant.Project.executeTargets(Project.java:1250) at org.apache.tools.ant.Main.runBuild(Main.java:610) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235) __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -------------------------------------------------------------------------- Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. --------------------------------------------------------------------------