Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » JNDI lookup from OSGI equinox bundle deployed on tomcat (bridged mode)
icon4.gif  JNDI lookup from OSGI equinox bundle deployed on tomcat (bridged mode) [message #1403649] Thu, 24 July 2014 20:04
Amey Borkar is currently offline Amey BorkarFriend
Messages: 5
Registered: June 2014
Junior Member
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?
Previous Topic:Cannot query _SELF_ profile [SOLVED]
Next Topic:Using p2 to maintain an "exact" installation [SOLVED]
Goto Forum:
  


Current Time: Mon Oct 25 14:20:03 GMT 2021

Powered by FUDForum. Page generated in 0.01283 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top