1 Reply Latest reply on Jun 18, 2007 10:43 AM by Aaron Steele

    Reverse engineering - Could not obtain connection metadata

    David Libke Newbie

      I am using JBoss IDE 1.6.0 GA and JBoss 4.0.2 GA and Oracle 10g.

      Using the new connection wizard, I generated this hibernat.cfg.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      <hibernate-configuration>
      <session-factory>
      oracle.jdbc.driver.OracleDriver
      password
      jdbc:oracle:thin:@sampr01.world
      jwestra
      SAM_DATA
      org.hibernate.dialect.Oracle9Dialect
      </session-factory>
      </hibernate-configuration>

      and then created the Hibernate Configuration for the perspective. Clicking on the Database icon produces the following error:

      Problem while reading database schema

      And the following warning:

      WARN Worker-33 org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata

      Full stack trace of the exceptions that occur:

      !ENTRY org.hibernate.eclipse 2 30000 2006-11-17 16:19:15.459
      !MESSAGE WARN Worker-33 org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
      !STACK 0
      java.sql.SQLException: Io exception: SO Exception was generated
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
      at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:348)
      at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:151)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
      at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:70)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:67)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:36)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:28)
      at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

      !ENTRY org.hibernate.eclipse.console 4 4 2006-11-17 16:19:15.519
      !MESSAGE Problem while reading database schema
      !STACK 0
      org.hibernate.exception.GenericJDBCException: Getting database metadata
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:61)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
      at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:404)
      at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:68)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:76)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:67)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:36)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:28)
      at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
      Caused by: java.sql.SQLException: Io exception: SO Exception was generated
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
      at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:348)
      at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:151)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
      at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getConnection(JDBCMetaDataDialect.java:294)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:58)
      ... 11 more
      !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-11-17 16:19:15.519
      !MESSAGE java.sql.SQLException: Io exception: SO Exception was generated
      !STACK 0
      java.sql.SQLException: Io exception: SO Exception was generated
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
      at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:348)
      at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:151)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
      at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getConnection(JDBCMetaDataDialect.java:294)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:58)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
      at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:404)
      at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:68)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:76)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:67)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:36)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:28)
      at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
      !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2006-11-17 16:19:15.519
      !MESSAGE java.sql.SQLException: Io exception: SO Exception was generated
      !STACK 0
      java.sql.SQLException: Io exception: SO Exception was generated
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
      at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:348)
      at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:151)
      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
      at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at java.sql.DriverManager.getConnection(Unknown Source)
      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getConnection(JDBCMetaDataDialect.java:294)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:58)
      at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
      at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:404)
      at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:68)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:76)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:67)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:36)
      at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:28)
      at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
      at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

      What other configuration information do I need. I believe that the warning is at the root of the problem, but I do not know how to remove it. What I do know is that the Oracle driver is not receiving properly the information it needs resulting its exception. What is missing?

      Any and all help would be appreciated


      Dave

        • 1. Re: Reverse engineering - Could not obtain connection metada
          Aaron Steele Newbie

          Has anyone been able to solve this issue? I am running into the same problem. I am working with Oracle 10g, eclipse 3.2, and IDE 1.6

          When I try connecting to an Oracle database to do reverse engineeering I get the following error:

          org.hibernate.exception.GenericJDBCException: Getting database metadata
           at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
           at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:61)
           at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:70)
           at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:404)
           at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:68)
           at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$1.execute(LazyDatabaseSchemaWorkbenchAdapter.java:76)
           at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
           at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:67)
           at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:36)
           at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:28)
           at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:69)
           at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
           at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
          Caused by: java.sql.SQLException: invalid arguments in call
           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
           at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
           at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
           at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:494)
           at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
           at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
           at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:816)
           at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
           at java.sql.DriverManager.getConnection(Unknown Source)
           at java.sql.DriverManager.getConnection(Unknown Source)
           at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
           at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getConnection(JDBCMetaDataDialect.java:294)
           at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getMetaData(JDBCMetaDataDialect.java:58)
           ... 11 more



          Here is my hibernate.cfg.xml:

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE hibernate-configuration PUBLIC
           "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
           "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
          <hibernate-configuration>
           <session-factory>
           <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
           <property name="hibernate.connection.password">xxxxx</property>
           <property name="hibernate.connection.url">jdbc:oracle:thin:@nwusa-ars1048.nwusa.local:1521:veria</property>
           <property name="hibernate.connection.username">veria</property>
           <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
           <property name="hibernate.default_schema">veria</property>
           <property name="show_sql">true</property>
           </session-factory>
          </hibernate-configuration>

          Any help would be greatly appreciated.

          - Aaron