IncompatibleClassChangeError in Infinispan an Hibernate integration

222 Views Asked by At

I have a "IncompatibleClassChangeError" problem when integrating hibernate and infinispan in a standalong enviroment, search in google found no results.

versions:

Hibernate 4.3.7.Final
Infinispan 7.0.2.Final
Spring 4.1.1.RELEASE
Atomikos 3.9.3

Exceptinos:

Caused by: java.lang.IncompatibleClassChangeError: Found class org.infinispan.commons.util.FileLookup, but interface was expected
    at org.hibernate.cache.infinispan.InfinispanRegionFactory.createCacheManager(InfinispanRegionFactory.java:406)
    at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:323)
    ... 141 more

config in spring:

<bean id="sessionFactory"
    class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="packagesToScan" value="qfy.tousu.model"></property>
    <property name="jtaTransactionManager" ref="transactionManager"></property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.query.substitutions">true 1, false 0</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
            <prop key="hibernate.max_fetch_depth">3</prop>
            <prop key="hibernate.default_entity_mode">pojo</prop>
            <prop key="hibernate.default_batch_fetch_size">16</prop>
            <prop key="hibernate.jdbc.batch_size">20</prop>
            <prop key="hibernate.order_updates">true</prop>
            <prop key="hibernate.cache.use_second_level_cache">true</prop>
            <prop key="hibernate.cache.use_query_cache">true</prop>
            <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.infinispan.InfinispanRegionFactory</prop>
            <prop key="hibernate.generate_statistics">true</prop>
            <prop key="hibernate.cache.use_structured_entries">true</prop>
        </props>
    </property>
</bean>
1

There are 1 best solutions below

2
On

Hmmm, seems like you might have found a bug with the work we did to keep Infinispan 7 backwards compatible in ISPN-4686. I'd suggest sticking to Infinispan 6.x until we've sorted it out. I've created ISPN-5029 to get this fixed. Apologies for the inconvenience.