Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8308273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:45:27+00:00 2026-06-08T18:45:27+00:00

I have found a few threads on various sites that seem to touch on

  • 0

I have found a few threads on various sites that seem to touch on this problem, but I am having no luck. It seems as though it simply can not be done. I get the
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.hibernate.cfg.Mappings, but class was expected error. Looking at the compatability matrix that is Shown in this thread. it seems that I can’t use reveng unless I downgrade. But this can not seem right.

When I started upgrading everything worked, and now I am getting that same error. I made sure not to have two different jars with the same name on my class path. I have the following jars:

commons-logging-1.0.4.jar
dom4j-1.6.1.jar
hibernate3.jar
hibernate-tools.jar    
slf4j-api-1.6.6.jar
slf4j-log4j12-1.6.6.jar
sqljdbc4.jar
other various jars not dealing with hibernate..

Here is the full stack trace:

    ...   
    hibernatetool
    Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)
    1. task: hbm2hbmxml (Generates a set of hbm.xml files)     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:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:29)
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)
    ... 

ant:

<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpathref="classpath" />
...
 <hibernatetool>
    <jdbcconfiguration configurationfile="${conf.dir}/${dbName}_hibernate-template.cfg.xml" packagename="myPackageName" revengfile="${conf.dir}/hibernate.reveng.xml" reversestrategy="com.capitaliq.loader.dev.codegen.HibernateReverseStrategy" detectmanytomany="false" />
    <hbm2hbmxml destdir="${srcGen.dir}" />
    <!-- Generate new hibernate.cfg.xml including new POJOs-->
    <!--'destdir' is relative to 'packagename' configuration-->
    <hbm2cfgxml ejb3="false" destdir="${conf.dir}" />
</hibernatetool>

<!-- Generate java POJOs from mapping files-->
<hibernatetool> <!--Line 384-->
    <configuration configurationfile="${conf.dir}/${dbName}_hibernate-template.cfg.xml">
        <fileset dir="${orm.pkg.dir}">
            <include name="**/*.hbm.xml" />
        </fileset>
    </configuration>
    <!--'destdir' is relative to 'packagename' configuration-->
    <hbm2java jdk5="true" ejb3="false" destdir="${srcGen.dir}" />
</hibernatetool>

Any help would be great; this computer is about to get thrown. Thanks guys.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:45:29+00:00Added an answer on June 8, 2026 at 6:45 pm

    According to this link. Max, one of the contributors to hibernate, states (near the bottom of the thread):

    “The problem is that Hibernate 3.6 has a class change from class to interface which means it is source compatible but not binary compatible with Hibernate Tools.

    That plus other binary changes causes this problem and is recorded in https://issues.jboss.org/browse/JBIDE-8071

    Thus the “workaround” is when you need to generate code with hibernate tools then don’t include hibernate 3.6 on the classpath; the resulting code can be used fine with 3.6 afterwards.

    The challenge is that if we added 3.6 support we would loose 3.3-3.5 support too.
    Thus for now we are not updating but will try and see what we can do going forward.”

    It appears I was trying to do the impossible. Though I am glad I finally have an answer, I regret to say it is not the one I hoped it would be.

    One can not have the two jars on the same classpath, even though the are dependent on one another. If you want to reverse engineer some hibernate code, best not have hibernate version 3.6!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found other examples of people having this problem but have had no
This is similar to a few other threads i have found, but I haven't
I have found a few threads in regards to this issue. Most people appear
I have searched the forums and found a few threads, but nothing specific to
I found a few threads on this using the search feature, but nothing for
I have already searched for this type of error and found a few threads,
This problem seems to come up for a few people, but I haven't been
I have checked few other posts and found some UIAnimation transitions that kind-of give
I have found that I have no problem using require to load something like
I may seem ignorant but I have not found much information about how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.