tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Forrest Xia <forres...@gmail.com>
Subject how openejb inject stateful session bean instance when there are two EJBs with the same local business interface
Date Wed, 24 Feb 2010 15:05:21 GMT
Hi experts,

I encounter a problem when using EJB in Geronimo server, I know G uses
OpenEJB.

My app is like this.

1. there is a stateful session bean called StatefulBeanA. When deploying to
G server, I see two bean instances generated. One is via ejb-jar.xml, named
as ejb.jar/ejb/StatefulBeanA(a); another is via annotation on the bean
class, deploymentId as ejb.jar/StatefulBeanA(b).

@Stateful
public class StatefulBeanA implements StatefulBeanALocal {
 ...
}

@Local
public interface StatefulBeanALocal {
 ...
}

2. then I want to use the EJB in a servlet via @EJB annotation. For G 2.1.5
snapshot, I see (b) injected into the servlet, but for G 2.2, (a) is
injected. I compared OpenEJB version. G 2.1.5 snapshot uses 3.0.2-SNAPSHOT,
G 2.2 uses 3.1.2.

So my question is how openEJB determine which one to inject when two bean
instances share the same local business interface? Please advise. thanks!

Regards, Forrest

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message