9 Replies Latest reply: May 9, 2012 10:57 AM by Vladimir Blagojevic RSS

Critical issue with Infinispan

zeeman Novice

I'm using AS7.1.0.CR1 with hibernate and Infinispan that ship with it.

 

 

I have a web app using seam 3.1 and JPA. I have two domain entities annotated with JPA @Cachable. Action entity class will never be updated, so I don't want it to be evicted once it's cached. Property entity class will be rarely updated so I need it to be evicted.

 

I have a UI that lets me do transactional CRUD opertions on property table. I get below error stack trace. Two questions:

 

1- How to fix this error? Is my configuration correct?

2- I test on a single app server, but in  prod I'll have a cluster of two servers; how can I run the cache reliabily to have it evict entries on the other node in cluster?

 

My persistence.xml:

 

 

 

 

<persistence-unit name="testapp-PU" transaction-type="JTA">

  <description>testapp Persistence Unit</description>

  <provider>org.hibernate.ejb.HibernatePersistence</provider>

  <jta-data-source>java:jboss/datasources/PostgresDS</jta-data-source>

  <exclude-unlisted-classes>false</exclude-unlisted-classes>

  <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>

  <properties>

  <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />

  <property name="hibernate.hbm2ddl.auto" value="create-drop" /> <!-- create-drop -->

  <property name="hibernate.jdbc.batch_size" value="0" />

  <property name="hibernate.show_sql" value="false" />

  <property name="hibernate.id.new_generator_mappings" value="true" />

  <property name="hibernate.generate_statistics" value="false" />

 

  <property name="hibernate.cache.use_query_cache" value="true" />

  <property name="hibernate.cache.use_second_level_cache" value="true"/>

  <property name="hibernate.cache.infinispan.use_synchronization"  value="true"/>

  <property name="hibernate.cache.infinispan.statistics" value="false"/>

  <property name="hibernate.cache.infinispan.cachemanager" value="java:jboss/infinispan/hibernate" />

 

  <property name="hibernate.cache.infinispan.com.testapp.model.Action.eviction.strategy" value= "NONE"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Action.eviction.wake_up_interval" value= "1000000"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Action.eviction.max_entries" value= "300"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Action.expiration.lifespan" value= "1000000000"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Action.expiration.max_idle" value= "1000000000"/>

 

  <property name="hibernate.cache.infinispan.com.testapp.model.Property.eviction.strategy" value= "FIFO"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Property.eviction.wake_up_interval" value= "1000000"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Property.eviction.max_entries" value= "300"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Property.expiration.lifespan" value= "1000000000"/>

  <property name="hibernate.cache.infinispan.com.testapp.model.Property.expiration.max_idle" value= "1000000000"/>

 

  <!-- <property name="hibernate.transaction.flush_before_completion" value="true"/> -->

 

  <!-- use a file system based index in prod

  <property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.impl.FSDirectoryProvider" />

  <property name="hibernate.search.default.indexBase" value="./testappindexes" /> -->

  <property name="hibernate.search.default.directory_provider" value="ram" />

 

  <property name="hibernate.search.lucene_version" value="LUCENE_34" />

  <property name="hibernate.search.default.exclusive_index_use" value="true" />

  <property name="hibernate.search.analyzer" value="org.apache.lucene.analysis.standard.StandardAnalyzer"/>

  <property name="hibernate.search.worker.execution" value="async"/>

  <property name="hibernate.search.worker.thread_pool.size" value="1"/>

  <property name="hibernate.search.worker.buffer_queue.max" value="100"/>

  </properties>

  </persistence-unit>

 

 

 

 

Stacktrace:

 

 

 

15:33:50,024 ERROR [org.infinispan.interceptors.InvocationContextInterceptor] (http--127.0.0.1-8080-2) ISPN000136: Execution error: java.lang.IllegalStateException: Transaction TransactionImple < ac, BasicAction: 0:ffff7f000101:-15486e47:4f09fbe5:4d84 status: ActionStatus.ABORT_ONLY > is not in a valid state to be invoking cache operations on.

          at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:234)

          at org.infinispan.interceptors.TxInterceptor.enlistIfNeeded(TxInterceptor.java:197)

          at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:191)

          at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:187)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)

          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)

          at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:84)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)

          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)

          at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:107)

          at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:67)

          at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)

          at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)

          at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:133)

          at org.hibernate.cache.infinispan.impl.ClassLoaderAwareCache$ClassLoaderAwareCommandInterceptor.handleDefault(ClassLoaderAwareCache.java:77)

          at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95)

          at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:61)

          at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:318)

          at org.infinispan.CacheImpl.get(CacheImpl.java:264)

          at org.infinispan.CacheImpl.get(CacheImpl.java:256)

          at org.infinispan.AbstractDelegatingCache.get(AbstractDelegatingCache.java:250)

          at org.infinispan.AbstractDelegatingCache.get(AbstractDelegatingCache.java:250)

          at org.hibernate.cache.infinispan.util.CacheAdapterImpl.get(CacheAdapterImpl.java:78)

          at org.hibernate.cache.infinispan.access.TransactionalAccessDelegate.get(TransactionalAccessDelegate.java:62)

          at org.hibernate.cache.infinispan.entity.TransactionalAccess.get(TransactionalAccess.java:35)

          at org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:527) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:410) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.internal.SessionImpl.get(SessionImpl.java:870) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.internal.SessionImpl.get(SessionImpl.java:863) [hibernate-core-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:792) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

          at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:767) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

          at org.jboss.as.jpa.container.AbstractEntityManager.find(AbstractEntityManager.java:219) [jboss-as-jpa-7.1.0.CR1.jar:7.1.0.CR1]

          at com.testapp.model.Property.getKeyValue(Property.java:81) [classes:]

          at com.testapp.action.media.MemberMediaAction.getAllowedUploadExtensions(MemberMediaAction.java:38) [classes:]

          at com.testapp.action.media.MemberMediaAction$Proxy$_$$_WeldClientProxy.getAllowedUploadExtensions(MemberMediaAction$Proxy$_$$_WeldClientProxy.java) [classes:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]

          at javax.el.BeanELResolver.getValue(BeanELResolver.java:302) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]

          at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at org.apache.el.parser.AstValue.getValue(AstValue.java:169) [jbossweb-7.0.7.Final.jar:]

          at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) [jbossweb-7.0.7.Final.jar:]

          at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

          at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIOutput.getValue(UIOutput.java:169) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIInput.validate(UIInput.java:972) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIInput.executeValidate(UIInput.java:1233) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIInput.processValidators(UIInput.java:698) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIForm.processValidators(UIForm.java:253) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at org.primefaces.component.dialog.Dialog.processValidators(Dialog.java:355) [primefaces-3.0.jar:]

          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1172) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]

          at com.testapp.loaders.upload.testappFileUploadFilter.doFilter(testappFileUploadFilter.java:81) [classes:]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]

          at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [jbossweb-7.0.7.Final.jar:]

          at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118) [prettyfaces-jsf2-3.3.2.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.7.Final.jar:]

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.CR1.jar:7.1.0.CR1]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:151) [jboss-as-web-7.1.0.CR1.jar:7.1.0.CR1]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.7.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.7.Final.jar:]

          at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:897) [jbossweb-7.0.7.Final.jar:]

          at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:626) [jbossweb-7.0.7.Final.jar:]

          at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2033) [jbossweb-7.0.7.Final.jar:]

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