websphere - EAR cannot find EJBs in other EAR (WAS shared lib issue) -


i've got ejb set in entity-layer-ear:

    <session>         <ejb-name>doctordaoimpl</ejb-name>         <business-local>mypath.doctordao</business-local>         <ejb-class>mypath.doctordaoimpl</ejb-class>         <session-type>stateless</session-type>     </session> 

according logs, ear , ejbs start fine. have facade (e.g. doctordao) in shared libs, , entity layer ear has implementations (eg. doctordaoimpl).

now when deploy doctor service, has data-service.jar who's doctordataejb injects doctordao.

but error saying:

the mypath.doctordao ejb reference in doctordataejb component in data-service.jar module of doctor application not resolved. nested exception is: com.ibm.ejs.container.ejbnotfoundexception: ejb interface mypath.doctordao not present in application doctor

now, realise indeed, ejb not present in doctor application. present in entity-layer-ear. i've seen link similar, imagine must work out correct binding-name enter in "ejb references" admin ui (or perhaps can set in ibm-ejb-jar-bnd.xml).

if @ generated ejb-jar_merged.xml, see ref defined such:

<ejb-ref>      <ejb-ref-name>mypath.doctordao</ejb-ref-name>      <remote>mypath.doctordao</remote>      <injection-target>         <injection-target-class>mypath.doctordataejb</injection-target-class>         <injection-target-name>doctordao</injection-target-name>      </injection-target> </ejb-ref> 

i tried setting target resource jndi name to: java:global/myentitylayerapp/entity-service/doctordaoimpl!mypath.doctordao , get: java.lang.illegalargumentexception: can not set mypath.doctordao field mypath.doctordataejb.doctordao mypath.ejslocal0sldoctordaoimpl_

zoiks. 'local'.

it looks you're defining local ejb interface:

 <ejb-name>doctordaoimpl</ejb-name>     <business-local>mypath.doctordao</business-local> 

and try reference remote:

<ejb-ref>  <ejb-ref-name>mypath.doctordao</ejb-ref-name>  <remote>mypath.doctordao</remote> 

it won't work. you'll have decide fits business case :)


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -