title: Oracle JDBC XMLType NoClassDefFoundError
body: <p>When I try to pass SQLXML object to Oracle stored procedure via JDBC in a Java 6 application running on Weblogic, I am getting the following error:</p>
  
  <blockquote>
  <pre><code>Cause: java.lang.NoClassDefFoundError 
  Location: javax.servlet.ServletException: java.lang.NoClassDefFoundError: oracle/xdb/XMLType 
   java.lang.NoClassDefFoundError: oracle/xdb/XMLType
         at oracle.jdbc.driver.PhysicalConnection.createSQLXML(PhysicalConnection.java:9724)
         at weblogic.jdbc.wrapper.Connection.createSQLXML(Connection.java:1034)
  </code></pre>
  </blockquote>
  
  <p>The relevant part of code:</p>
  
  <pre><code>    String sql = "{call " + procedureName + "(?)}";
      CallableStatement callableStatement = mOracleConnection.prepareCall(sql);
      SQLXML sqlxml = mOracleConnection.createSQLXML();
      DOMResult dr = new DOMResult();
      sqlxml.setResult(DOMResult.class);
      dr.setNode(parameter);
      callableStatement.setSQLXML(1, sqlxml);
      callableStatement.executeUpdate();
      callableStatement.close();
  </code></pre>
  
  <p><a href="http://thinktibits.blogspot.com/2014/08/oracle-xmltype-java-sql-sqlxml-example.html" rel="nofollow">This article</a> attributes the error to the missing xdb.jar.</p>
  
  <p>I downloaded <strong>xdb6.jar</strong> from <a href="http://www.oracle.com/technetwork/apps-tech/jdbc-112010-090769.html" rel="nofollow">Oracle site</a> and seemingly added it to CLASSPATH. </p>
  
  <p>I also double-checked that <code>oracle.xdb.XMLtype</code> class file is present in the JAR.</p>
  
  <p>I am still getting this error.</p>
  
  <p>Any suggestions on further troubleshooting?</p>
  
  <p><strong>EDIT</strong> [11/19/15]:</p>
  
  <p>I added <code>Class.forName("oracle.xdb.XMLType")</code> to test the explicit loading of the "missing" class. After adding <strong>xmlparserv2.jar</strong> into the mix, my test code worked fine, but I got the same exception in <code>PhysicalConnection</code>.</p>
  
  <p>I am using a pooled connection, if it matters.</p>