You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mauro2java2011 <ma...@gmail.com> on 2015/09/16 18:10:24 UTC

ejb-ref for a ejb remote

hi all. 
from the ejb faq of glassfsih i read that for resolve the ejb-ref with a
remote ejb i have to put into glassfish-web.xml or sun-web.xml  the
following snippet of xml 
 

Within sun-web.xml :

  <ejb-ref>
    <ejb-ref-name>fooejbref</ejb-ref-name>
    <jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>
  </ejb-ref>

next into a servlet for example i can resolve the dependencies on ejb remote
like a ejb on the local server .

  @EJB(name="fooejbref")
  private FooRemote fooRemote;

----------------------------------

if you read is  setted the jndi-name with
<*jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>*


so  if I have multiple instances of the Appserver running and I want to
access a Remote EJB component between them i can resolve the dependencies 
of remote ejb .

NOw suppose that i would to make the same thing but with 2 tomee on
different host.

like i can set the ejb-refernece ?

i have to put into META-INF/resources.xml a xml with:

 <ejb-ref>
    <ejb-ref-name>fooejbref</ejb-ref-name>
    <jndi-name>corbaname:hostnameremote/ejb/#Foo</jndi-name>
</ejb-ref>
???????

i would resolve the ejb dependence remote without jndilookup  but with :

@EJB(name="fooejbref")
  private FooRemote fooRemote; 

and  EJB-REF where specify the location of tomee and ejb remote.


  




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ejb-ref for a ejb remote

Posted by mauro2java2011 <ma...@gmail.com>.
thank you all .
It was just what I was looking for.

Mauro



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255p4676264.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ejb-ref for a ejb remote

Posted by Romain Manni-Bucau <rm...@gmail.com>.
tomee.xml is good, resources.xml should be supported but can't recall out
of my head if it is actually the case. If not please open an issue ;)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-16 9:46 GMT-07:00 Arthur Portas <ar...@itsector.pt>:

> Hi,
>
> i use like this:
> /* SERVICES */
> @EJB(mappedName = "jndi:ext://itsector/RTimorServiceRemote")
> RTimorServiceRemote rtimorServiceRemote;
>
> to inject remore refs deployed on the same or another instance of TomEE.
>
>
> 2015-09-16 17:19 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
>
> > Hi
> >
> > with tomee the easiest is using jndi:ext I guess:
> > http://tomee.apache.org/ejb-refs.html
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-09-16 9:10 GMT-07:00 mauro2java2011 <ma...@gmail.com>:
> >
> > > hi all.
> > > from the ejb faq of glassfsih i read that for resolve the ejb-ref with
> a
> > > remote ejb i have to put into glassfish-web.xml or sun-web.xml  the
> > > following snippet of xml
> > >
> > >
> > > Within sun-web.xml :
> > >
> > >   <ejb-ref>
> > >     <ejb-ref-name>fooejbref</ejb-ref-name>
> > >     <jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>
> > >   </ejb-ref>
> > >
> > > next into a servlet for example i can resolve the dependencies on ejb
> > > remote
> > > like a ejb on the local server .
> > >
> > >   @EJB(name="fooejbref")
> > >   private FooRemote fooRemote;
> > >
> > > ----------------------------------
> > >
> > > if you read is  setted the jndi-name with
> > > <*jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>*
> > >
> > >
> > > so  if I have multiple instances of the Appserver running and I want to
> > > access a Remote EJB component between them i can resolve the
> dependencies
> > > of remote ejb .
> > >
> > > NOw suppose that i would to make the same thing but with 2 tomee on
> > > different host.
> > >
> > > like i can set the ejb-refernece ?
> > >
> > > i have to put into META-INF/resources.xml a xml with:
> > >
> > >  <ejb-ref>
> > >     <ejb-ref-name>fooejbref</ejb-ref-name>
> > >     <jndi-name>corbaname:hostnameremote/ejb/#Foo</jndi-name>
> > > </ejb-ref>
> > > ???????
> > >
> > > i would resolve the ejb dependence remote without jndilookup  but with
> :
> > >
> > > @EJB(name="fooejbref")
> > >   private FooRemote fooRemote;
> > >
> > > and  EJB-REF where specify the location of tomee and ejb remote.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>

Re: ejb-ref for a ejb remote

Posted by Arthur Portas <ar...@itsector.pt>.
Hi,

i use like this:
/* SERVICES */
@EJB(mappedName = "jndi:ext://itsector/RTimorServiceRemote")
RTimorServiceRemote rtimorServiceRemote;

to inject remore refs deployed on the same or another instance of TomEE.


2015-09-16 17:19 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:

> Hi
>
> with tomee the easiest is using jndi:ext I guess:
> http://tomee.apache.org/ejb-refs.html
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com>
>
> 2015-09-16 9:10 GMT-07:00 mauro2java2011 <ma...@gmail.com>:
>
> > hi all.
> > from the ejb faq of glassfsih i read that for resolve the ejb-ref with a
> > remote ejb i have to put into glassfish-web.xml or sun-web.xml  the
> > following snippet of xml
> >
> >
> > Within sun-web.xml :
> >
> >   <ejb-ref>
> >     <ejb-ref-name>fooejbref</ejb-ref-name>
> >     <jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>
> >   </ejb-ref>
> >
> > next into a servlet for example i can resolve the dependencies on ejb
> > remote
> > like a ejb on the local server .
> >
> >   @EJB(name="fooejbref")
> >   private FooRemote fooRemote;
> >
> > ----------------------------------
> >
> > if you read is  setted the jndi-name with
> > <*jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>*
> >
> >
> > so  if I have multiple instances of the Appserver running and I want to
> > access a Remote EJB component between them i can resolve the dependencies
> > of remote ejb .
> >
> > NOw suppose that i would to make the same thing but with 2 tomee on
> > different host.
> >
> > like i can set the ejb-refernece ?
> >
> > i have to put into META-INF/resources.xml a xml with:
> >
> >  <ejb-ref>
> >     <ejb-ref-name>fooejbref</ejb-ref-name>
> >     <jndi-name>corbaname:hostnameremote/ejb/#Foo</jndi-name>
> > </ejb-ref>
> > ???????
> >
> > i would resolve the ejb dependence remote without jndilookup  but with :
> >
> > @EJB(name="fooejbref")
> >   private FooRemote fooRemote;
> >
> > and  EJB-REF where specify the location of tomee and ejb remote.
> >
> >
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
> >
>

Re: ejb-ref for a ejb remote

Posted by Arthur Portas <ar...@itsector.pt>.
I have this inside tomee.xml

<JndiProvider id="itsector" type="javax.naming.InitialContext">
java.naming.factory.initial =
org.apache.openejb.client.RemoteInitialContextFactory
java.naming.provider.url = http://127.0.0.1:8080/tomee/ejb
 </JndiProvider>

2015-09-16 17:38 GMT+01:00 mauro2java2011 <ma...@gmail.com>:

> ok!!!!
> but the openejb.xml file where i put it ?
> or the fragment:
> --------------------------------
>  <JndiProvider id="shoe" type="javax.naming.InitialContext">
>     java.naming.provider.url = ejbd://localhost:4201
>     java.naming.factory.initial =
> org.apache.openejb.client.RemoteInitialContextFactory
>   </JndiProvider>
>
> ----------------------------------------
> i can put it into tomee.xml ?
> it is the same thing if i put the same resource (<JndiProvider>
>  into tomee.xml or resources.xml???
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <openejb>
>
>   <JndiProvider id="shoe" type="javax.naming.InitialContext">
>     java.naming.provider.url = ejbd://localhost:4201
>     java.naming.factory.initial =
> org.apache.openejb.client.RemoteInitialContextFactory
>   </JndiProvider>
>
> </openejb>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255p4676258.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: ejb-ref for a ejb remote

Posted by mauro2java2011 <ma...@gmail.com>.
ok!!!! 
but the openejb.xml file where i put it ?
or the fragment:
--------------------------------
 <JndiProvider id="shoe" type="javax.naming.InitialContext">
    java.naming.provider.url = ejbd://localhost:4201
    java.naming.factory.initial =
org.apache.openejb.client.RemoteInitialContextFactory
  </JndiProvider>

----------------------------------------
i can put it into tomee.xml ?
it is the same thing if i put the same resource (<JndiProvider>
 into tomee.xml or resources.xml???


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<openejb>

  <JndiProvider id="shoe" type="javax.naming.InitialContext">
    java.naming.provider.url = ejbd://localhost:4201
    java.naming.factory.initial =
org.apache.openejb.client.RemoteInitialContextFactory
  </JndiProvider>

</openejb>



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255p4676258.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: ejb-ref for a ejb remote

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

with tomee the easiest is using jndi:ext I guess:
http://tomee.apache.org/ejb-refs.html


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-16 9:10 GMT-07:00 mauro2java2011 <ma...@gmail.com>:

> hi all.
> from the ejb faq of glassfsih i read that for resolve the ejb-ref with a
> remote ejb i have to put into glassfish-web.xml or sun-web.xml  the
> following snippet of xml
>
>
> Within sun-web.xml :
>
>   <ejb-ref>
>     <ejb-ref-name>fooejbref</ejb-ref-name>
>     <jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>
>   </ejb-ref>
>
> next into a servlet for example i can resolve the dependencies on ejb
> remote
> like a ejb on the local server .
>
>   @EJB(name="fooejbref")
>   private FooRemote fooRemote;
>
> ----------------------------------
>
> if you read is  setted the jndi-name with
> <*jndi-name>corbaname:iiop:host2:3700#Foo</jndi-name>*
>
>
> so  if I have multiple instances of the Appserver running and I want to
> access a Remote EJB component between them i can resolve the dependencies
> of remote ejb .
>
> NOw suppose that i would to make the same thing but with 2 tomee on
> different host.
>
> like i can set the ejb-refernece ?
>
> i have to put into META-INF/resources.xml a xml with:
>
>  <ejb-ref>
>     <ejb-ref-name>fooejbref</ejb-ref-name>
>     <jndi-name>corbaname:hostnameremote/ejb/#Foo</jndi-name>
> </ejb-ref>
> ???????
>
> i would resolve the ejb dependence remote without jndilookup  but with :
>
> @EJB(name="fooejbref")
>   private FooRemote fooRemote;
>
> and  EJB-REF where specify the location of tomee and ejb remote.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ejb-ref-for-a-ejb-remote-tp4676255.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>