tags:

views:

48

answers:

2

which Stateless bean instance assigned to EJB object to serve the client, when two Stateless beans implements single remote interface and with same name

Ex:

@Stateless(name="KING")
public class One implements RemoteInterface{

}

@Stateless(name="KING")
public class Two implements RemoteInterface{

}
A: 

I suppose you will likely to get CreateException or NameAlreadyBoundException, not sure though. Try it out, why not?

Adeel Ansari
I have tried before posting this question. But I not getting any exception and always getting instance of same bean.
Pokuri
Show us the code. How you are trying to get that? and instance of which bean?
Adeel Ansari
Yes, I have got an Exception stating that name is already bound. Previously I was using JBOSS 4.2.2, which was not throwing any exception. Now, I have changed the server to JBOSS 4.2.3. Now I got the exception
Pokuri
A: 

Probably one will override the other if it doesn't throw exception

MCA