Author
Can�t find Home Interface.
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
Hi, Im running the examples of Enterprise Java Beans from Monson-Haefel book in WebLogic 6.0 and I?m havin the error: java.rmi.RemoteException : EJB Exception: ; nested exception is: java.lang.NoClassDefFoundError : com.titan.cabin.CabinHome java.lang.NoClassDefFoundError : com.titan.cabin.CabinHome I was debuggin it and I discovered tha the error occurs right after I get a remote reference to the bean with Object ref = ctx.lookup("java:comp/env/ejb/Cabin"); I got the reference but then when I try to do: CabinHome home = (CabinHome)(javax.rmi.PortableRemoteObject.narrow(ref, CabinHome.class)); the error occurs. Any help will be wellcome. txs in advance.
George Brown
Ranch Hand
Joined: Sep 26, 2000
Posts: 919
posted Jul 10, 2001 10:35:00
0
Can you post the XML file that describes your Cabin EJB?
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
The ejb-jar.xml for the Cabin EJB <?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> <entity> <description></description> <ejb-name>Cabin</ejb-name> <home>com.titan.cabin.CabinHome</home> <remote>com.titan.cabin.Cabin</remote> <ejb-class>com.titan.cabin.CabinEJB</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>com.titan.cabin.CabinPK</prim-key-class> <reentrant>False</reentrant> <cmp-field> <field-name>deck_level</field-name> </cmp-field> <cmp-field> <field-name>name</field-name> </cmp-field> <cmp-field> <field-name>bed_count</field-name> </cmp-field> <cmp-field> <field-name>ship_id</field-name> </cmp-field> <cmp-field> <field-name>id</field-name> </cmp-field> </entity> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>Cabin</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> -------------------------- the 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/weblogic-ejb-jar.dtd'> <weblogic-ejb-jar> <weblogic-enterprise-bean> <ejb-name>Cabin</ejb-name> <persistence-descriptor> <persistence-type> <type-identifier>WebLogic_CMP_RDBMS</type-identifier> <type-version>5.1.0</type-version> <type-storage>META-INF/weblogic-cmp-rdbms-jar-Cabin.xml</type-storage> </persistence-type> <persistence-use> <type-identifier>WebLogic_CMP_RDBMS</type-identifier> <type-version>5.1.0</type-version> </persistence-use> </persistence-descriptor> <jndi-name>Cabin</jndi-name> </weblogic-enterprise-bean> </weblogic-ejb-jar> [This message has been edited by Marcos Maia (edited July 10, 2001).]
Marcos Maia
Ranch Hand
Joined: Jan 06, 2001
Posts: 977
OH!! and here goes the ones to TravelAgent EJB: 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>Stateless Session ejb que manipula CabinEJB</description> <ejb-name>TravelAgent</ejb-name> <home>com.titan.travelagent.TravelAgentHome</home> <remote>com.titan.travelagent.TravelAgent</remote> <ejb-class>com.titan.travelagent.TravelAgentEJB</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-ref> <ejb-ref-name>ejb/Cabin</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.titan.cabin.CabinHome</home> <remote>com.titan.cabin.Cabin</remote> </ejb-ref> </session> </enterprise-beans> <assembly-descriptor> <security-role> <role-name>everyone</role-name> </security-role> <method-permission> <role-name>everyone</role-name> <method> <ejb-name>TravelAgent</ejb-name> <method-name>*</method-name> </method> </method-permission> <container-transaction> <method> <ejb-name>TravelAgent</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> ---------------------------- and the 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/weblogic-ejb-jar.dtd'> <weblogic-ejb-jar> <weblogic-enterprise-bean> <ejb-name>TravelAgent</ejb-name> <reference-descriptor> <ejb-reference-description> <ejb-ref-name>ejb/Cabin</ejb-ref-name> <jndi-name>Cabin</jndi-name> </ejb-reference-description> </reference-descriptor> <jndi-name>TravelAgent</jndi-name> </weblogic-enterprise-bean> <security-role-assignment> <role-name>everyone</role-name> <principal-name>everyone</principal-name> </security-role-assignment> </weblogic-ejb-jar>
subject: Can�t find Home Interface.