Hi Kamesh,
Did you install the jndi feature in Karaf ?
This feature provide a InitialContextFactory (which is not the case by
default).
Regards
JB
On 05/26/2016 10:10 AM, Kamesh Sampath wrote:
I am using Apache Aries with Camel, as part of my test with pax-jdbc I
have registered the JNDI datasource via Karaf cfg – it all works fine
when deployed in Karaf, when doing the testing via CamelBlueprintTest am
getting the following error :
“
Caused by: javax.naming.NoInitialContextException: The calling code's
BundleContext could not be determined.
at
org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:46)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
at
javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:341)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at
org.apache.ibatis.datasource.jndi.JndiDataSourceFactory.setProperties(JndiDataSourceFactory.java:52)
“
Where the “ org.apache.ibatis.datasource.jndi.JndiDataSourceFactory.” is
a non-OSGi bundle. After debugging I see the failure happens in
Utils#doGetBundleContext, when it does the “Object bc = env ==
null?null:env.get("osgi.service.jndi.bundleContext");”, wondering if I
am missing any environment property I miss to set.
-Kamesh
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com