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: NullPointerException when JNDI lookup for remote bean
Date Tue, 21 Feb 2012 15:21:16 GMT
Hi,

are you sure your bean is deployed with this name?

- Romain


2012/2/21 anas4120 <anas_taud@yahoo.fr>

> I deploy a stateless bean on apache-tomee-1.0.0-beta-2-plus.
> But when I try to get the remote interface a NullPointerException is
> throwed.
> I do not have this problem with previous version of OpenEJB (version 3.14
> on
> tomcat 6.0.29)
>
> Test client:
> ...
> Properties p = new Properties();
> p.put("java.naming.factory.initial",
> "org.apache.openejb.client.RemoteInitialContextFactory");
> p.put("java.naming.provider.url", "http://localhost:8080/openejb/ejb");
> InitialContext ctx = new InitialContext(p);
> MyBean myBean = (MyBean) ctx.lookup("MyBeanRemote");
> ...
>
> Exception at ctx.lookup(..):
> java.lang.NullPointerException
>    at
>
> org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:188)
>    at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232)
>    at javax.naming.InitialContext.lookup(InitialContext.java:392)
>    at com.test.MyTestCase.setUp(MyTestCase.java:99)
>    at junit.framework.TestCase.runBare(TestCase.java:132)
>    at junit.framework.TestResult$1.protect(TestResult.java:110)
>    at junit.framework.TestResult.runProtected(TestResult.java:128)
>    at junit.framework.TestResult.run(TestResult.java:113)
>    at junit.framework.TestCase.run(TestCase.java:124)
>    at junit.framework.TestSuite.runTest(TestSuite.java:243)
>    at junit.framework.TestSuite.run(TestSuite.java:238)
>    at
>
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
>    at
>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>    at
>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
> Any idea ?
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/NullPointerException-when-JNDI-lookup-for-remote-bean-tp4407278p4407278.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

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