[prev in list] [next in list] [prev in thread] [next in thread] 

List:       geronimo-user
Subject:    Re: EJB Circular problem
From:       Sean McCarthy <scmccarthys () gmail ! com>
Date:       2012-01-13 9:27:31
Message-ID: CAHR-LHwX4XvO04h9ffDMW-NWp0zhBZys_joDRhYSyzmxoz4pkQ () mail ! gmail ! com
[Download RAW message or body]

Hi,

Thanks Viola. My mistake. I was using Geronimo 2.2.1, and I've found the
problem. I was setting the MinSize of the StatelessContainer to 20. If I
set the MinSize to 0 it works flawlessly.

I don't know if it is the intended behavior for the container, but It was
trying to generate the objects for the pool before completing the EJB
resolution process. The JNDI injection information of  @EJB annotations was
not available for beans not resolved yet. I was getting a lot of:

2012-01-13 01:26:06,280 WARN  [OpenEJB] Injection data not found in JNDI
context: jndiName='com.ias.test.BeanA/beanB',
target=com.ias.test.BeanA/beanB
2012-01-13 01:26:06,281 INFO  [OpenEJB] invoking method create on
test.circular.ejb.jar/BeanB

So when the container was creating the instances of BeanB for the pool, it
was trying to inject BeanA into BeanB, but BeanA's information was not
available at the jndi. After that, when the container was creating BeanA
instances, BeanB was available, so it didn't fail. Still, at runtime,
BeanA's reference inside BeanB was null, but BeanB's reference in BeenA
were ok.

I have tested if the new instances of BeanB that get created after the
first 20 instances get evicted, are created correctly.

A strange behavior, one would expect that the container will not try to
create Bean instances until all the JNDI binding is complete. Is this a bug
or an intended behavior for stateless beans?

Thanks,

     Sean

On Fri, Jan 13, 2012 at 12:57 AM, viola lu <viola.lu@gmail.com> wrote:

> Openejb version in Geronimo 2.2 is 3.1.2, you can try geronimo 2.2.1, its
> openejb version is 3.1.4
>
>
> On Fri, Jan 13, 2012 at 1:17 AM, Sean McCarthy <scmccarthys@gmail.com>wrote:
>
>> Hi,
>>
>> I'm having a problem with an ear that I'm deploying to deploy on Geronimo
>> 2.2. The problem is that two beans reference each other (in the same
>> ejb.jar in the ear):
>>
>> class BeanA implements BeanAInterface {
>>
>> @EJB
>> BeanBInterface beanB
>>
>> }
>>
>> class BeanB implements BeanBInterface {
>>
>> @EJB
>> BeanAInterface beanA
>>
>> }
>>
>> The problem is that they do get deployed but on runtime the B's reference
>> to BeanA is null. I know they should have been resolved by the time it gets
>> to make the call to the object, but no matter what I do the reference is
>> always null. I've check the deployment log and I can see that BeanB loads
>> before BeanA so beanB reference in BeanA is ok, but the beanA reference on
>> BeanB never gets loaded.
>>
>> I've checked openejb docs and they state that this scenario should be
>> supported on OpenEJB 3.1.4.
>>
>> Thanks,
>>
>>    Sean McCarthy
>>
>>
>>
>>
>
>
> --
> viola
>
> Apache Geronimo
>
>

[Attachment #3 (text/html)]

Hi,<br><br>Thanks Viola. My mistake. I was using Geronimo 2.2.1, and I&#39;ve found \
the problem. I was setting the MinSize of the StatelessContainer to 20. If I set the \
MinSize to 0 it works flawlessly.<br><br>I don&#39;t know if it is the intended \
behavior for the container, but It was trying to generate the objects for the pool \
before completing the EJB resolution process. The JNDI injection information of  @EJB \
annotations was not available for beans not resolved yet. I was getting a lot of:<br> \
<br>2012-01-13 01:26:06,280 WARN  [OpenEJB] Injection data not found in JNDI context: \
jndiName=&#39;com.ias.test.BeanA/beanB&#39;, \
target=com.ias.test.BeanA/beanB<br>2012-01-13 01:26:06,281 INFO  [OpenEJB] invoking \
method create on test.circular.ejb.jar/BeanB<br> <br>So when the container was \
creating the instances of BeanB for the pool, it was trying to inject BeanA into \
BeanB, but BeanA&#39;s information was not available at the jndi. After that, when \
the container was creating BeanA instances, BeanB was available, so it didn&#39;t \
fail. Still, at runtime, BeanA&#39;s reference inside BeanB was null, but BeanB&#39;s \
reference in BeenA were ok.<br> <br>I have tested if the new instances of BeanB that \
get created after the first 20 instances get evicted, are created correctly.<br><br>A \
strange behavior, one would expect that the container will not try to create Bean \
instances until all the JNDI binding is complete. Is this a bug or an intended \
behavior for stateless beans?<br> <br>Thanks,<br><br>     Sean<br><br><div \
class="gmail_quote">On Fri, Jan 13, 2012 at 12:57 AM, viola lu <span dir="ltr">&lt;<a \
href="mailto:viola.lu@gmail.com">viola.lu@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> Openejb version in Geronimo 2.2 is 3.1.2, you can try \
geronimo 2.2.1, its openejb version is 3.1.4<div class="HOEnZb"><div \
class="h5"><br><br><div class="gmail_quote">On Fri, Jan 13, 2012 at 1:17 AM, Sean \
McCarthy <span dir="ltr">&lt;<a href="mailto:scmccarthys@gmail.com" \
target="_blank">scmccarthys@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi,<br><br>I&#39;m having a problem with an ear that I&#39;m \
deploying to deploy on Geronimo 2.2. The problem is that two beans reference each \
other (in the same ejb.jar in the ear):<br>

<br>class BeanA implements BeanAInterface {<br>
<br>@EJB<br>BeanBInterface beanB <br><br>}<br><br>class BeanB implements \
BeanBInterface {<br><br>@EJB<br>BeanAInterface beanA<br><br>}<br><br>The problem is \
that they do get deployed but on runtime the B&#39;s reference to BeanA is null. I \
know they should have been resolved by the time it gets to make the call to the \
object, but no matter what I do the reference is always null. I&#39;ve check the \
deployment log and I can see that BeanB loads before BeanA so beanB reference in \
BeanA is ok, but the beanA reference on BeanB never gets loaded.<br>


<br>I&#39;ve checked openejb docs and they state that this scenario should be \
supported on OpenEJB 3.1.4.<br><br>Thanks,<span><font color="#888888"><br><br>   Sean \
McCarthy<br><br><br><br> </font></span></blockquote></div><br><br \
clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- \
<br>viola<div><br></div><div>Apache Geronimo</div><br> \
</font></span></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic