lookup failed in tomee

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

lookup failed in tomee

VikasRathee

I have one webservice project and one EJB 3.0 project deployed in Tomee
plume in same EAR. From webservice class i'm calling EJB bean class using
remote interface. i have used multiple InitialContextFactory object, but
nothing seems to work . Each time i'm getting

*javax.naming.NameNotFoundException: Name "TestRemote" not found*

while deployment, this log is coming in server.

*08-Sep-2017 16:23:09.587 INFO [main]
org.apache.openejb.assembler.classic.JndiBuilder.bind Jndi(name=TestRemote)
--> Ejb(deployment-id=Test)*

Here is the code from my webservice class

    /    Properties properties = new Properties();
        properties.put("java.naming.factory.initial",
"org.apache.openejb.core.OpenEJBInitialContextFactory");
        properties.put("java.naming.provider.url", "http://localhost:8081");
        InitialContext ic = new InitialContext(properties);
        TestRemote PSBR = (TestRemote) ic.lookup("TestRemote");/

Apart from OpenEJBInitialContextFactory, i have tried
*org.apache.openejb.core.LocalInitialContextFactory and
RemoteInitialContextFactory* but getting the same error each time.



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

Re: lookup failed in tomee

Romain Manni-Bucau
Hi Vikas

You dont use the remote context factory, is it intended? If so the provider
url is ignored

Le 8 sept. 2017 17:49, "VikasRathee" <[hidden email]> a écrit :


I have one webservice project and one EJB 3.0 project deployed in Tomee
plume in same EAR. From webservice class i'm calling EJB bean class using
remote interface. i have used multiple InitialContextFactory object, but
nothing seems to work . Each time i'm getting

*javax.naming.NameNotFoundException: Name "TestRemote" not found*

while deployment, this log is coming in server.

*08-Sep-2017 16:23:09.587 INFO [main]
org.apache.openejb.assembler.classic.JndiBuilder.bind Jndi(name=TestRemote)
--> Ejb(deployment-id=Test)*

Here is the code from my webservice class

    /    Properties properties = new Properties();
        properties.put("java.naming.factory.initial",
"org.apache.openejb.core.OpenEJBInitialContextFactory");
        properties.put("java.naming.provider.url", "http://localhost:8081");
        InitialContext ic = new InitialContext(properties);
        TestRemote PSBR = (TestRemote) ic.lookup("TestRemote");/

Apart from OpenEJBInitialContextFactory, i have tried
*org.apache.openejb.core.LocalInitialContextFactory and
RemoteInitialContextFactory* but getting the same error each time.



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

Re: lookup failed in tomee

VikasRathee
Thanks, it is working fine with remote context factory and in url i added
http://127.0.0.1:8081/tomee/ejb



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html