title: JNDI lookup from OSGI equinox bundle deployed on tomcat (bridged mode)
body: <p>I have my datasource configured in tomcat\context.xml. I have deployed a bridge.war provided by Eclipse to get servletbridge environment.</p>
  
  <p>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.</p>
  
  <p>However I get </p>
  
  <pre><code>javax.naming.NoInitialContextException:Cannot instantiate class: org.apache.naming.java.javaURLContextFactory (root cause classnotfound for org.apache.naming.java.javaURLContextFactory)
  </code></pre>
  
  <p>when I try following code in my OSGI bundle</p>
  
  <pre><code>        Context initContext = new InitialContext();
          Context envContext = (Context) initContext.lookup("java:/comp/env");
          DataSource ds = (DataSource) envContext.lookup("jdbc/TestDB");
  </code></pre>
  
  <p>I have added catalina.jar in my osgi container an also as a dependency in my osgi bundle.</p>
  
  <p>My launch.ini of bridge.war  looks like this:</p>
  
  <pre><code>osgi.*=@null
  org.osgi.*=@null
  eclipse.*=@null
  
  osgi.parentClassloader=ext
  osgi.contextClassLoaderParent=ext
  org.osgi.framework.system.packages.extra=org.apache.naming.java
  </code></pre>
  
  <p>Can someone help me with it?</p>