users@glassfish.java.net

Re: Accessing EJB in different EAR?

From: Sahoo <sahoo_at_sun.com>
Date: Wed, 28 Jan 2009 18:12:40 +0530

Two things you have to ensure:
1. ABSession has to be a remote business interface, for local EJBs are
only accessible from components within the same ear.

2. Package the client view classes (ABSession and its dependencies in
your case) in the client ear file.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>