geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fredrik Jonson <fred...@myrealbox.com>
Subject Re: inject EJB in Webapplication
Date Wed, 15 Apr 2009 14:09:50 GMT
Shawn Jiang wrote:
 
>  I encounter the same problem. Here is my case.
>  1, deploy a ear package contain a session bean(deployed JNDI name
>  "CounterBeanRemote") implement a remote interface.
> 
>  2, deploy a war package that contains a servlet using
>  @EJB(mappedName="CounterBeanRemote") to inject the EJB.

I'm not sure how this is applicable to remote ejb references but to
get injection to work in G I've always had to declare a ejb-local-ref
in web.xml:

  <ejb-local-ref>
    <ejb-ref-name>SomeBean</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>com.example.app.SomeBeanRemote</local>
  </ejb-local-ref>

...or something like that. Did you do that in your project?

Without the ejb-local-ref the injection wont happen, even if the bean
is declared within the same application ear.

-- 
Fredrik Jonson 


Mime
View raw message