I have my datasource configured in tomcat\context.xml. I have deployed a
bridge.war provided by Eclipse to get servletbridge environment.

I have developed another osgi bundle which contains servlet registation code
and my aim is to do JNDI look up for datasource from this servlet bundle.

However I get

javax.naming.NoInitialContextException:Cannot instantiate class:
org.apache.naming.java.javaURLContextFactory (root cause classnotfound for
org.apache.naming.java.javaURLContextFactory)

when I try following code in my OSGI bundle

        Context initContext = new InitialContext();
        Context envContext = (Context) initContext.lookup("java:/comp/env");
        DataSource ds = (DataSource) envContext.lookup("jdbc/TestDB");

I have added catalina.jar in my osgi container an also as a dependency in my
osgi bundle.

Can someone help me with it?




--
View this message in context: 
http://apache-felix.18485.x6.nabble.com/JNDI-lookup-from-OSGI-bundle-deployed-on-tomcat-bridged-mode-tp5009154.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to