Comments injected below: --
Pavel Kolesnikov wrote: > Hello, > > another problems during switching to JBoss 3.0 (RC1 with Tomcat): > > Simply: I have a session bean UserManager and I want it to access > entity bean LocalRegion (through the local interface). > > Unfortunatelly, I'm getting just an exception saying > "LocalRegion not bound". -- David> Well first of all, you show below that the OptionsBrowser bean has an ejb-ref to LocalRegion; what about UserManager? -- > > My ejb-jar.xml: > <entity> > <ejb-name>LocalRegion</ejb-name> > <display-name>LocalRegionEJB</display-name> > > <local-home>net.templation.juristic.as.ejb.entities.LocalRegionHome</local-home> > <local>net.templation.juristic.as.ejb.entities.LocalRegion</local> > > <ejb-class>net.templation.juristic.as.ejb.entities.RegionEJB</ejb-class> > <persistence-type>Container</persistence-type> > <reentrant>False</reentrant> > <cmp-version>2.x</cmp-version> > <abstract-schema-name>Region</abstract-schema-name> > <prim-key-class>java.lang.String</prim-key-class> > <primkey-field>regionId</primkey-field> > <cmp-field> > <field-name>regionId</field-name> > </cmp-field> > <cmp-field> > <field-name>regionName</field-name> > </cmp-field> > </entity> > > <session> > <ejb-name>OptionsBrowser</ejb-name> > <home>net.templation.juristic.as.ejb.sessions.OptionsBrowserHome</home> > <remote>net.templation.juristic.as.ejb.sessions.OptionsBrowser</remote> > <ejb-class>net.templation.juristic.as.ejb.sessions.OptionsBrowserEJB</ejb-class> > <transaction-type>Container</transaction-type> > <session-type>Stateless</session-type> > <reentrant>False</reentrant> > <ejb-ref> > <ejb-ref-name>ejb/LocalRegion</ejb-ref-name> > <ejb-ref-type>Entity</ejb-ref-type> > <home>net.templation.juristic.as.ejb.entities.LocalRegionHome</home> > <remote>net.templation.juristic.as.ejb.entities.LocalRegion</remote> -- David> Use local-home and local instead of home and remote above. -- > <ejb-link>LocalRegion</ejb-link> > </ejb-ref> > </session> > > > I've encountered this problem without providing reference info > in jboss.xml as well as with: > <ejb-ref> > <ejb-ref-name>ejb/LocalRegion</ejb-ref-name> > <jndi-name>ejb/LocalRegion</jndi-name> > </ejb-ref> -- David> You do not need an ejb-ref block in your jboss.xml file unless you are trying to access a bean on another server. David> HOWEVER, in jboss.xml make sure you use local-jndi-name instead of jndi-name here like this: <entity> <ejb-name>LocalRegion</ejb-name> <local-jndi-name>yourcompany/yourapp/LocalRegion</local-jndi-name> </entity> -- > :-) > > I was trying to look for LocalRegion bean using "ejb/LocalRegion" > as well as java:comp/env/ejb/LocalRegion. -- David> After the changes I suggested you should be able to lookup "java:comp/env/ejb/LocalRegion" from your OptionsBrowserBean. David> Also know that with local interfaces you can cast the looked-up object right to it's home interface type. You only have to use PortableRemoteObject.narrow(x,x) with remote interfaces. -- > > Thanks > > Pavel -- David> Hope this helps. _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
