You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by mahu2425 <ma...@lycos.de> on 2007/04/24 17:26:20 UTC

Can not access ejb in different ear

Hi there,

I created an entity bean in an ejb project, packaged everything in an ear file and deployed it to my Geronimo 1.1.1 server.

The entity bean works fine as long as all calls to the bean are from inside the same ejb project (let's call it ejb1.jar packaged in ear1.ear).

I tried to call the bean from another ejb project (ejb2.jar packaged in ear2.ear), but I can not manage to call the bean from the other ear file.

My ejb-jar.xml file in ejb2.jar contains the following part:

<session>
  <display-name>MyDemo</display-name>
  <ejb-name>MyDemo</ejb-name> 
  <home>com.demo.MyDemoHome</home>
  <remote>com.demo.MyDemo</remote>
  <service-endpoint>com.demo.MyDemoSEI</service-endpoint>
  <ejb-class>com.demo.MyDemoBean</ejb-class>
  <session-type>Stateless</session-type>
  <transaction-type>Container</transaction-type>
  <ejb-ref>
    <ejb-ref-name>ejb/MyFirstDemo</ejb-ref-name>  <!-- This this matches jndi-name in the other ejb/ear file -->
    <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.firstdemo.MyFirstDemoHome</home>
    <remote>com.firstdemo.MyFirstDemo</remote>
  </ejb-ref>
</session>


Geronimo 1.1.1 is not able to find the required bean and throws an error during deployment.

The ear2.ear file contains the following stuff:
- ejb2.jar file
- client stubs from the ejb1.jar


Has anybody an idea what might be missing im my deployment plan or could help me out with a working deployment plan?

Thanks in advance,

Markus

Benachrichtigung bei E-Mail Empfang! - http://mail.lycos.de/app/lycosinside/setupLI.exe

Re: Can not access ejb in different ear

Posted by Manu George <ma...@gmail.com>.
Hi

You need to give a dependency in the second ear to the first ear. Also
you need to use ejb-link.The ejb-ref-name element is for specifying
the jndi name under which we can find the reference. The link below
refers to a previous response to the same Question
http://mail-archives.apache.org/mod_mbox/geronimo-user/200608.mbox/%3C6949EC79-4431-4DAD-92D1-D3AA1651A627@yahoo.com%3E

Regards
Manu

On 4/24/07, mahu2425 <ma...@lycos.de> wrote:
> Hi there,
>
> I created an entity bean in an ejb project, packaged everything in an ear file and deployed it to my Geronimo 1.1.1 server.
>
> The entity bean works fine as long as all calls to the bean are from inside the same ejb project (let's call it ejb1.jar packaged in ear1.ear).
>
> I tried to call the bean from another ejb project (ejb2.jar packaged in ear2.ear), but I can not manage to call the bean from the other ear file.
>
> My ejb-jar.xml file in ejb2.jar contains the following part:
>
> <session>
>   <display-name>MyDemo</display-name>
>   <ejb-name>MyDemo</ejb-name>
>   <home>com.demo.MyDemoHome</home>
>   <remote>com.demo.MyDemo</remote>
>   <service-endpoint>com.demo.MyDemoSEI</service-endpoint>
>   <ejb-class>com.demo.MyDemoBean</ejb-class>
>   <session-type>Stateless</session-type>
>   <transaction-type>Container</transaction-type>
>   <ejb-ref>
>     <ejb-ref-name>ejb/MyFirstDemo</ejb-ref-name>  <!-- This this matches jndi-name in the other ejb/ear file -->
>     <ejb-ref-type>Entity</ejb-ref-type>
>     <home>com.firstdemo.MyFirstDemoHome</home>
>     <remote>com.firstdemo.MyFirstDemo</remote>
>   </ejb-ref>
> </session>
>
>
> Geronimo 1.1.1 is not able to find the required bean and throws an error during deployment.
>
> The ear2.ear file contains the following stuff:
> - ejb2.jar file
> - client stubs from the ejb1.jar
>
>
> Has anybody an idea what might be missing im my deployment plan or could help me out with a working deployment plan?
>
> Thanks in advance,
>
> Markus
>
> Benachrichtigung bei E-Mail Empfang! - http://mail.lycos.de/app/lycosinside/setupLI.exe