RMI From TomEE to Jboss

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

RMI From TomEE to Jboss

Joshua Sharf
Is there a way to make an RMI call *from* a TomEE server *to* a JBoss EJB?  I
know we can set up TomEE to host EJBs, but that's not what we want to do.
We want to make the call from TomEE to the remote EJB,

We're running TomEE Plume 7.0.4, and EAP7.

Thanks for any help you can give us,
Joshua Sharf



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

exabrial12
It's likely possible, but whether or not it's a "good idea" is the better
question :) It might be best to see about getting a consultant from
Tomitribe out there to help you.

The process would be something like, use the JBoss InitialContextFactory
and point it at the remote server. Then, you should be able to use that to
perform a lookup. I don't think there will be a way to use @EJB injection,
unless you did some magic with CDI and the @Produces annotation.

A better way would be to wrap your legacy EJBs with RESTful services so
that way you're platform independent.

On Tue, Jul 10, 2018 at 4:29 PM Joshua Sharf <[hidden email]> wrote:

> Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> EJB?  I
> know we can set up TomEE to host EJBs, but that's not what we want to do.
> We want to make the call from TomEE to the remote EJB,
>
> We're running TomEE Plume 7.0.4, and EAP7.
>
> Thanks for any help you can give us,
> Joshua Sharf
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


--
Jonathan | [hidden email]
Pessimists, see a jar as half empty. Optimists, in contrast, see it as half
full.
Engineers, of course, understand the glass is twice as big as it needs to
be.
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

Gurkan Erdogdu-5
Hi Joshua
AFAIK, it is not possible to propagate RMI call from TomEE to JBoss because
TomEE uses its own remote protocol (for example, you can not propagate
distributed transactions). But, you may use JBoss client JARS in TomEE to
call your EJBs in JBoss.
Regards.
Gurkan

On Wed, Jul 11, 2018 at 2:23 AM, Jonathan S. Fisher <[hidden email]>
wrote:

> It's likely possible, but whether or not it's a "good idea" is the better
> question :) It might be best to see about getting a consultant from
> Tomitribe out there to help you.
>
> The process would be something like, use the JBoss InitialContextFactory
> and point it at the remote server. Then, you should be able to use that to
> perform a lookup. I don't think there will be a way to use @EJB injection,
> unless you did some magic with CDI and the @Produces annotation.
>
> A better way would be to wrap your legacy EJBs with RESTful services so
> that way you're platform independent.
>
> On Tue, Jul 10, 2018 at 4:29 PM Joshua Sharf <[hidden email]> wrote:
>
> > Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> > EJB?  I
> > know we can set up TomEE to host EJBs, but that's not what we want to do.
> > We want to make the call from TomEE to the remote EJB,
> >
> > We're running TomEE Plume 7.0.4, and EAP7.
> >
> > Thanks for any help you can give us,
> > Joshua Sharf
> >
> >
> >
> > --
> > Sent from:
> > http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >
>
>
> --
> Jonathan | [hidden email]
> Pessimists, see a jar as half empty. Optimists, in contrast, see it as half
> full.
> Engineers, of course, understand the glass is twice as big as it needs to
> be.
>
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

Romain Manni-Bucau
Hi

If you have the client API it will work as in any app (spring apps always
do that and it will be exactly the same in tomee).

You can even do fun stuff like proxying the jboss calls with an endpoint
redirecring the streams or redirecting an ejbd (tomee) rmi call to jboss
either using a plain client or extenal jndi provider to inject the remote
context config. Not sure it is good compared to having a plain client but
very doable.

Romain


Le mer. 11 juil. 2018 02:16, Gurkan Erdogdu <[hidden email]> a écrit :

> Hi Joshua
> AFAIK, it is not possible to propagate RMI call from TomEE to JBoss because
> TomEE uses its own remote protocol (for example, you can not propagate
> distributed transactions). But, you may use JBoss client JARS in TomEE to
> call your EJBs in JBoss.
> Regards.
> Gurkan
>
> On Wed, Jul 11, 2018 at 2:23 AM, Jonathan S. Fisher <[hidden email]>
> wrote:
>
> > It's likely possible, but whether or not it's a "good idea" is the better
> > question :) It might be best to see about getting a consultant from
> > Tomitribe out there to help you.
> >
> > The process would be something like, use the JBoss InitialContextFactory
> > and point it at the remote server. Then, you should be able to use that
> to
> > perform a lookup. I don't think there will be a way to use @EJB
> injection,
> > unless you did some magic with CDI and the @Produces annotation.
> >
> > A better way would be to wrap your legacy EJBs with RESTful services so
> > that way you're platform independent.
> >
> > On Tue, Jul 10, 2018 at 4:29 PM Joshua Sharf <[hidden email]> wrote:
> >
> > > Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> > > EJB?  I
> > > know we can set up TomEE to host EJBs, but that's not what we want to
> do.
> > > We want to make the call from TomEE to the remote EJB,
> > >
> > > We're running TomEE Plume 7.0.4, and EAP7.
> > >
> > > Thanks for any help you can give us,
> > > Joshua Sharf
> > >
> > >
> > >
> > > --
> > > Sent from:
> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> > >
> >
> >
> > --
> > Jonathan | [hidden email]
> > Pessimists, see a jar as half empty. Optimists, in contrast, see it as
> half
> > full.
> > Engineers, of course, understand the glass is twice as big as it needs to
> > be.
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

jgallimore
In reply to this post by Joshua Sharf
You can certainly make remote calls to JBoss in the same way you would do
with a regular client. You'd need to include the JBoss client jars, and use
the appropriate URL and context factory in your InitialContext. This should
be a reasonable approach.

JBoss itself has the concept of an ExternalContext which effectively maps
an external JNDI into a local one. TomEE doesn't have its own equivalent
that I know of, but it might be possible to come up with something similar.
If I get a chance later this week I'll see if I can hack something up.

Jon

On Tue, Jul 10, 2018 at 10:29 PM, Joshua Sharf <[hidden email]> wrote:

> Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> EJB?  I
> know we can set up TomEE to host EJBs, but that's not what we want to do.
> We want to make the call from TomEE to the remote EJB,
>
> We're running TomEE Plume 7.0.4, and EAP7.
>
> Thanks for any help you can give us,
> Joshua Sharf
>
>
>
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> f979441.html
>
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

Romain Manni-Bucau
The "Referencing a bean in another server" part of
http://tomee.apache.org/ejb-refs.html should already enable several cases.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 11 juil. 2018 à 11:24, Jonathan Gallimore <
[hidden email]> a écrit :

> You can certainly make remote calls to JBoss in the same way you would do
> with a regular client. You'd need to include the JBoss client jars, and use
> the appropriate URL and context factory in your InitialContext. This should
> be a reasonable approach.
>
> JBoss itself has the concept of an ExternalContext which effectively maps
> an external JNDI into a local one. TomEE doesn't have its own equivalent
> that I know of, but it might be possible to come up with something similar.
> If I get a chance later this week I'll see if I can hack something up.
>
> Jon
>
> On Tue, Jul 10, 2018 at 10:29 PM, Joshua Sharf <[hidden email]> wrote:
>
> > Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> > EJB?  I
> > know we can set up TomEE to host EJBs, but that's not what we want to do.
> > We want to make the call from TomEE to the remote EJB,
> >
> > We're running TomEE Plume 7.0.4, and EAP7.
> >
> > Thanks for any help you can give us,
> > Joshua Sharf
> >
> >
> >
> > --
> > Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> > f979441.html
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

jgallimore
Ah - wonder why I haven't seen that before. Thanks for the note. I'll see
if I can throw an example here.

On Wed, Jul 11, 2018 at 10:31 AM, Romain Manni-Bucau <[hidden email]>
wrote:

> The "Referencing a bean in another server" part of
> http://tomee.apache.org/ejb-refs.html should already enable several cases.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/
> rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-
> ee-8-high-performance>
>
>
> Le mer. 11 juil. 2018 à 11:24, Jonathan Gallimore <
> [hidden email]> a écrit :
>
> > You can certainly make remote calls to JBoss in the same way you would do
> > with a regular client. You'd need to include the JBoss client jars, and
> use
> > the appropriate URL and context factory in your InitialContext. This
> should
> > be a reasonable approach.
> >
> > JBoss itself has the concept of an ExternalContext which effectively maps
> > an external JNDI into a local one. TomEE doesn't have its own equivalent
> > that I know of, but it might be possible to come up with something
> similar.
> > If I get a chance later this week I'll see if I can hack something up.
> >
> > Jon
> >
> > On Tue, Jul 10, 2018 at 10:29 PM, Joshua Sharf <[hidden email]>
> wrote:
> >
> > > Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> > > EJB?  I
> > > know we can set up TomEE to host EJBs, but that's not what we want to
> do.
> > > We want to make the call from TomEE to the remote EJB,
> > >
> > > We're running TomEE Plume 7.0.4, and EAP7.
> > >
> > > Thanks for any help you can give us,
> > > Joshua Sharf
> > >
> > >
> > >
> > > --
> > > Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> > > f979441.html
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: RMI From TomEE to Jboss

smithh032772
In reply to this post by exabrial12
On Tue, Jul 10, 2018 at 7:23 PM, Jonathan S. Fisher <[hidden email]>
wrote:

>
> A better way would be to wrap your legacy EJBs with RESTful services
> so that way you're platform independent.
>

+1 I like this approach... even though I am running 2 separate TomEE's on
same machine, they communicate via RESTful services and have been working
really well; I'm sure the code I wrote helps as well.