tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: How to access EJB through JNDI lookup from non EJB class in the same server
Date Tue, 03 Sep 2013 06:02:24 GMT
Hi

Use remote name (in the log, should be TransferRemoreRemote)
Le 3 sept. 2013 07:12, "amol.p.dongare" <ad1@3ds.com> a écrit :

> Hello,
>
> I want to access EJB 2.0 from non bean class through JNDI lookup(both are
> running in same JVM). But it throws javax.naming.NameNotFoundException:
> Name
> "*comp/env/ejb/testrefer*" not found.
>
> Please help
> My JNDI lookup code is
>
>                       *  Properties props = new Properties();
>
>                         //props.put(Context.INITIAL_CONTEXT_FACTORY,
>
> "org.apache.openejb.client.RemoteInitialContextFactory");
>                         //props.put("java.naming.provider.url",
> "http://localhost:8080/tomee/ejb");
>
>                         InitialContext ctx = new InitialContext();
>                         TransferRemore obj =
> ctx.lookup("java:comp/env/ejb/testrefer");*
>
>
> Please suggest workaround.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/How-to-access-EJB-through-JNDI-lookup-from-non-EJB-class-in-the-same-server-tp4664958.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message