java.lang.NoClassDefFoundError: oracle/xdb/XMLType

Apache's JIRA Issue Tracker | Charlie Hubbard | 2 years ago
  1. 0

    Trying to load the Oracle driver in Groovy fails with the following error: java.lang.NoClassDefFoundError: oracle/xdb/XMLType at java_sql_Connection$getMetaData.call(Unknown Source) at db_test.printMetaData(db_test.groovy:9) at db_test.printMetaData(db_test.groovy) at db_test$printMetaData$0.callCurrent(Unknown Source) at db_test.run(db_test.groovy:45) Caused by: java.lang.ClassNotFoundException: oracle.xdb.XMLType ... 5 more This works in Groovy 2.1.x. This is loading the thin driver which doesn't require extra libraries. It appears that Groovy loads Oracle's OCI driver which requires these additional jar files and fails. {code} import groovy.sql.Sql import java.sql.ResultSet import java.sql.DatabaseMetaData void printMetaData( Sql sql, catalog = null, schema = null ) { try { DatabaseMetaData metadata = sql.connection.getMetaData() ResultSet rs = metadata.getCatalogs() while( rs.next() ) { String catalogName = rs.getString("TABLE_CAT") println("${catalogName}") } rs.close() rs = metadata.getSchemas() while( rs.next() ) { String catalogName = rs.getString("TABLE_CAT") String schemaName = rs.getString("TABLE_SCHEM") println("${catalogName}.${schemaName}") } rs.close() def types = [ "TABLE" ] rs = metadata.getTables( catalog, schema, null, types.toArray( new String[types.size()]) ) while( rs.next() ) { String catalogName = rs.getString("TABLE_CAT") String schemaName = rs.getString("TABLE_SCHEM") String tableName = rs.getString("TABLE_NAME") println("${catalogName}.${schemaName}.${tableName}") } rs.close() } finally { sql.close() } } oracle = Sql.newInstance("jdbc:oracle:thin:@//localhost:1521/PDB1", "someUser", "somePassword", "oracle.jdbc.driver.OracleDriver") printMetaData( oracle ) {code}

    Apache's JIRA Issue Tracker | 2 years ago | Charlie Hubbard
    java.lang.NoClassDefFoundError: oracle/xdb/XMLType
  2. 0

    Trying to load the Oracle driver in Groovy fails with the following error: java.lang.NoClassDefFoundError: oracle/xdb/XMLType at java_sql_Connection$getMetaData.call(Unknown Source) at db_test.printMetaData(db_test.groovy:9) at db_test.printMetaData(db_test.groovy) at db_test$printMetaData$0.callCurrent(Unknown Source) at db_test.run(db_test.groovy:45) Caused by: java.lang.ClassNotFoundException: oracle.xdb.XMLType ... 5 more This works in Groovy 2.1.x. This is loading the thin driver which doesn't require extra libraries. It appears that Groovy loads Oracle's OCI driver which requires these additional jar files and fails. {code} import groovy.sql.Sql import java.sql.ResultSet import java.sql.DatabaseMetaData void printMetaData( Sql sql, catalog = null, schema = null ) { try { DatabaseMetaData metadata = sql.connection.getMetaData() ResultSet rs = metadata.getCatalogs() while( rs.next() ) { String catalogName = rs.getString("TABLE_CAT") println("${catalogName}") } rs.close() rs = metadata.getSchemas() while( rs.next() ) { String catalogName = rs.getString("TABLE_CAT") String schemaName = rs.getString("TABLE_SCHEM") println("${catalogName}.${schemaName}") } rs.close() def types = [ "TABLE" ] rs = metadata.getTables( catalog, schema, null, types.toArray( new String[types.size()]) ) while( rs.next() ) { String catalogName = rs.getString("TABLE_CAT") String schemaName = rs.getString("TABLE_SCHEM") String tableName = rs.getString("TABLE_NAME") println("${catalogName}.${schemaName}.${tableName}") } rs.close() } finally { sql.close() } } oracle = Sql.newInstance("jdbc:oracle:thin:@//localhost:1521/PDB1", "someUser", "somePassword", "oracle.jdbc.driver.OracleDriver") printMetaData( oracle ) {code}

    Apache's JIRA Issue Tracker | 2 years ago | Charlie Hubbard
    java.lang.NoClassDefFoundError: oracle/xdb/XMLType
  3. 0

    Error on retreving XML type Column

    Stack Overflow | 1 year ago | Mukesh Kumar
    java.lang.NoClassDefFoundError: oracle.xdb.XMLType
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SQuirreL SQL Client / Mailing Lists

    sourceforge.net | 11 months ago
    java.lang.ClassNotFoundException: oracle.xdb.XMLType
  6. 0

    Starting with OrdDicom

    Oracle Community | 7 years ago | 670403
    java.lang.NoClassDefFoundError: oracle/xdb/XMLType

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassNotFoundException

      oracle.xdb.XMLType

      at java_sql_Connection$getMetaData.call()
    2. Unknown
      db_test.run
      1. java_sql_Connection$getMetaData.call(Unknown Source)
      2. db_test.printMetaData(db_test.groovy:9)
      3. db_test.printMetaData(db_test.groovy)
      4. db_test$printMetaData$0.callCurrent(Unknown Source)
      5. db_test.run(db_test.groovy:45)
      5 frames