-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Reverse engineering Oracle 9i does nothing!
PostPosted: Mon Jul 13, 2009 6:52 am 
Newbie

Joined: Mon Jul 13, 2009 5:23 am
Posts: 4
Hi All,

I'm trying to reverse engineer an Oracle 9i schema using the hibernatetools Ant task running from Eclipse. I executes "successfully", although I get a warning and no code is generated. I'm using the example here as a guide.

Here are my relevant bits:

hibernate-distribution-3.3.2.GA
HibernateTools-3.2.4.GA-R200905070146-H18
Eclipse version 3.5 NB - not congfigured with Hibernate plugins; I want to do everything through Ant
Oracle9i Release 9.2.0.6.0

build.xml:

Code:
<project name="proj" default="" basedir=".">
   
   <property name="src.dir" value="src"></property>

   <path id="toolslib">
       <path location="lib/hibernate-tools.jar" />
      <path location="lib/hibernate3.jar" />
      <path location="lib/freemarker.jar" />
      <path location="lib/ojdbc14.jar" />
      <path location="lib/commons-logging-1.0.4.jar" />
      <path location="lib/dom4j-1.6.1.jar" />
      <path location="lib/slf4j-api-1.5.8.jar" />
      <path location="lib/slf4j-simple-1.5.8.jar" />
   </path>

   <taskdef name="hibernatetool"
            classname="org.hibernate.tool.ant.HibernateToolTask"
            classpathref="toolslib" />   
   
   <hibernatetool destdir="${src.dir}/generated">
      <jdbcconfiguration configurationfile="hibernate.cfg.xml"/>
      <hbm2java jdk5="true"/>
      <hbm2hbmxml destdir="${src.dir}/hbm" />
   </hibernatetool>

</project>


hibernate.cfg.xml:

Code:
<?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>

        <!-- Database connection settings -->
        <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.url">jdbc:oracle:thin:@server:port:instance</property>
        <property name="connection.username">username</property>
        <property name="connection.password">passwd</property>
        <property name="default_schema">schema</property>

        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>

        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.Oracle9iDialect</property>

        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>

        <!-- Disable the second-level cache  -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>

        <!-- Drop and re-create the database schema on startup -->
        <!--
        <property name="hbm2ddl.auto">update</property>

        <mapping resource="org/hibernate/tutorial/domain/Event.hbm.xml"/>
        -->

    </session-factory>

</hibernate-configuration>


Stack trace:

[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 16 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
[hibernatetool] 16 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[hibernatetool] 16 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[hibernatetool] 16 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 63 [main] INFO org.hibernate.cfg.Configuration - configuring from file: hibernate.cfg.xml
[hibernatetool] 94 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
[hibernatetool] 110 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 110 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
[hibernatetool] 110 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
[hibernatetool] 125 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@server:port:instance
[hibernatetool] 125 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=username, password=****}
[hibernatetool] 391 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: Oracle, version: Oracle9i Release 9.2.0.6.0 - Production
[hibernatetool] JServer Release 9.2.0.6.0 - Production
[hibernatetool] 391 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 9.2.0.3.0
[hibernatetool] 406 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle9iDialect
[hibernatetool] 438 [main] WARN org.hibernate.cfg.SettingsFactory - Could not obtain connection metadata
[hibernatetool] java.sql.SQLException: Unsupported feature
[hibernatetool] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
[hibernatetool] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
[hibernatetool] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
[hibernatetool] at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:690)
[hibernatetool] at oracle.jdbc.OracleDatabaseMetaData.supportsGetGeneratedKeys(OracleDatabaseMetaData.java:4182)
[hibernatetool] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:123)
[hibernatetool] at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
[hibernatetool] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2111)
[hibernatetool] at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
[hibernatetool] at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:83)
[hibernatetool] at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94)
[hibernatetool] at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[hibernatetool] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[hibernatetool] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool] at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool] at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.parseBuildFile(InternalAntRunner.java:191)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:400)
[hibernatetool] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] 438 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 438 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Default schema: careview
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 438 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
[hibernatetool] 438 [main] INFO org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge - Cache provider: org.hibernate.cache.NoCacheProvider
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
[hibernatetool] 438 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
[hibernatetool] 453 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
[hibernatetool] 453 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
[hibernatetool] 453 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 453 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
[hibernatetool] 453 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
[hibernatetool] 485 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:oracle:thin:@cx_full_demo:1521:so9i
[hibernatetool] 13-Jul-2009 11:22:51 org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.4.GA
[hibernatetool] 2. task: hbm2hbmxml (Generates a set of hbm.xml files)
BUILD SUCCESSFUL
Total time: 687 milliseconds

Any help much appreciated! I've looked for a solution to the "Could not obtain connection metadata" warning, but to no avail.

I'm very new at this, BTW....


Top
 Profile  
 
 Post subject: Re: Reverse engineering Oracle 9i does nothing!
PostPosted: Mon Jul 13, 2009 11:32 am 
Newbie

Joined: Mon Jul 13, 2009 5:23 am
Posts: 4
I downloaded the latest Oracle driver, so I've got rid of the "Could not obtain connection metadata", still no code though...


Top
 Profile  
 
 Post subject: Re: Reverse engineering Oracle 9i does nothing!
PostPosted: Tue Jul 14, 2009 7:06 am 
Newbie

Joined: Mon Jul 13, 2009 5:23 am
Posts: 4
Here's the stack trace:

[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 31 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
[hibernatetool] 31 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[hibernatetool] 31 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[hibernatetool] 47 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 94 [main] INFO org.hibernate.cfg.Configuration - configuring from file: hibernate.cfg.xml
[hibernatetool] 172 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
[hibernatetool] 187 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 187 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
[hibernatetool] 187 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
[hibernatetool] 219 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@server:port:instance
[hibernatetool] 219 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=username, password=****}
[hibernatetool] 562 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: Oracle, version: Oracle9i Release 9.2.0.6.0 - Production
[hibernatetool] JServer Release 9.2.0.6.0 - Production
[hibernatetool] 562 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 9.2.0.8.0
[hibernatetool] 578 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle9iDialect
[hibernatetool] 609 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 609 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Default schema: schema
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 609 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
[hibernatetool] 609 [main] INFO org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge - Cache provider: org.hibernate.cache.NoCacheProvider
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
[hibernatetool] 609 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
[hibernatetool] 656 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:oracle:thin:@server:port:instance
[hibernatetool] 14-Jul-2009 11:57:48 org.hibernate.tool.Version <clinit>
[hibernatetool] INFO: Hibernate Tools 3.2.4.GA
BUILD SUCCESSFUL
Total time: 1 second


Top
 Profile  
 
 Post subject: Re: Reverse engineering Oracle 9i does nothing!
PostPosted: Tue Jul 14, 2009 10:49 am 
Newbie

Joined: Mon Jul 13, 2009 5:23 am
Posts: 4
OK, time to feel daft... The schema is defined in upper case. Grr.

(The "username" in the hibernate config is in lower case, so I assumed that the same would apply to the schema.)

So now my .javas and my .hbm.xmls are being generated. Joy!

Awfy lonely in here....


Top
 Profile  
 
 Post subject: Re: Reverse engineering Oracle 9i does nothing!
PostPosted: Sun Aug 02, 2009 7:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Good you found your solution. sorry for the silence but I were on vacation (sad that all those who I/we already helped in here did not help you out but know you know the answer to this and can help others feel less lonely ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Reverse engineering Oracle 9i does nothing!
PostPosted: Tue May 03, 2011 5:00 am 
Newbie

Joined: Tue May 03, 2011 4:50 am
Posts: 1
I'm trying to reverse engineer an Oracle 10g XE schema, and has the same problem as you.
There is no error message, just no code is generated.
I had been googled many days.
Thank you give me the hint "the schema is defined in upper case" to solve my problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.