0

I've just started using hibernate annotations for my POJO mappings in my Sping+Hibernate based project (JDK 1.6.0_23) and I'm getting this error regarding incompatibility between classes. The sessionFactory is configured as:

<bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
        <ref bean="dataSource" />
    </property>
    <property name="configLocation" value="classpath:hibernate.cfg.xml"/>
    <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />
    <property name="namingStrategy">
      <bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.format_sql">no</prop>
            <prop key="hibernate.connection.isolation">3</prop> 
            <prop key="hibernate.transaction.factory_class">com.atomikos.icatch.jta.hibernate3.AtomikosJTATransactionFactory </prop> 
            <prop key="hibernate.transaction.manager_lookup_class">com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup</prop>
        </props>
    </property>
</bean>

In my Maven project file I've set the following dependencies: javax.persistence persistence-api 1.0 jar false org.hibernate hibernate-annotations ${hibernate.version} jar false org.hibernate hibernate-core ${hibernate.version} jar false org.hibernate hibernate-ehcache ${hibernate.version} jar false 2.5.5 3.5.6-Final 0.5

Could anyone give me a hint as to how to solve the problem? Thank you

Peter

Petre Maierean
  • 914
  • 3
  • 14
  • 21
  • 1
    I've just fixed the problem. It seems that one of the other project dependencies (naming 'transactions-essentials-all' from atomicos) introduced hibernate core 3.2.5.ga in the deployment. I've wrote a nested exclusions with that dependency and all worked wanders cool stuff – Petre Maierean Apr 14 '11 at 10:36

2 Answers2

0

I had the same problem but you can find the answers here : What is a IncompatibleClassChangeError exception in Java?

Community
  • 1
  • 1
Dimitri
  • 8,122
  • 19
  • 71
  • 128
0

it could be due to older version of hibernate entity manager or hibernate annotation, which is not match if you use newest hibernate core jar. check both jars and try to upgrade it to newest version 3.5.x

herlambang
  • 185
  • 2
  • 9