You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by amey_borkar <am...@gmail.com> on 2014/07/24 22:05:37 UTC
JNDI lookup from OSGI bundle deployed on tomcat (bridged mode)
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