users@glassfish.java.net

Accessing EJB in different EAR?

From: <glassfish_at_javadesktop.org>
Date: Wed, 28 Jan 2009 04:06:53 PST

Hi,

I'm trying to achieve the following: I've got a SLSB

package ab.ejb;

import javax.ejb.Stateless;

@Stateless
public class ABSessionBean implements ABSession {
    public String sagHallo(String name) {
        return "Hallo, " + name + " - von ABSessionBean";
    }
}

which I try to access from another SLSB:

package xy.ejb;

import ab.ejb.ABSession;
import javax.ejb.*;

@Remote
public class XYSessionBean implements XYSession {
    @EJB
    ABSession abs;
    public String sayHello(String name) {
        String str = abs.sagHallo(name);
        return str + ". And Hello " + name + " - from XYSessionBean";
    }
}

Both of these reside in their own EAR. Glassfish won't even let me deploy the EAR containing XYSessionBean. I've tried adding the Classpath to ABSessionBean to the Manifest of the XYSessionBean EAR, but to no avail. Could anyone please point me to the necessary steps to get this working. I'm quite positive this has been asked and answered before, but my queries so far haven't yielded any result. I'm using Version 9.1_02 (build b04-fcs) of the Server.

Thanks

Michael
[Message sent by forum member 'mschwind' (mschwind)]

http://forums.java.net/jive/thread.jspa?messageID=328614