[jboss-user] [EJB 3.0] - 2 Stateless session beans, same name+interface, different ja
gr28
do-not-reply at jboss.com
Mon Sep 29 07:06:22 EDT 2008
Hello,
using JBoss 4.2.3
We are having a Stateless Session bean with a specific name ("mybean"):
@Local(IBean1.class)
@Stateless(name="mybean")
public class Bean1 implements IBean1 {
The class Bean1 and the interface IBean1 belong to core.jar.
An other SLSB (in core.jar) injects the "mybean" bean:
@EJB(beanName="mybean")
IBean1 beanImpl;
I now want to replace the bean under name "mybean" with a project specific implementation. We add project.jar, which has a dependeny to core.jar. It deploys the following bean:
@Local(IBean1.class)
@Stateless(name="mybean")
public class Bean1Project implements IBean1 {
The "mybean" is now registered under JNDI as follows:
ear=naming.ear,jar=core.jar,name=mybean,service=EJB3
ear=naming.ear,jar=project.jar,name=mybean,service=EJB3
After a simple test I found out that beanImpl gets an instance of Bean1Project injected. Can anyone please explain, why that bean is used?
Is it possible to remove the SLSB from JNDI defined in core.jar without changing core.jar? The requirement is that the product core defines several SLSB that are always deployed and can always be replaced by a project specific implementation.
Thank you for any help!
Georg Raffer
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179322#4179322
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179322
More information about the jboss-user
mailing list