[jboss-user] [JNDI and Naming] - EJB2 SB calls EJB3 SB and gets wrong Remote Interface

magicroomy do-not-reply at jboss.com
Fri Oct 16 07:24:00 EDT 2009

i encountered a strange behaviour in JBoss 5.1.0 if a EJB2 SessionBean tries to lookup a EJB3 Session Bean.

The situation is as follows:

1. The EJB3 is coded like that:
public class EJB3Bean implements EJB3

2. EJB3Home looks like this:
public interface EJB3Home extends EJBHome
   public EJB3Remote create() throws CreateException, RemoteException;

3. EJB3 is the EJB3 Business Remote Interface and looks like this:
public interface EJB3 
   public void doThings()  ;

4. EJB3Remote is a Remote Interface according to the EJB2 Spec:

public interface EJB3Remote extends EJBObject
    public void doThings() throws RemoteException ;

5. For the EJB2 there is a deployment descriptor defined. The section for the EJB2 Session Bean contains the following ejb-ref:

6. The EJB2 does a Lookup like
Object obj = jndi.lookup("EJB2Remote") ;

What i would expect is an object implementing EJB3Home.
I can call create() with it and get a EJB3Remote Object.

But what i get instead is an object of type EJB3, the Business Interface.
This confuses me and is different to Bea Weblogic 10.3.1.
Bea correctly delivers the Home.

Since we have to develop for Bea and JBoss i need to find a way to get the Remote Interfaces the same way.

Anything i did wrong to get the EJB3Home?

I already checked the following links for help:

Both articles presented ways to interact that did not work on both App Servers.


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260729#4260729

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260729

More information about the jboss-user mailing list