users@glassfish.java.net

Re: [Fwd: EJB remote communication between two applications within same server]

From: <June.Parks_at_Sun.COM>
Date: Tue, 21 Oct 2008 10:06:52 -0700

I'm not sure what version you are using, but one of the 9.1 manuals has
this section, which might be useful:

http://docs.sun.com/app/docs/doc/819-3672/beadh?a=view

June Parks

On 10/21/08 05:49, Sebastian Hofmann wrote:
> Hi,
>
> I have two enterprise applications (two ear's containing one ejb-jar
> each) running in the same server. Now one bean of app1 should call a
> method of a bean in app2.
>
> I have created a bean (HelloBean) in app2 with a remote interface
> (HelloRemote) implementing a method "public String sayHello()" and
> annotated the interface with @Remote. The bean in app1 should call this
> method, so I created a bean in app1 with a reference "private
> HelloRemote helloRemote" and annotated the reference with @EJB. So far,
> so good.
>
> Thus my app1 now has a compiletime dependency to app2, because of the
> interface "HelloRemote". When deploying the two ears into the server, I
> get a ClassNotFoundException for this interface in app1. That seems to
> be correct since applications are separated by different classloaders...
>
> Now my question is, how to proceed in this case!? Do I have to duplicate
> the remote interface so that the class file of this interface exists in
> both ear's? And what should be done if the remote method should return a
> custom class object? Is there a way of sharing classes between two
> applications or has each common class to be duplicated? Or am I totally
> wrong? ;-)
>
> Thanks for advice...
> Sebastian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>