-->
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.  [ 3 posts ] 
Author Message
 Post subject: Reverse Engineering: java.lang.IncompatibleClassChangeError
PostPosted: Wed Mar 31, 2010 4:35 am 
Newbie

Joined: Tue Mar 30, 2010 8:46 am
Posts: 2
Hi there,
First of all, I'm new to Hibernate. I read this documentation and tried to generate some pojos from an existing mysql database via reverse engineering and apache ant. Here is my approach:

build.xml:
Code:
<project name="HibernateTest" basedir="." default="gen_hibernate">

   <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="hibernate.cfg.xml" packagename="my.package"/>
         <hbm2hbmxml destdir="src" />
         <hbm2java  destdir="src" />
      </hibernatetool>
   </target>

</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>
        <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
        <property name="hibernate.connection.password">mypass</property>
        <property name="hibernate.connection.url">jdbc:mysql://127.0.01/database</property>
        <property name="hibernate.connection.username">user</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    </session-factory>
</hibernate-configuration>


When I'm executing build.xml, the following error occurs:
Quote:
java.lang.IncompatibleClassChangeError: Found interface org.hibernate.cfg.Mappings, but class was expected


What went wrong?

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Reverse Engineering: java.lang.IncompatibleClassChangeError
PostPosted: Wed Mar 31, 2010 9:04 am 
Newbie

Joined: Tue Mar 30, 2010 8:46 am
Posts: 2
I solved it. Never mix up the 1000 versions of the different the jar files...


Top
 Profile  
 
 Post subject: Re: Reverse Engineering: java.lang.IncompatibleClassChangeError
PostPosted: Tue Oct 12, 2010 9:24 pm 
Newbie

Joined: Wed Aug 25, 2010 2:06 pm
Posts: 4
Hi,

can you tell me what version of what JAR file(s) you used? Where did you download from?

I got the same error. Is it the hibernate tools jar?


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