-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate, EhCache & TransactionManager
PostPosted: Thu Jan 06, 2011 6:37 am 
Beginner
Beginner

Joined: Thu Jan 06, 2011 6:19 am
Posts: 25
Hi,

I'm new here.

I wanted to upgrade my application to hibernate 3.6.0.Final. So I also upgraded the ehcache to ehcache-core 2.3.0. Now, I'm getting an exception while starting my tests:

Code:
Caused by: java.lang.NoSuchMethodError: net.sf.ehcache.config.Configuration.setDefaultTransactionManager(Ljava/lang/Object;)V
   at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:70)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:236)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
   at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)



I use the JDBC based transaction manager:

Code:
<tx:annotation-driven transaction-manager="mytransactionManager"/>
<bean id="mytransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
   <property name="sessionFactory" ref="mySessionFactory" />
</bean>


The configuration of the session factory looks like this:

Code:
     <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="dataSource" ref="${...}" />
      <property name="annotatedClasses">
         <list>
            ....
         </list>
      </property>
      <property name="hibernateProperties">
         <props>
          <prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>
            <prop key="hibernate.cache.use_second_level_cache">true</prop>
            <prop key="hibernate.cache.use_minimal_puts">true</prop>
            <prop key="hibernate.cache.use_query_cache">true</prop>
                                 ....
         </props>
      </property>
   </bean>


Can you explain, what I'm doing wrong?

Thanks in advance.

Regards,
jacquipre


Top
 Profile  
 
 Post subject: Re: Hibernate, EhCache & TransactionManager
PostPosted: Thu Jan 06, 2011 9:28 am 
Beginner
Beginner

Joined: Thu Jan 06, 2011 6:19 am
Posts: 25
Solved!

Problem was: multiple ehcache dependencies in classpath :)


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