ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Matthew Pryor" <...@verveinc.com>
Subject RE: EJBJAR task not working, all information provided.
Date Thu, 21 Dec 2000 22:34:20 GMT
I think you should try renaming your XML DD file to comply with the expected
naming scheme for ejbjar

I use it all the time without trouble, the error you are getting has
something to do with the weblogic specific XML file (that is where the JNDI
name is set)

jmp

> -----Original Message-----
> From: Andr'e Cesta [mailto:AndreC@AdvantageGroup.co.nz]
> Sent: Thursday, December 21, 2000 2:03 PM
> To: 'ant-user@jakarta.apache.org'
> Subject: EJBJAR task not working, all information provided.
>
>
>
> Problem with EJBJAR task,
> tryied really hard, but did not work:
>
> -Read manual.
> -Verified all the postings related to EJBJAR on this list.
> -Downloaded nightly build of the 20th of Dec.
> -Installed it successfully.
> -Tryied the simplest deployment of a single stateless session bean.
> -Weblogic deployer tool says this bean is 1.1 compliant when I jar it
> myself.
> -Still did not work with Ant.
>
> I will post the task, and all the code, so you can try it as well, and
> tell me what is wrong with it.
>
> Thanks, Andre.
>
> ------------------------------------------------------------------
> ----------
> -----------------------------------------------------
> Error message:
>    [ejbjar] building ejb.jar with 4 files
>      [java] ERROR: Error from ejbc: The JNDI name of bean
> SampleTransaction
> was not set
>      [java] Exception in thread "main"
> weblogic.utils.compiler.ToolFailureException: ERROR: ejbc found errors
>      [java]     at weblogic.ejbc.runBody(ejbc.java:328)
>      [java]     at weblogic.utils.compiler.Tool.run(Tool.java:80)
>      [java]     at weblogic.ejbc.main(ejbc.java:353)
>      [java] Java Result: 1
>
> all:
>
> BUILD SUCCESSFUL
> ------------------------------------------------------------------
> ----------
> -------------------------------------------------------
> Error message with verbose now:
>    [ejbjar] 1 deployment descriptors located.
>    [ejbjar] looking at class
> nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.SampleTr
> ansactionB
> ean
>    [ejbjar] looking at interface
> nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.SampleTr
> ansactionH
> ome
>    [ejbjar]      implements javax.ejb.EJBHome
>    [ejbjar] looking at interface
> nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.SampleTr
> ansaction
>    [ejbjar]      implements javax.ejb.EJBObject
>    [ejbjar] building ejb.jar with 4 files
>    [ejbjar] adding file
> 'nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleT
> ransaction
> Bean.class'
>    [ejbjar] adding file 'META-INF/ejb-jar.xml'
>    [ejbjar] adding file
> 'nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleT
> ransaction
> Home.class'
>    [ejbjar] adding file
> 'nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleT
> ransaction
> .class'
>    [ejbjar] Calling weblogic.ejbc for
> /home/andrec/projects/ejbs11weblogic51/ejbs/META-INF/ejb-generic.jar
>      [java] Forking java -classpath
> /home/andrec/projects/${FRAMEWORK_PROJECT}/modules/webmasters.co.n
> z-java-fra
> mework/lib/OROMatcher-1.1.jar:/home/andrec/projects/${FRAMEWORK_PR
> OJECT}/mod
> ules/webmasters.co.nz-java-framework/lib/PerlTools-1.2.0a.jar:/hom
> e/andrec/p
> rojects/${FRAMEWORK_PROJECT}/modules/webmasters.co.nz-java-framewo
> rk/lib/byp
> roxy1.7c.jar:/home/andrec/projects/${FRAMEWORK_PROJECT}/modules/we
> bmasters.c
> o.nz-java-framework/lib/jaf-1.0.1.jar:/home/andrec/projects/${FRAM
> EWORK_PROJ
> ECT}/modules/webmasters.co.nz-java-framework/lib/javamail-1.1.2.ja
> r:/home/an
> drec/projects/${FRAMEWORK_PROJECT}/modules/webmasters.co.nz-java-f
> ramework/l
> ib/jsdk-2.1.jar:/home/andrec/projects/${FRAMEWORK_PROJECT}/modules
> /webmaster
> s.co.nz-java-framework/lib/oracle-classes111.zip:/home/andrec/proj
> ects/ejbs1
> 1weblogic51/modules/clear.co.nz-casper/frameworks/Framework.200010
> 02.jar:/ho
> me/andrec/projects/${FRAMEWORK_PROJECT}/classes:/home/andrec/proje
> cts/ejbs11
> weblogic51/classes:/usr/local/weblogic/5.1/weblogic/classes:/usr/l
> ocal/weblo
> gic/5.1/weblogic/lib/weblogicaux.jar:/home/andrec/projects/ejbs11w
> eblogic51/
> build/advantagegroup.co.nz-ejbs11weblogic51/ejb weblogic.ejbc -noexit
> /home/andrec/projects/ejbs11weblogic51/ejbs/META-INF/ejb-generic.jar
> /home/andrec/projects/ejbs11weblogic51/ejbs/META-INF/ejb.jar
>      [java] ERROR: Error from ejbc: The JNDI name of bean
> SampleTransaction
> was not set
>      [java] Exception in thread "main"
> weblogic.utils.compiler.ToolFailureException: ERROR: ejbc found errors
>      [java]     at weblogic.ejbc.runBody(ejbc.java:328)
>      [java]     at weblogic.utils.compiler.Tool.run(Tool.java:80)
>      [java]     at weblogic.ejbc.main(ejbc.java:353)
>      [java] Java Result: 1
>    [ejbjar] deleting generic jar
> /home/andrec/projects/ejbs11weblogic51/ejbs/META-INF/ejb-generic.jar
>
> all:
>
> BUILD SUCCESSFUL
> ------------------------------------------------------------------
> ----------
> --------------------------------------------------------
>
> EJBJAR task:
> <ejbjar srcdir="${SRC_EJBS}" destdir="${TARGET_EJBS}">
>          <weblogic destdir="${TARGET_EJBS}" classpath="${CLASSPATH}" />
>          <include name="**/*ejb-jar.xml"/>
>          <exclude name="**/*weblogic*.xml"/>
> </ejbjar>
>
> Notice  that the descriptors are under the META_INF directory on SRC_EJBS:
> find $SRC_EJBS -type f:
>
> ./nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/Sample
> Transactio
> nBean.class
> ./nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/Sample
> Transactio
> n.class
> ./nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/Sample
> Transactio
> nHome.class
> ./META-INF/MANIFEST.MF
> ./META-INF/ejb-jar.xml
> ./META-INF/weblogic-ejb-jar.xml
>
> ------------------------------------------------------------------
> ----------
> ---------------------------------------------------------
>
> MANIFEST.MF (already used/verifyied for EJB1.1 compliance by weblogic):
> Manifest-Version: 1.0
>
> Name: META-INF/ejb-jar.xml
>
> Name: META-INF/weblogic-ejb-jar.xml
>
> Name:
> nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTr
> ansaction.
> class
>
> Name:
> nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTr
> ansactionH
> ome.class
>
> Name:
> nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTr
> ansactionB
> ean.class
>
> ------------------------------------------------------------------
> ----------
> ----------------------------------------------------------
> ejb-jar.xml
>
> <?xml version="1.0"?>
>
> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
> JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_
> 1_1.dtd'>
>
> <ejb-jar>
>     <enterprise-beans>
>       <session>
>         <description>A sample ejb for testing weblogic5.1</description>
>         <ejb-name>SampleTransaction</ejb-name>
>
> <home>nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.Sa
> mpleTransa
> ctionHome</home>
>
> <remote>nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.
> SampleTran
> saction</remote>
>
> <ejb-class>nz.co.advantagegroup.javaone.ejbs11weblogic51.transacti
> on.SampleT
> ransactionBean</ejb-class>
>         <session-type>Stateless</session-type>
>         <transaction-type>Container</transaction-type>
>       </session>
>     </enterprise-beans>
>     <assembly-descriptor>
>       <security-role>
>         <description>This role represents everyone who is allowed full
> access to the SampleTransactionBean bean.</description>
>
>         <role-name>everyone</role-name>
>       </security-role>
>       <method-permission>
>         <role-name>everyone</role-name>
>         <method>
>           <ejb-name>SampleTransaction</ejb-name>
>           <method-name>*</method-name>
>         </method>
>       </method-permission>
>       <container-transaction>
>         <method>
>           <ejb-name>SampleTransaction</ejb-name>
>           <method-name>*</method-name>
>         </method>
>         <trans-attribute>Required</trans-attribute>
>       </container-transaction>
>     </assembly-descriptor>
>   </ejb-jar>
>
> ------------------------------------------------------------------
> ----------
> ------------------------------------------------------------------------
>
> weblogic-ejb-jar.xml
>
> <?xml version="1.0"?>
>
> <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD
> WebLogic 5.1.0
> EJB//EN' 'http://www.bea.com/servers/wls510/dtd/we
> blogic-ejb-jar.dtd'>
>
> <weblogic-ejb-jar>
>     <weblogic-enterprise-bean>
>       <ejb-name>SampleTransaction</ejb-name>
>
> <jndi-name>nz.co.advantagegroup.javaone.ejbs11weblogic51.transacti
> on.SampleT
> ransactionBeanHome</jndi-name>
>     </weblogic-enterprise-bean>
>     <security-role-assignment>
>       <role-name>everyone</role-name>
>       <principal-name>guest</principal-name>
>     </security-role-assignment>
>   </weblogic-ejb-jar>
>
> ------------------------------------------------------------------
> ----------
> ------------------------------------------------------------------------
>
> Source code:
> more
> ./java/nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/S
> ampleTrans
> actionBean.java
> package nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction;
>
> import javax.ejb.EntityContext;
>
> public class SampleTransactionBean implements javax.ejb.SessionBean {
>
>     public void ejbCreate() {
>         //do nothing.
>     };
>
>      public String executeRequest(String request) {
>         return request;
>     };
>
>     public void ejbRemove() {}
>     public void ejbActivate() {}
>     public void ejbPassivate() {}
>     public void setSessionContext(javax.ejb.SessionContext cntx) {}
>
> };
>
> ------------------------------------------------------------------
> ----------
> -----------------------------------------------------------------------
> more
> ./java/nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/S
> ampleTrans
> action.java
> package nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction;
>
> import java.rmi.RemoteException;
>
> public interface SampleTransaction extends javax.ejb.EJBObject {
>
>     public String executeRequest(String request) throws RemoteException;
>
> };
>
> ------------------------------------------------------------------
> ----------
> -----------------------------------------------------------------------
> more
> ./java/nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/S
> ampleTrans
> action.java
> package nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction;
>
> import java.rmi.RemoteException;
>
> public interface SampleTransaction extends javax.ejb.EJBObject {
>
>     public String executeRequest(String request) throws RemoteException;
>
> };
> [andrec@snuffleupagus src]$ more
> ./java/nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/S
> ampleTrans
> actionHome.java
> package nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction;
>
> import java.rmi.RemoteException;
> import javax.ejb.CreateException;
>
> public interface SampleTransactionHome extends javax.ejb.EJBHome {
>
>     public SampleTransaction create() throws RemoteException,
> CreateException;
>
> };
>
>
>


Mime
View raw message