You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hmmahboobi <hm...@gmail.com> on 2014/04/14 12:54:03 UTC

NameNotFoundException

I have an EJB 3.1 session bean on Weblogic 12c and I want to lookup it in
tomee 1.6, but this error has been occurred:

javax.naming.NameNotFoundException: Name
"global.test-product.service.ReportServiceImpl!com.test.IReportService" not
found.
	at
org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:197)
	at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:151)
	at
org.apache.openejb.core.ivm.ContextHandler.lookup(ContextHandler.java:50)
	at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:126)
	at
org.apache.openejb.core.ivm.ContextHandler.lookup(ContextHandler.java:50)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	at com.test.service.TomeeTest.test(TomeeTest.java:173)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	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)


When I execute this test on simple java class, its works fine and returns
proper object. 
Its seems that on openejb environment, context is bind to openejb, not
weblogic!

Hashtable<String, String> props = new Hashtable<String, String>();
props.put("java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory");
props.put("java.naming.provider.url", "t3://192.168.1.187:7023");
Context c = new InitialContext(props);

IReportService s = (IReportService)
c.lookup("test-product.service.ReportServiceImpl!com.test.IReportService");



--
View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: NameNotFoundException

Posted by hmmahboobi <hm...@gmail.com>.
Ok!

after adding Context.URL_PKG_PREFIXES to context's properties, its works
fine

props.put(Context.URL_PKG_PREFIXES, "weblogic.jndi.factories");

thank you very much



--
View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769p4669002.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: NameNotFoundException

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

maybe you need to customize Context.URL_PKG_PREFIXES to add weblo
package inside.


Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau


2014-04-26 12:48 GMT+02:00 hmmahboobi <hm...@gmail.com>:
> Excuse me for my late response.
> Unfortunately this problem is still exist.
>
> Oracle's wlfullclient.jar is available in my tomee lib directory
> Also I'm write simple Stateless bean and same error has been occurred.
>
> As I mentioned before, my simple java main class works fine with this
> scenario.
>
> Thanks a lot for your assistance
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769p4668996.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: NameNotFoundException

Posted by hmmahboobi <hm...@gmail.com>.
Excuse me for my late response.
Unfortunately this problem is still exist.

Oracle's wlfullclient.jar is available in my tomee lib directory
Also I'm write simple Stateless bean and same error has been occurred.

As I mentioned before, my simple java main class works fine with this
scenario.

Thanks a lot for your assistance



--
View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769p4668996.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: NameNotFoundException

Posted by Andy Gumbrecht <ag...@tomitribe.com>.
Did you find a solution to your issue?

Andy.

On 14/04/2014 12:54, hmmahboobi wrote:
> I have an EJB 3.1 session bean on Weblogic 12c and I want to lookup it in
> tomee 1.6, but this error has been occurred:
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

-- 
   Andy Gumbrecht

   http://www.tomitribe.com
   agumbrecht@tomitribe.com
   https://twitter.com/AndyGeeDe

   TomEE treibt Tomitribe! | http://tomee.apache.org


Re: NameNotFoundException

Posted by agumbrecht <ag...@tomitribe.com>.
Hi,

Are you sure you have all the required libraries available in your
application or on the classpath?

http://docs.oracle.com/cd/E14571_01/web.1111/e13717/basics.htm#i1069993

Check the Tomcat logs and play with the logging level during the test phase.
The WebLogic lookup may be failing and you are not seeing the reason why.

Just try instantiating some of the WebLogic client classes in a simple bean
method to see if the runtime environment has access to them.

Andy



-----
    -- 
    Andy Gumbrecht

    http://www.tomitribe.com | agumbrecht@tomitribe.com | https://twitter.com/AndyGeeDe

    Tomitribe treibt TomEE! | http://tomee.apache.org
--
View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769p4668973.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: NameNotFoundException

Posted by hmmahboobi <hm...@gmail.com>.
any idea?



--
View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769p4668966.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: NameNotFoundException

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

it can be that the lookup ends with an exception and we fallback to
local strategy.

Maybe wrap WLInitialContextFactory to ensure it is correctly instantiated
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-04-14 12:54 GMT+02:00 hmmahboobi <hm...@gmail.com>:
> I have an EJB 3.1 session bean on Weblogic 12c and I want to lookup it in
> tomee 1.6, but this error has been occurred:
>
> javax.naming.NameNotFoundException: Name
> "global.test-product.service.ReportServiceImpl!com.test.IReportService" not
> found.
>         at
> org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:197)
>         at
> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:151)
>         at
> org.apache.openejb.core.ivm.ContextHandler.lookup(ContextHandler.java:50)
>         at
> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:126)
>         at
> org.apache.openejb.core.ivm.ContextHandler.lookup(ContextHandler.java:50)
>         at javax.naming.InitialContext.lookup(InitialContext.java:392)
>         at com.test.service.TomeeTest.test(TomeeTest.java:173)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
>         at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>         at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
>         at
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>         at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
>         at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
>         at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
>         at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
>         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)
>
>
> When I execute this test on simple java class, its works fine and returns
> proper object.
> Its seems that on openejb environment, context is bind to openejb, not
> weblogic!
>
> Hashtable<String, String> props = new Hashtable<String, String>();
> props.put("java.naming.factory.initial",
> "weblogic.jndi.WLInitialContextFactory");
> props.put("java.naming.provider.url", "t3://192.168.1.187:7023");
> Context c = new InitialContext(props);
>
> IReportService s = (IReportService)
> c.lookup("test-product.service.ReportServiceImpl!com.test.IReportService");
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/NameNotFoundException-tp4668769.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.