Hi, Vinay
----- Original Message ----- From: Thomas Schubert Sent: Sunday, April 29, 2001 4:08 PM To: [EMAIL PROTECTED] Subject: [JBoss-user] It never finds beans in another *.jar's
I'm new in EJB and using JBoss. I tried some simple examples and all the classes were in the same package and it worked. But when I made a SessionBean which used an EntityBean, both in a different jar-files, JBoss never found the EntityBean. Even trying the modified Example from the book Enterprise JavaBeans from O'Reilly - by deploying the TravelAgentBean JBoss wrote the message - Can't find CabinBean ............ What do I wrong ?
package com.titan.travelagent;
import com.titan.cabin.*; import .................
....... ....... public class TravelAgentBean implements javax.ejb.SessionBean {
public String[] listCabins(int shipID, int bedCount) throws RemoteException{ javax.naming.Context jndiContext = new InitialContext(); Object obj = jndiContext.lookup("java:comp/env/ejb/CabinHome");
CabinHome home = (CabinHome) javax.rmi.PortableRemoteObject.narrow(obj, CabinHome.class);
......................
ejb-jar of travelagent
<ejb-jar> <enterprise-beans> <session> <ejb-name>TravelAgentBean</ejb-name> <home>com.titan.travelagent.TravelAgentHome</home> <remote>com.titan.travelagent.TravelAgent</remote> <ejb-class>com.titan.travelagent.TravelAgentBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type>
<ejb-ref> <ejb-ref-name>ejb/CabinHome</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.titan.cabin.CabinHome</home> <remote>com.titan.cabin.Cabin</remote> <ejb-link>CabinHome</ejb-link> </ejb-ref>
</session> </enterprise-beans>
<assembly-descriptor> <security-role> <description> This role represents everyone who is allowed full access to the cabin bean. </description> <role-name>everyone</role-name> </security-role>
<method-permission> <role-name>everyone</role-name> <method> <ejb-name>TravelAgentBean</ejb-name> <method-name>*</method-name> </method> </method-permission>
<container-transaction> <method> <ejb-name>TravelAgentBean</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar>
ejb-jar of cabinbean
<ejb-jar> <enterprise-beans> <entity> <description> This Cabin enterprise bean entity represents a cabin on a cruise ship. </description> <ejb-name>CabinBean</ejb-name> <home>com.titan.cabin.CabinHome</home> <remote>com.titan.cabin.Cabin</remote> <ejb-class>com.titan.cabin.CabinBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>com.titan.cabin.CabinPK</prim-key-class> <reentrant>False</reentrant>
<cmp-field><field-name>id</field-name></cmp-field> <cmp-field><field-name>name</field-name></cmp-field> <cmp-field><field-name>deckLevel</field-name></cmp-field> <cmp-field><field-name>ship</field-name></cmp-field> <cmp-field><field-name>bedCount</field-name></cmp-field> </entity> </enterprise-beans>
<assembly-descriptor> <security-role> <description> This role represents everyone who is allowed full access to the cabin bean. </description> <role-name>everyone</role-name> </security-role>
<method-permission> <role-name>everyone</role-name> <method> <ejb-name>CabinBean</ejb-name> <method-name>*</method-name> </method> </method-permission>
<container-transaction> <method> <ejb-name>CabinBean</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar>
_______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
|