title: JNDI lookup fails websphere JRE1.8
body: <p>I am migrating a legacy java/websphere application to JRE1.8</p>
  <p>JNDI lookup code (below) works fine in websphere8.5.5(JRE1.7) but throws Exception in websphere8.5.5(JRE1.8)</p>
  <p><em>[Root exception is com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object.
  [Root exception is javax.xml.parsers.FactoryConfigurationError: Provider javax.xml.parsers.DocumentBuilderFactory could not be instantiated:
  java.util.ServiceConfigurationError: javax.xml.parsers.DocumentBuilderFactory: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not a subtype]]</em></p>
  <pre><code>        javax.naming.InitialContext ctx = new javax.naming.InitialContext();
          ds = (javax.sql.DataSource) ctx.lookup(&quot;java:comp/env/&quot; + dsJNDIname);
  </code></pre>
  <p>I am sure, JNDI exists and valid. I tried looking up &quot;java:comp/env/&quot; with below code, still fails with Exception &quot;<em>Name  not found in context &quot;java:&quot;.</em>&quot;</p>
  <pre><code>        javax.naming.InitialContext ctx = new javax.naming.InitialContext();
          javax.naming.Context cxt = (javax.naming.Context) ctx.lookup(&quot;java:/comp/env/&quot;);
  </code></pre>
  <p>For the upgrade all I did was just rebuilding the source code in new workspace with JRE1.8.
  No code or config changes. Not sure, if I would require changes to web.xml or ejb-jar.xml etc</p>
  <p>Any suggestions appreciated.</p>