We are facing a problem while accessing an EJB deployed as a 'Local'
EJB. (ejb2.0)
There is an entity bean X which is working perfectly.
Now I tried creating an similar EJB for "Local" access. I created
LocalHome & Local interfaces and the bean class itself was copied from
bean X.
In descriptors, the local EJB was specified as ...
------------------------------------------------------------
<ejb-jar>
<enterprise-beans>
................
<entity>
<ejb-name> SiteUserEjbLocal </ejb-name>
<local-home> SiteUserLocalHome </local-home>
<local> SiteUserLocal </local>
<ejb-class> SiteUserEjb2 </ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class> SiteUserPK </prim-key-class>
<reentrant> False </reentrant>
</entity>
.....
</enterprise-beans>
<assembly-descriptor />
</ejb-jar>
------------------------------------------------------------
<weblogic-ejb-jar>
..........
<weblogic-enterprise-bean>
<ejb-name>SiteUserEjbLocal</ejb-name>
<local-jndi-name>SiteUserEjb2</local-jndi-name>
</weblogic-enterprise-bean>
.........
</weblogic-ejb-jar>
------------------------------------------------------------
Both bean X and new bean Y are packaged in same EJB jar and deployed
through weblogic console. The deployment is successful & console shows
EJB successful activated on target server.
However, on client side, the JNDI lookup for name 'SiteUserEjb2' fails
...
The error reported is
---------
Root exception is javax.naming.NameNotFoundException: Unable to
resolve 'app/ejb/WebUtils.jar#SiteUserEjb2/local-home' Resolved:
'app/ejb' Unresolved:'WebUtils.jar#SiteUserEjb2' ; remaining name
'WebUtils.jar#SiteUserEjb2/local-home'
<<no stack trace available>>
---------
I found another interesting thing :
We did a direct JNDI lookup using some other utility jndi program. The
program showed the JNDI name 'SiteUserEjb2' present in Weblogic's JNDI
tree -- but class of object bound was reported as
'javax.naming.LinkRef' whereas for all other EJBs, the class is
reported as 'weblogic.rmi.cluster.ClusterableRemoteObject'.
Any pointers ??
Thanks,
MJ
Marek Lange - 30 Jul 2003 08:48 GMT
> We are facing a problem while accessing an EJB deployed as a 'Local'
> EJB. (ejb2.0)
[quoted text clipped - 8 lines]
>
> However, on client side, the JNDI lookup for name 'SiteUserEjb2' fails
Don't know much about WebLogic. Are you using a remote client? This will
not work. If you want to call the Bean Y using its local interface your
client has to be in the same VM, otherwise it is necessary to use the
remote interface of the bean. The access to the bean with local
interfaces is normally realized by using using a session bean facade
which has a remote interface.
-marek