8 Replies Latest reply: Jan 7, 2012 7:50 AM by iabughosh RSS

Infinispan 5.1 CR2 with JBoss 6

iabughosh Master

Dears,

I'm trying to use Infinispan 5.1 CR2 as Hibernate L2 cahce in my application with JBoss AS 6 but i get this exception :

 

javax.xml.stream.XMLStreamException: ParseError at [row,col]:[24,7]

Message: Unexpected attribute 'use1PcForAutoCommitTransactions' encountered, **ERROR**

 

 

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]

          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]

          at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]

          at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]

          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]

          at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]

          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

 

i don't use any configuration file, i set my parameters in persistence.xml.

 

thanks in advance.

  • 1. Re: Infinispan 5.1 CR2 with JBoss 6
    Galder Zamarreño Master

    What Hibernate version?

  • 2. Re: Infinispan 5.1 CR2 with JBoss 6
    iabughosh Master

    Hello Galder, i'm using 4.0 Final.

  • 3. Re: Infinispan 5.1 CR2 with JBoss 6
    Galder Zamarreño Master

    This is a bug, see associated JIRA at the top.

     

    You can workaround this issue pretty easily. Take the base configuration file in https://github.com/hibernate/hibernate-core/blob/master/hibernate-infinispan/src/main/resources/org/hibernate/cache/infinispan/builder/infinispan-configs.xml and make a local copy of it. Then, remove the use1PcForAutoCommitTransactions setting and pass the new config file in your persistence.xml via:

     

    <property name="hibernate.cache.infinispan.cfg" value="<path to your infinispan config file>" />

  • 4. Re: Infinispan 5.1 CR2 with JBoss 6
    iabughosh Master

    Thank you Galder, i did as you said and the exception disappears but i get this now :

     

    Caused by: org.hibernate.cache.CacheException: Unable to start region factory

              at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:282) [:4.0.0.Final]

              at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:272) [:4.0.0.Final]

              at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [:4.0.0.Final]

              at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76) [:4.0.0.Final]

              at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905) [:4.0.0.Final]

              ... 79 more

    Caused by: org.infinispan.config.ConfigurationException: org.infinispan.CacheConfigurationException: Unable to instantiate class org.hibernate.cache.infinispan.tm.HibernateTransactionManagerLookup

              at org.infinispan.configuration.parsing.Parser.parse(Parser.java:110) [:5.1.0.CR2]

              at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:365) [:5.1.0.CR2]

              at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:349) [:5.1.0.CR2]

              at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:336) [:5.1.0.CR2]

              at org.hibernate.cache.infinispan.InfinispanRegionFactory.createCacheManager(InfinispanRegionFactory.java:316) [:4.0.0.Final]

              at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:268) [:4.0.0.Final]

              ... 83 more

    Caused by: org.infinispan.CacheConfigurationException: Unable to instantiate class org.hibernate.cache.infinispan.tm.HibernateTransactionManagerLookup

              at org.infinispan.util.Util.getInstance(Util.java:165) [:5.1.0.CR2]

              at org.infinispan.util.Util.getInstance(Util.java:208) [:5.1.0.CR2]

              at org.infinispan.configuration.parsing.Parser.parseTransaction(Parser.java:253) [:5.1.0.CR2]

              at org.infinispan.configuration.parsing.Parser.parseCache(Parser.java:217) [:5.1.0.CR2]

              at org.infinispan.configuration.parsing.Parser.parseDefaultCache(Parser.java:172) [:5.1.0.CR2]

              at org.infinispan.configuration.parsing.Parser.doParse(Parser.java:128) [:5.1.0.CR2]

              at org.infinispan.configuration.parsing.Parser.parse(Parser.java:99) [:5.1.0.CR2]

              ... 88 more

    Caused by: java.lang.InstantiationException: org.hibernate.cache.infinispan.tm.HibernateTransactionManagerLookup

              at java.lang.Class.newInstance0(Class.java:340) [:1.6.0_24]

              at java.lang.Class.newInstance(Class.java:308) [:1.6.0_24]

              at org.infinispan.util.Util.getInstanceStrict(Util.java:190) [:5.1.0.CR2]

              at org.infinispan.util.Util.getInstance(Util.java:161) [:5.1.0.CR2]

              ... 94 more

  • 5. Re: Infinispan 5.1 CR2 with JBoss 6
    Galder Zamarreño Master

    Oh, just remove transactionManagerLookupClass="org.hibernate.cache.infinispan.tm.HibernateTransactionManagerLookup" from the config file. That was needed in a previous Infinispan 5.1 beta version but this is no longer needed. I'm in the process of fixing this configuration file once the latest Infinispan 5.1 CR version has been integrated.

  • 6. Re: Infinispan 5.1 CR2 with JBoss 6
    iabughosh Master

    thanks Galder, it seems that wakeUpInterval is also unavailable with eviction tag, see this exception :

    javax.xml.stream.XMLStreamException: ParseError at [row,col]:[38,7]

    Message: Unexpected attribute 'wakeUpInterval' encountered, **ERROR**

     

    please confirm that.

     

    I've removed all wakeUpInterval and my war is deployed successfully, I'll do some tests on L2 caching and inform you back.

     

    regards.

  • 7. Re: Infinispan 5.1 CR2 with JBoss 6
    Galder Zamarreño Master

    wakeUpInterval has moved, it goes under expiration rather than eviction, i.e.

     

          <eviction maxEntries="10000" strategy="LRU"/>

          <expiration maxIdle="100000" wakeUpInterval="5000"/>

  • 8. Re: Infinispan 5.1 CR2 with JBoss 6
    iabughosh Master

    thanks Galder, it is working now, i'm looking forward to 5.1 final release .