-
1. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
pferraro Oct 6, 2017 8:06 AM (in response to mikedevva)Can you post the configuration of your Infinispan ejb cache container?
-
2. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
mikedevva Oct 6, 2017 8:53 AM (in response to pferraro)Do you mean the subsystem config from standalone-full.xml? I haven't changed it at all so it's just the default. See below. If you're asking for something else can you describe more specifically what you're asking for? I'm still kind of new to all of this. Thanks.
<subsystem xmlns="urn:jboss:domain:ejb3:4.0"> <session-bean> <stateless> <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/> </stateless> <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/> <singleton default-access-timeout="5000"/> </session-bean> <mdb> <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/> <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/> </mdb> <pools> <bean-instance-pools> <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> </bean-instance-pools> </pools> <caches> <cache name="simple"/> <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/> </caches> <passivation-stores> <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/> </passivation-stores> <async thread-pool-name="default"/> <timer-service thread-pool-name="default" default-data-store="default-file-store"> <data-stores> <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/> </data-stores> </timer-service> <remote connector-ref="http-remoting-connector" thread-pool-name="default"/> <thread-pools> <thread-pool name="default"> <max-threads count="10"/> <keepalive-time time="100" unit="milliseconds"/> </thread-pool> </thread-pools> <iiop enable-by-default="false" use-qualified-name="false"/> <default-security-domain value="other"/> <default-missing-method-permissions-deny-access value="true"/> <log-system-exceptions value="true"/> </subsystem>
-
3. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
pferraro Oct 6, 2017 8:59 AM (in response to mikedevva)It's the Infinispan subsystem configuration that I'm looking for.
-
4. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
mikedevva Oct 6, 2017 9:40 AM (in response to pferraro)Here's my infinispan subsystem configuration. I haven't changed that from the default either.
<subsystem xmlns="urn:jboss:domain:infinispan:4.0"> <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server"> <local-cache name="default"> <transaction mode="BATCH"/> </local-cache> </cache-container> <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan"> <local-cache name="passivation"> <locking isolation="REPEATABLE_READ"/> <transaction mode="BATCH"/> <file-store passivation="true" purge="false"/> </local-cache> <local-cache name="persistent"> <locking isolation="REPEATABLE_READ"/> <transaction mode="BATCH"/> <file-store passivation="false" purge="false"/> </local-cache> <local-cache name="concurrent"> <file-store passivation="true" purge="false"/> </local-cache> </cache-container> <cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan"> <local-cache name="passivation"> <locking isolation="REPEATABLE_READ"/> <transaction mode="BATCH"/> <file-store passivation="true" purge="false"/> </local-cache> <local-cache name="persistent"> <locking isolation="REPEATABLE_READ"/> <transaction mode="BATCH"/> <file-store passivation="false" purge="false"/> </local-cache> </cache-container> <cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan"> <local-cache name="entity"> <transaction mode="NONE"/> <!--eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="100000"/--> </local-cache> <local-cache name="local-query"> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="100000"/> </local-cache> <local-cache name="timestamps"/> </cache-container> </subsystem>
-
5. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
pferraro Oct 6, 2017 2:22 PM (in response to mikedevva)The default configuration of your entity cache was indeed modified. See:
wildfly/infinispan.xml at 10.1.0.Final · wildfly/wildfly · GitHub
-
6. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
mikedevva Oct 6, 2017 3:03 PM (in response to pferraro)You're right. I forgot that's where I made a change to fix my previous problem. I was getting this error:
Caused by: java.lang.IllegalArgumentException: Currently transactional caches are not supported.
I found the solution to that here:
Since our entities are only using NONSTRICT_READ_WRITE and READ_WRITE, it seemed reasonable to change the entity transaction mode to "NONE". In the solution, there were no eviction or expiration elements so I commented them out. I added them back in so I have this:
<cache-container name="hibernate" default-cache="local-query" module="org.hibernate.infinispan"> <local-cache name="entity"> <transaction mode="NONE"/> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="100000"/> </local-cache> <local-cache name="local-query"> <eviction strategy="LRU" max-entries="10000"/> <expiration max-idle="100000"/> </local-cache> <local-cache name="timestamps"/> </cache-container>
I still get the same error. Does setting the transaction mode to "NONE" create a simple cache? If it does, that would explain the problem but then I would need to do something about the CacheConcurrencyStrategies in our entities.
-
7. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
pferraro Oct 6, 2017 3:35 PM (in response to mikedevva)Are you overriding any cache properties for the entity cache region? Can you paste your persistence.xml?
-
8. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
mikedevva Oct 6, 2017 4:45 PM (in response to pferraro)I don't think I'm overriding any cache properties. My persistence.xml is pretty basic. We were using ehcache before so there was more to it, but I commented most of that out. Here's what's left:
<?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="IpsDb" transaction-type="JTA"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <jta-data-source>java:jboss/datasources/HarmonyServerDS</jta-data-source> <jar-file>../harmonyserver-model.jar</jar-file> <properties> <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" /> <property name="hibernate.id.new_generator_mappings" value="false" /> <property name="hibernate.cache.use_query_cache" value="true"/> <property name="hibernate.cache.use_second_level_cache" value="true"/> </properties> </persistence-unit> </persistence>
-
9. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
pferraro Oct 6, 2017 6:23 PM (in response to mikedevva)Hmm. The simple cache optimization in Infinispan is auto-enabled when the cache is local, non-transactional, and does not contain a cache store. This is meant to allow the cache to operate without an interceptor stack. However, somehow, an interceptor stack is getting installed anyway. Can you paste the full stack trace containing the UnsupportedOperationException?
-
10. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
mikedevva Oct 6, 2017 7:17 PM (in response to pferraro)Here's the full stack trace:
2017-10-06 14:56:36,221 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 19) MSC000001: Failed to start service jboss.persistenceunit."harmonyserver.sar#IpsDb": org.jboss.msc.service.StartException in service jboss.persistenceunit."harmonyserver.sar#IpsDb": javax.persistence.PersistenceException: [PersistenceUnit: IpsDb] Unable to build Hibernate SessionFactory
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:179)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:121)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:193)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: IpsDb] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:161)
... 7 more
Caused by: java.lang.UnsupportedOperationException: ISPN000376: Interceptor stack is not supported in simple cache
at org.infinispan.cache.impl.SimpleCacheImpl.removeInterceptor(SimpleCacheImpl.java:952)
at org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.removeInterceptor(AbstractDelegatingAdvancedCache.java:85)
at org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion.prepareForVersionedEntries(BaseTransactionalDataRegion.java:154)
at org.hibernate.cache.infinispan.impl.BaseTransactionalDataRegion.createAccessDelegate(BaseTransactionalDataRegion.java:122)
at org.hibernate.cache.infinispan.entity.EntityRegionImpl.buildAccessStrategy(EntityRegionImpl.java:50)
at org.hibernate.internal.SessionFactoryImpl.determineEntityRegionAccessStrategy(SessionFactoryImpl.java:624)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:332)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)
... 9 more
-
11. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
pferraro Oct 6, 2017 10:04 PM (in response to mikedevva)Here's the problem:
hibernate-orm/BaseTransactionalDataRegion.java at 5.0 · hibernate/hibernate-orm · GitHub
The region factory implementation assumes an interceptor stack exists in order to support NON_STRICT_READ_WRITE cache access. Until this is fixed, you'll either need to use a transactional cache (disabling the simple cache optimization) or switch these entities to use READ_WRITE cache access (allowing the use of the simple cache optimization).
-
12. Re: Wildfly 10 - Interceptor stack is not supported in simple cache
mikedevva Oct 10, 2017 1:32 PM (in response to pferraro)If I switch all of the entities using NONSTRICT_READ_WRITE to READ_WRITE, I don't get any errors. We will just need to look to make sure this is acceptable. Hopefully there will not be a performance hit.