6 Replies Latest reply on Jan 8, 2013 3:46 AM by Bing Zou

    HELP! Spring + JPA + Hiberante 4 with Infinispan as 2nd level cache provider

    Bing Zou Newbie

      I searched on google and found a few ppl having the same issue but could not find a concrete answer.

       

      Basically we use spring with jpa along with hiberante 4.1.7 and trying to setup infinispan as 2nd level cache provider:

      <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.infinispan.InfinispanRegionFactory</prop>

       

      However, during startup, getting the following exception:


      Caused by: org.infinispan.CacheException: This is transactional cache but no transaction manager could be found. Configure the transaction manager lookup properly.

                at org.infinispan.factories.TransactionManagerFactory.construct(TransactionManagerFactory.java:81)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:286)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:291)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:291)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:291)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:291)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:291)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:291)

                at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)

                at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:83)

                at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:796)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)

                at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:154)

                at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)

                at org.infinispan.factories.InternalCacheFactory.bootstrap(InternalCacheFactory.java:102)

                at org.infinispan.factories.InternalCacheFactory.createAndWire(InternalCacheFactory.java:78)

                at org.infinispan.factories.InternalCacheFactory.createCache(InternalCacheFactory.java:62)

                at org.infinispan.manager.DefaultCacheManager.wireCache(DefaultCacheManager.java:692)

                at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:649)

                at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:549)

                at org.hibernate.cache.infinispan.InfinispanRegionFactory.getCache(InfinispanRegionFactory.java:483)

                at org.hibernate.cache.infinispan.InfinispanRegionFactory.buildEntityRegion(InfinispanRegionFactory.java:209)

                at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:344)

                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)

                at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)

                at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)

                at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)

                at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:287)

                at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)

                ... 56 more

       

      Any help is appreciated.

      ~xigua