Hi Jean,
It does work when doing in Karaf directly where jndi was installed. When I was doing with Camel tests with blueprint it fails.. may be something to do with FelixConnect. I did run the same tests with pax-exam all went fine. +Kamesh Get Outlook for Android On Mon, Jun 6, 2016 at 1:53 AM -0700, "Jean-Baptiste Onofré" <[email protected]> wrote: 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
