Region.destroy() attempts to remove a cache listener, but region class is not annotated with @Listener
Description
Activity
Show:
![](https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar.png)
Former user January 6, 2015 at 8:00 PM
Closing in preparation for releasing 4.3.8.
![](https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/default-avatar.png)
Former user January 6, 2015 at 7:48 AM
Fixed in master and 4.3 branch.
![](https://secure.gravatar.com/avatar/6b3cf844a631dd094a913991a9576ea2?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FBM-4.png)
Brett Meyer December 1, 2014 at 9:49 PM
Several were closed accidentally. I re-opened it.
![](https://secure.gravatar.com/avatar/096c8662be83e77997254878bdbda33e?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPF-5.png)
Paul Ferraro November 25, 2014 at 9:45 PM
I see that https://github.com/hibernate/hibernate-orm/pull/783 (my PR against master) was closed without comment. Why was that?
![](https://secure.gravatar.com/avatar/096c8662be83e77997254878bdbda33e?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPF-5.png)
Paul Ferraro October 14, 2014 at 9:08 PM
Yes. Removing a listener that was never added results in an exception in Infinispan 7.0.
Fixed
Assignee
![](https://secure.gravatar.com/avatar/dc62e37e3f68a309988f7e836b5add13?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FGZ-0.png)
Reporter
![](https://secure.gravatar.com/avatar/096c8662be83e77997254878bdbda33e?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FPF-5.png)
Fix versions
Affects versions
Priority
Created August 15, 2014 at 11:53 AM
Updated April 22, 2015 at 6:40 PM
Resolved January 6, 2015 at 7:48 AM
When configuring hibernate with an Infinispan 2LC and Infinispan 7.0, I see the following exception during SessionFactory.close():
ERROR [org.jboss.as.jpa] (ServerService Thread Pool -- 24) WFLYJPA0007: Failed to stop persistence unit service stateful.war#mypc: org.infinispan.notifications.IncorrectListenerException: Cache listener class org.hibernate.cache.infinispan.entity.EntityRegionImpl must be annotated with org.infinispan.notifications.annotation.Listener at org.infinispan.notifications.impl.AbstractListenerImpl.testListenerClassValidity(AbstractListenerImpl.java:215) at org.infinispan.notifications.impl.AbstractListenerImpl.removeListener(AbstractListenerImpl.java:139) at org.infinispan.notifications.cachelistener.CacheNotifierImpl.removeListener(CacheNotifierImpl.java:1025) at org.infinispan.cache.impl.CacheImpl.removeListener(CacheImpl.java:642) at org.infinispan.cache.impl.AbstractDelegatingCache.removeListener(AbstractDelegatingCache.java:341) at org.hibernate.cache.infinispan.impl.BaseRegion.destroy(BaseRegion.java:152) at org.hibernate.internal.SessionFactoryImpl.close(SessionFactoryImpl.java:1349) at org.hibernate.jpa.internal.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:370) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2$1.run(PersistenceUnitServiceImpl.java:220) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2$1.run(PersistenceUnitServiceImpl.java:206) at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_65] at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474) [wildfly-security-manager-1.0.0.Final.jar:1.0.0.Final] at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$2.run(PersistenceUnitServiceImpl.java:239) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65] at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final]
During Region.destroy(..) the base region implementation tries remove the region instance as a cache listener, however none of the region implementations in hibernate-infinispan seem to be annotated with @Listener, hence the exception. This failure is not immediately caught by the CacheImplementor and thus prevents subsequent regions from being destroyed.