-->
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.  [ 11 posts ] 
Author Message
 Post subject: Reverse Engineering IncompatibleClassChangeError
PostPosted: Tue May 25, 2010 3:00 pm 
Newbie

Joined: Tue May 25, 2010 2:51 pm
Posts: 4
I'm trying to reverse engineer hbm.xml files, pojos and daos from a SQLServer database. I've been wrestling with it all day, but now I'm stuck and I don't seem to be having much luck researching my own solution.

Here's my build.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="HibernateAnt" basedir=".">
   <property name="src.dir" location="src" />
   <property name="lib.dir" location="WebContent/WEB-INF/lib" />
   <property name="bin.dir" location="build/hibernate" />
<!--
   <path id="project.class.path">
      <path>
         <pathelement location="${lib.dir}/hibernate3.jar" />
         
         <fileset dir="${lib.dir}">
            <include name="**/*.jar" />
         </fileset >
         <pathelement path="${bin.dir}" />
      </path>
   </path>
-->
   <!-- Compile the java source of the project -->
   <target name="compile"  description="Compiles all Java classes">
      <javac srcdir="${src.dir}" destdir="${bin.dir}" debug="on" optimize="off" deprecation="on">
         <classpath refid="project.class.path" />
      </javac>
   </target>
   
   <taskdef name="hibernatetool"
         classname="org.hibernate.tool.ant.HibernateToolTask">
         <classpath>
            <fileset dir="lib">
               <include name="**/*.jar"/>
            </fileset>
         </classpath>
   </taskdef>

   <target name="gen_hibernate"
         description="generate hibernate classes">
      <hibernatetool>
      
         <jdbcconfiguration
            configurationfile="src/config/hibernate.cfg.xml"
            packagename="com.openversion.bus" 
            detectmanytomany="true"
         />
         <hbm2hbmxml destdir="src" />
         <hbm2java   destdir="src" />
      </hibernatetool>
   </target>
</project>


and my hibernate.cfg.xml file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE
   hibernate-configuration
   SYSTEM
   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
>
<hibernate-configuration>
   <session-factory>
      <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
      <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
      <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost/MMOConnection</property>
      <property name="hibernate.connection.username">reveng</property>
      <property name="hibernate.connection.password">password</property>
      
      <property name="hibernate.bytecode.use_reflection_optimizer">true</property>
      <property name="hibernate.connection.pool_size">0</property>

      <mapping jar="hibernate3.jar" />
      <!-- <mapping package="uk.co.mmoconnection.view.service.dao.hbmxml"/>  -->
   </session-factory>
</hibernate-configuration>


after running the ant task i get:

Code:

Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: G:\Users\Adam\workspace\MMOConnection\build.xml
parsing buildfile G:\Users\Adam\workspace\MMOConnection\build.xml with URI = file:/G:/Users/Adam/workspace/MMOConnection/build.xml
Project base dir set to: G:\Users\Adam\workspace\MMOConnection
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
Arguments: -verbose -Dorg.eclipse.ant.core.ANT_PROCESS_ID=1274812685161
Build sequence for target(s) `gen_hibernate' is [gen_hibernate]
Complete build sequence is [gen_hibernate, compile, ]

gen_hibernate:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 94 [Thread-67] INFO org.hibernate.cfg.Environment - Hibernate 3.5.1-Final
[hibernatetool] 100 [Thread-67] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[hibernatetool] 110 [Thread-67] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[hibernatetool] 136 [Thread-67] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 716 [Thread-67] INFO org.hibernate.cfg.Configuration - configuring from file: hibernate.cfg.xml
[hibernatetool] 958 [Thread-67] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
[hibernatetool] 1091 [Thread-67] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 1092 [Thread-67] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 0
[hibernatetool] 1092 [Thread-67] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
[hibernatetool] 1097 [Thread-67] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://localhost/MMOConnection
[hibernatetool] 1098 [Thread-67] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=reveng, password=****}
[hibernatetool] 1357 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - RDBMS: Microsoft SQL Server, version: 10.00.2531
[hibernatetool] 1357 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: jTDS Type 4 JDBC Driver for MS SQL Server and Sybase, version: 1.2.5
[hibernatetool] 1545 [Thread-67] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.SQLServerDialect
[hibernatetool] 1801 [Thread-67] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
[hibernatetool] 1815 [Thread-67] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 1831 [Thread-67] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 1831 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
[hibernatetool] 1831 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
[hibernatetool] 1835 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
[hibernatetool] 1835 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
[hibernatetool] 1835 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
[hibernatetool] 1839 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
[hibernatetool] 1839 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
[hibernatetool] 1839 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
[hibernatetool] 1839 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
[hibernatetool] 1839 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 1855 [Thread-67] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
[hibernatetool] 1856 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
[hibernatetool] 1896 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
[hibernatetool] 1896 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 1897 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
[hibernatetool] 1897 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
[hibernatetool] 1897 [Thread-67] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
[hibernatetool] 2115 [Thread-67] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:jtds:sqlserver://localhost/MMOConnection

BUILD FAILED
G:\Users\Adam\workspace\MMOConnection\build.xml:36: java.lang.IncompatibleClassChangeError: Found interface org.hibernate.cfg.Mappings, but class was expected
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:357)
   at org.apache.tools.ant.Target.performTasks(Target.java:385)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
   at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
   at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
   at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:495)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
   at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:258)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.hibernate.cfg.Mappings, but class was expected
   at org.hibernate.cfg.reveng.MappingsDatabaseCollector.getTable(MappingsDatabaseCollector.java:25)
   at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:535)
   at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
   at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:860)
   at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:121)
   at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:94)
   at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:42)
   at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:83)
   at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
   at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
   at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318)
   at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94)
   at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   ... 17 more
--- Nested Exception ---
java.lang.IncompatibleClassChangeError: Found interface org.hibernate.cfg.Mappings, but class was expected
   at org.hibernate.cfg.reveng.MappingsDatabaseCollector.getTable(MappingsDatabaseCollector.java:25)
   at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:535)
   at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74)
   at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:860)
   at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:121)
   at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:94)
   at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:42)
   at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:83)
   at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
   at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:302)
   at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:318)
   at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94)
   at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
   at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:186)
   at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
   at org.apache.tools.ant.Task.perform(Task.java:348)
   at org.apache.tools.ant.Target.execute(Target.java:357)
   at org.apache.tools.ant.Target.performTasks(Target.java:385)
   at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
   at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
   at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
   at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
   at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
   at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
   at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:495)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
   at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:258)
   at java.lang.Thread.run(Unknown Source)

Total time: 2 seconds


here's a list of the jars i have included in the project:
Code:
commons-logging-1.0.4.jar
dom4j-1.5.2.jar
hibernate3.jar
hibernate-core-3.5.1-Final.jar
hibernate-tools-3.2.4.GA.jar
jtds-1.2.5.jar
slf4j-api-1.6.0.jar
slf4j-simple-1.6.0.jar
sqljdbc.jar


I'm not really sure what could cause a "Found interface org.hibernate.cfg.Mappings, but class was expected" error. I suspect I'm using a wrong jar file, but i'd appriciate any help, thanks!


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed May 26, 2010 2:33 pm 
Newbie

Joined: Tue May 25, 2010 2:51 pm
Posts: 4
Thanks very much, thanks to you I have it running now! however... even though it seems to run without error it doesn't produce any files.

build.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="HibernateAnt" basedir=".">
   <property name="src.dir" location="src" />
   <property name="lib.dir" location="WebContent/WEB-INF/lib" />
   <property name="bin.dir" location="build/hibernate" />
<!--
   <path id="project.class.path">
      <path>
         <pathelement location="${lib.dir}/hibernate3.jar" />
         
         <fileset dir="${lib.dir}">
            <include name="**/*.jar" />
         </fileset >
         <pathelement path="${bin.dir}" />
      </path>
   </path>
-->
   <!-- Compile the java source of the project -->
   <target name="compile"  description="Compiles all Java classes">
      <javac srcdir="${src.dir}" destdir="${bin.dir}" debug="on" optimize="off" deprecation="on">
         <classpath refid="project.class.path" />
      </javac>
   </target>
   
   
   <path id="toolslib">
      <path location="lib/bsh-2.0b1.jar" />
      <path location="lib/cglib-nodep-2.2.jar" />
      <path location="lib/commons-collections-3.1.jar" />
      <path location="lib/commons-logging-1.0.4.jar" />
      <path location="lib/dom4j-1.6.1.jar" />
      <path location="lib/freemarker.jar" />
      <path location="lib/hibernate3.jar" />
      <path location="lib/hibernate-tools-3.2.4.GA.jar" />
      <path location="lib/javassist-3.9.0.GA.jar" />
      <path location="lib/jta-1.1.jar" />
      <path location="lib/jtds-1.2.5.jar" />
      <path location="lib/jtidy-r8-20060801.jar" />
      <path location="lib/slf4j-api-1.6.0.jar" />
      <path location="lib/slf4j-simple-1.6.0.jar" />
      <path location="lib/sqljdbc.jar" />
   </path>
   
   <taskdef name="hibernatetool"
         classname="org.hibernate.tool.ant.HibernateToolTask" 
      classpathref="toolslib">

   </taskdef>

   <target name="gen_hibernate"
         description="generate hibernate classes">
      <hibernatetool>
      
         <jdbcconfiguration
            configurationfile="src/config/hibernate.cfg.xml"
            revengfile="src/config/reveng.xml"
            packagename="uk.co.mmoconnection.view.service.dao"
            detectmanytomany="true"
         />
         <hbm2hbmxml destdir="src/java/uk/co/mmoconnection/view/service/dao/hbmxml" />
         <hbm2java   destdir="src/java/uk/co/mmoconnection/view/service/dao/pojo" />
      </hibernatetool>
   </target>
</project>


hibernate.cfg.xml:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE
   hibernate-configuration
   SYSTEM
   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
>
<hibernate-configuration>
   <session-factory>
      <property name="dialect">org.hibernate.dialect.SQLServerDialect</property>
      <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
      <property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost/MMOConnection</property>
      <property name="hibernate.connection.username">reveng</property>
      <property name="hibernate.connection.password">password</property>
      
      <property name="hibernate.bytecode.use_reflection_optimizer">true</property>
      <property name="hibernate.connection.pool_size">0</property>

      <mapping jar="hibernate3.jar" />
      <!-- <mapping package="uk.co.mmoconnection.view.service.dao.hbmxml"/>  -->
   </session-factory>
</hibernate-configuration>


reveng.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC
   "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
   <type-mapping>
      <sql-type jdbc-type="BIGINT" hibernate-type="java.lang.Long" not-null="true"></sql-type>
   </type-mapping>
   <table-filter match-name="*.*" ></table-filter>
</hibernate-reverse-engineering>


output from ant task:
Code:

Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: G:\Users\Adam\workspace\MMOConnection\build.xml
parsing buildfile G:\Users\Adam\workspace\MMOConnection\build.xml with URI = file:/G:/Users/Adam/workspace/MMOConnection/build.xml
Project base dir set to: G:\Users\Adam\workspace\MMOConnection
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
374747 [Finalizer] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:jtds:sqlserver://localhost/MMOConnection
Arguments: -verbose -Dorg.eclipse.ant.core.ANT_PROCESS_ID=1274898684097
Build sequence for target(s) `gen_hibernate' is [gen_hibernate]
Complete build sequence is [gen_hibernate, compile, ]

gen_hibernate:
[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
[hibernatetool] 1. task: hbm2hbmxml (Generates a set of hbm.xml files)
[hibernatetool] 66 [Thread-40] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
[hibernatetool] 72 [Thread-40] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[hibernatetool] 82 [Thread-40] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[hibernatetool] 107 [Thread-40] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 476 [Thread-40] INFO org.hibernate.cfg.Configuration - configuring from file: hibernate.cfg.xml
[hibernatetool] 708 [Thread-40] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
[hibernatetool] 1158 [Thread-40] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
[hibernatetool] 1159 [Thread-40] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 0
[hibernatetool] 1159 [Thread-40] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
[hibernatetool] 1164 [Thread-40] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://localhost/MMOConnection
[hibernatetool] 1164 [Thread-40] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=reveng, password=****}
[hibernatetool] 1399 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - RDBMS: Microsoft SQL Server, version: 10.00.2531
[hibernatetool] 1399 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: jTDS Type 4 JDBC Driver for MS SQL Server and Sybase, version: 1.2.5
[hibernatetool] 1570 [Thread-40] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.SQLServerDialect
[hibernatetool] 1799 [Thread-40] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
[hibernatetool] 1810 [Thread-40] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[hibernatetool] 1810 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
[hibernatetool] 1810 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
[hibernatetool] 1813 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
[hibernatetool] 1814 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
[hibernatetool] 1814 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
[hibernatetool] 1817 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
[hibernatetool] 1817 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
[hibernatetool] 1817 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
[hibernatetool] 1817 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
[hibernatetool] 1817 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[hibernatetool] 1832 [Thread-40] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
[hibernatetool] 1832 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
[hibernatetool] 1832 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
[hibernatetool] 1832 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
[hibernatetool] 1833 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
[hibernatetool] 1833 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
[hibernatetool] 1833 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
[hibernatetool] 1833 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
[hibernatetool] 1866 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
[hibernatetool] 1867 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
[hibernatetool] 1867 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
[hibernatetool] 1867 [Thread-40] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
[hibernatetool] 2017 [Thread-40] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:jtds:sqlserver://localhost/MMOConnection
[hibernatetool] 2. task: hbm2java (Generates a set of .java files)
BUILD SUCCESSFUL
Total time: 3 seconds


after refreshing the project no files are produced... any ideas? thanks again! :)


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed May 26, 2010 6:21 pm 
Newbie

Joined: Tue May 25, 2010 2:51 pm
Posts: 4
I've fixed my problem :)


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Thu May 27, 2010 7:22 pm 
Newbie

Joined: Tue May 25, 2010 2:51 pm
Posts: 4
Sorry to post again, but I need your assistance once more. My files are being generated nicely now, but any changes i make to the .ftl templates don't seem to be reflected in the files.
so far i've made slight modifications to hibernate-mapping.hbm.ftl and Pojo.ftl but these changes do not show up in the hbm.xml and pojos that are being produced (i suspect it is still using the default ones from the jar)

i've tried setting templatepath in hibernatetool ant task but it didn't seem to make any difference... what else shuold i check?


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Sun May 30, 2010 9:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Adam1982 wrote:
i've tried setting templatepath in hibernatetool ant task but it didn't seem to make any difference... what else shuold i check?


Are your template files stored in the same way as in the jar ? i.e. directories matter when files are being looked up. i.e. <templatepath>/hbm-mapping.hbm.ftl won't be found when it should be <templatepath>/hbm/hbm-mapping.hbm.ftl.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed Jun 16, 2010 2:03 am 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
Hello,

is there currently a way to reverseengineer with hibernate 3.5 ? I've checked out the hibernate-tools development state and there is no focus on h3.5..

best regards! Andre


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed Jun 16, 2010 3:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Andre0815 wrote:
Hello,

is there currently a way to reverseengineer with hibernate 3.5 ? I've checked out the hibernate-tools development state and there is no focus on h3.5..

best regards! Andre


What is not working for you ?

The code still compile against Hibernate 3.5 last time I checked but haven't done anything specific for 3.5 because it would result in tools not working with previous Hibernate versions.

Help very much welcome!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed Jun 16, 2010 5:41 am 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
Hello Max,

I get the "Found interface org.hibernate.cfg.Mappings, but class was expected" error, too, running on Hibernate 3.5 CR2.
The answer/sollution in this thread was to take a look on the compatibility matrix which shows that hibernate-tools is only compatible with core =< v3.2.x..

.. or did I misread the sollution ?

rgs & greats


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed Jun 16, 2010 6:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well it seems that there are two different hibernate core jars on the classpath.

Start by only having one.

note, the output of hibernate tools reveng is usable with Hibernate 3.5 so if all fails (but I would like to know if it does) then you can just use Hibernate 3.3 to do the reverse engineering.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed Jun 16, 2010 7:35 am 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
Hm.. We have only hibernate 3.5 CR2 in our env..

The comment ###"you are using hibernate-core-3.5.1-Final.jar which is not compatible with hibernate-tools-3.2.4.GA.jar."
of regular "vyemialyanchyk" seams to right :(

Your comment "note, the output of hibernate tools reveng is usable with Hibernate 3.5" ist right, too, but I cannot create such an output with hibernate 3.5 because hibernate-tools requires hibernate and is incompatible with our version..

So may I can use created POJO's but not create them via reverseEngineereing :(

I will investigate still a bit in this and our env, but seams to be currently not possible..

Regards


Top
 Profile  
 
 Post subject: Re: Reverse Engineering IncompatibleClassChangeError
PostPosted: Wed Jun 16, 2010 9:28 am 
Beginner
Beginner

Joined: Fri Dec 04, 2009 9:37 am
Posts: 34
Jap I've tested with hibernate 3.3 and then it works:
org.hibernate.cfg.JDBCBinderException: Duplicate class name 'reveng.Columns' generated for 'org.hibernate.mapping.Table(SYSIBM.COLUMNS)'. Same name where generated for 'org.hibernate.mapping.Table(SYSIBM.COLUMNS)'

Actually I do not want to use it in eclipe (working with IDEA : ) but in our application where H3.5 is running... I have tried a lot for unload Classes (h3.5) with a custom classLoader for this reveng task, but its to much tricky....

Very Last question: is there anywhere a plan for h3.5 support or is it estimable that it will come in 2011 ?

regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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.