ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From G Ramasubramani <gr...@aztec.soft.net>
Subject Re: EJBJAR task not working, all information provided.
Date Fri, 22 Dec 2000 06:58:45 GMT
Andre,

        I once had the same problem. I solved it by removing any CR/LF
characters around the tags. Did you try re-writing the weblogic-xml file?

Rama


Andr'e Cesta wrote:

> 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.SampleTransactionB
> ean
>    [ejbjar] looking at interface
> nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.SampleTransactionH
> ome
>    [ejbjar]      implements javax.ejb.EJBHome
>    [ejbjar] looking at interface
> nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.SampleTransaction
>    [ejbjar]      implements javax.ejb.EJBObject
>    [ejbjar] building ejb.jar with 4 files
>    [ejbjar] adding file
> 'nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransaction
> Bean.class'
>    [ejbjar] adding file 'META-INF/ejb-jar.xml'
>    [ejbjar] adding file
> 'nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransaction
> Home.class'
>    [ejbjar] adding file
> 'nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransaction
> .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.nz-java-fra
> mework/lib/OROMatcher-1.1.jar:/home/andrec/projects/${FRAMEWORK_PROJECT}/mod
> ules/webmasters.co.nz-java-framework/lib/PerlTools-1.2.0a.jar:/home/andrec/p
> rojects/${FRAMEWORK_PROJECT}/modules/webmasters.co.nz-java-framework/lib/byp
> roxy1.7c.jar:/home/andrec/projects/${FRAMEWORK_PROJECT}/modules/webmasters.c
> o.nz-java-framework/lib/jaf-1.0.1.jar:/home/andrec/projects/${FRAMEWORK_PROJ
> ECT}/modules/webmasters.co.nz-java-framework/lib/javamail-1.1.2.jar:/home/an
> drec/projects/${FRAMEWORK_PROJECT}/modules/webmasters.co.nz-java-framework/l
> ib/jsdk-2.1.jar:/home/andrec/projects/${FRAMEWORK_PROJECT}/modules/webmaster
> s.co.nz-java-framework/lib/oracle-classes111.zip:/home/andrec/projects/ejbs1
> 1weblogic51/modules/clear.co.nz-casper/frameworks/Framework.20001002.jar:/ho
> me/andrec/projects/${FRAMEWORK_PROJECT}/classes:/home/andrec/projects/ejbs11
> weblogic51/classes:/usr/local/weblogic/5.1/weblogic/classes:/usr/local/weblo
> gic/5.1/weblogic/lib/weblogicaux.jar:/home/andrec/projects/ejbs11weblogic51/
> 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/SampleTransactio
> nBean.class
> ./nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransactio
> n.class
> ./nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransactio
> 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/SampleTransaction.
> class
>
> Name:
> nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransactionH
> ome.class
>
> Name:
> nz/co/advantagegroup/javaone/ejbs11weblogic51/transaction/SampleTransactionB
> 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.SampleTransa
> ctionHome</home>
>
> <remote>nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.SampleTran
> saction</remote>
>
> <ejb-class>nz.co.advantagegroup.javaone.ejbs11weblogic51.transaction.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.transaction.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/SampleTrans
> 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/SampleTrans
> 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/SampleTrans
> 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/SampleTrans
> 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