• Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb-local-ref AND ejb-link

 
B Das
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying out a simple customized example program from a web site.
a session bean calling an entity bean. ejb2.0 entity using local interfaces only.I have created separate entity jar and session jar.In session jar while
using weblogic ejbc , i get error... i am attaching part of ejb-jar.xml of session jar.
<ejb-local-ref>
<ejb-ref-name>ejb/LocalUser</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.test.LocalUserHome</local-home>
<local>com.test.LocalUser</local>
<ejb-link>userEntityBean.jar#UserBean</ejb-link>
</ejb-local-ref>
Now error:
ERROR: Error from ejbc:
In ejb-jar.xml, the EJB 'UserManagementBean' contains an invalid ejb-link in ejb-local-ref '
ejb/LocalUser'. No EJB with ejb-name 'userEntity.jar#UserBean' could be found.
ERROR: ejbc found errors

Now userEntity.jar is my enity ejb jar, and UserBean is the name of the bean class of the entity.
While using ejbc for session jar , i had the entity ejb jar in the same directory so path problem should n't be there.??
Please clarify this concept..
while following a session-->enitity ...is it that ejb-local-ref and ejb-link is only used if u have separate jars for session
and entity.
Thank you in advance..
:roll:
S.Das.
 
Claudio Gualberto
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tag <ejb-link> when specified, must point to your bean name, the same specified at you bean name tag at ejb-jar.jar.
Claudio Gualberto
SCJP 1.4
 
B Das
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for ur reply , I tried it out ..but still no sucess..
the entity ejb jar has ejb-name UserEJB in ejb-jar.xml
the session ejb jar 's ejb-jar.xml has to lookup this..
i tried out
<ejb-local-ref>
<ejb-ref-name>LocalUser</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>LocalUserHome</local-home>
<local>LocalUser</local>
<ejb-link>UserEJB</ejb-link>
</ejb-local-ref>
in ejb-jar.xml of the session ejb.
but no success.if you could please correct me..thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!