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?



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:

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 {

BeanBInterface beanB


class BeanB implements BeanBInterface {

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.


   Sean McCarthy


Apache Geronimo