felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amey_borkar <ameyborka...@gmail.com>
Subject JNDI lookup from OSGI bundle deployed on tomcat (bridged mode)
Date Thu, 24 Jul 2014 20:05:37 GMT

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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message