2 Replies Latest reply on Mar 25, 2013 10:57 PM by james viet

    Configure Infinispan as Hibernate 2LC on JBoss 7.1.1 error

    james viet Newbie

      Hi all,

       

      I have already configed Infinispan as Hibernate 2LC and deployed my application succesfully on JBoss 7.1.0.

       

      But when I move to JBoss 7.1.1, I met error:

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'innerSessionFactory' defined in class path resource [META-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.util.NoSuchElementException

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

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

          at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)

          ... 89 more

      Caused by: java.util.NoSuchElementException

          at java.util.Collections$EmptyIterator.next(Collections.java:2998)

          at org.hibernate.cache.infinispan.InfinispanRegionFactory.getCacheCommandFactory(InfinispanRegionFactory.java:448)

          at org.hibernate.cache.infinispan.InfinispanRegionFactory.startRegion(InfinispanRegionFactory.java:337)

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

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

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

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

          at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:189)

          at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:350)

          at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:335)

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

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

          ... 96 more

       

       

      I used Spring in my application. My configure in application context:

       

                      hibernate.cache.use_second_level_cache=true

                      hibernate.cache.use_query_cache=true

                      hibernate.cache.infinispan.cachemanager=java:jboss/infinispan/hibernate

                      hibernate.cache.region.factory_class=org.hibernate.cache.infinispan.JndiInfinispanRegionFactory

                      hibernate.cache.infinispan.statistics=true

       

      In standalone-full-ha.xml:

       

        <cache-container name="hibernate" default-cache="entity" jndi-name="java:jboss/infinispan/hibernate" start="EAGER">

                      <transport stack="udp" lock-timeout="60000"/>

                      ---------------------------

                      ---------------------------

      </cache-container>

       

      Could you please give me some advice for this?

      Thank you very much.!