Hi

Well it depends what you want to do lazily. If it is to resolve the new
InitialContext we dont support it yet that said in general this doesnt
require a connection.

If it is the lookup itself you can inject this remoteContext in your bean
and do the lookup later:


@Resource(lookup = "openejb:remote_jndi_contexts/remoteContext")
private Context ctx;




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-03-05 23:40 GMT+01:00 mohben <[email protected]>:

> I have two apps, injecting an ejb works like a charm when the dependent app
> is already up deployed :
>
> <JndiProvider id="remoteContext" type="javax.naming.InitialContext">
>         java.naming.provider.url = http://localhost:8081/tomee/ejb
>         java.naming.factory.initial =
> org.apache.openejb.client.RemoteInitialContextFactory
> </JndiProvider>
>
> @EJB(mappedName="jndi:ext://remoteContext/MyServiceRemote")
> MyServiceRemote myServiceRemote;
>
> In case of deployment order is not forced (in tomee.xml/server.xml), I
> would
> like to lookup for the remote bean at demand but using a context defined by
> JndiProvider (in tomee.xml) :
>
> MyServiceRemote myServiceRemote = (MyServiceRemote) new
> InitialContext().lookup("jndi:ext://remoteContext/MyServiceRemote");
>
> Is there anyway to lookup into "jndi:ext://*" ?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Lookup-not-inject-an-ejb-throught-a-context-defined-by-JndiProvider-tp4673947.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Reply via email to