Hi,
I have created a datasource in tomee.xml. I created a sample web app to test
the datasource and I am able lookup the datasource successfully using "new
InitialContext().lookup("java:openejb/Resource/MyDs")".
My aim is to deploy the ear (huge app) which is currently running on
Weblogic. My ear contains ejbs and 3 web apps. We have a JNDI utility class
in a util jar which is used to create the initial context and do lookup. I
updated the utility class to lookup DS resource in TomEE. Now, the same
lookup mechanism I used in sample web app is failing with below exception. I
understand that it is working fine in web context, but not from a jar in
ear. Can someone help me here? Thanks in advance.
javax.naming.NameNotFoundException: Name [java:openejb/Resource] is not
bound in this Context. Unable to find [java:openejb].
at org.apache.naming.NamingContext.lookup(NamingContext.java:819)
at org.apache.naming.NamingContext.lookup(NamingContext.java:167)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at
com.cubic.cts.util.InitialContextLocator.locate(InitialContextLocator.java:46)
at
com.cubic.cts.util.InitialContextLocator.locate(InitialContextLocator.java:55)
at
com.cubic.ncs.main.jdbc.BaseResourceManager.getConnection(BaseResourceManager.java:129)
at
com.cubic.ncs.main.jdbc.ResourceManager.getConnection(ResourceManager.java:14)
Thanks & Regards,
Srinivas Atluri
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/TomEE-Fail-to-lookup-Datasource-from-a-class-in-ear-tp4676718.html
Sent from the TomEE Users mailing list archive at Nabble.com.