Bug 999354 - Infinispan library (such as JDG) breaks Hibernate 2LC with java.lang.ClassCastException: org.infinispan.remoting.ReplicationQueueImpl cannot be cast to org.infinispan.remoting.ReplicationQueue
Infinispan library (such as JDG) breaks Hibernate 2LC with java.lang.ClassCas...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Clustering, Hibernate (Show other bugs)
6.1.0,6.1.1
Unspecified Unspecified
unspecified Severity high
: DR1
: EAP 6.3.0
Assigned To: Paul Ferraro
Marek Schmidt
Russell Dickenson
: Reopened
Depends On: 1036889
Blocks: 1013819
  Show dependency treegraph
 
Reported: 2013-08-21 04:33 EDT by Marek Schmidt
Modified: 2014-08-06 10:36 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1002931 (view as bug list)
Environment:
Last Closed: 2014-08-06 10:36:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
reproducer war (4.30 MB, application/x-webarchive)
2013-08-21 04:36 EDT, Marek Schmidt
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFK2-154 Major Closed seam-blog example fails to deploy on EAP 6.1 ha profile with java.lang.ClassCastException: org.infinispan.remoting.Repli... 2016-03-31 22:58 EDT

  None (edit)
Description Marek Schmidt 2013-08-21 04:33:10 EDT
Description of problem:

A WAR deployment containing its own infinispan (such as JDG helloworld quickstart) and also having persistence.xml with second level cache enabled fails to deploy on EAP 6.1 HA configuration (standalone-ha.xml or standalone-full-ha.xml)

Version-Release number of selected component (if applicable):

EAP 6.1.0, EAP 6.1.1.ER4

How reproducible:
Always

Steps to Reproduce:
1. Get JDG 6.1 helloworld-jdg quickstart (or see the attachment)
2. Add persistence.xml with 2lc, e.g.:

<?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_2_0.xsd" 
             version="2.0">
   <persistence-unit name="entityManager">
      <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
      <properties>
         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
         <property name="hibernate.cache.use_second_level_cache" value="true"/>
         <property name="hibernate.cache.use_query_cache" value="true"/>
      </properties>
   </persistence-unit>
</persistence>

3. deploy the helloworld-jdg on standalone-ha.xml or standalone-full-ha.xml configuration of EAP 6.1 

Actual results:

fails to deploy with:

10:26:20,759 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 53) MSC000001: Failed to start service jboss.persistenceunit."jboss-as-helloworld-jdg.war#entityManager": org.jboss.msc.service.StartException in service jboss.persistenceunit."jboss-as-helloworld-jdg.war#entityManager": javax.persistence.PersistenceException: [PersistenceUnit: entityManager] Unable to build EntityManagerFactory
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
	at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: entityManager] Unable to build EntityManagerFactory
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:930)
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:92)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
	... 4 more
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:264)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1762)
	at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)
	... 9 more
Caused by: org.hibernate.cache.CacheException: Unable to start region factory
	at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:323)
	at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:70)
	at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:40)
	at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:35)
	at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91)
	at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
	... 15 more
Caused by: java.lang.ClassCastException: org.infinispan.remoting.ReplicationQueueImpl cannot be cast to org.infinispan.remoting.ReplicationQueue
	at org.infinispan.configuration.cache.LegacyConfigurationAdaptor.adapt(LegacyConfigurationAdaptor.java:306)
	at org.infinispan.manager.DefaultCacheManager.defineConfiguration(DefaultCacheManager.java:468)
	at org.infinispan.manager.DefaultCacheManager.defineConfiguration(DefaultCacheManager.java:443)
	at org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager.defineConfiguration(DefaultEmbeddedCacheManager.java:77)
	at org.hibernate.cache.infinispan.InfinispanRegionFactory.defineGenericDataTypeCacheConfigurations(InfinispanRegionFactory.java:492)
	at org.hibernate.cache.infinispan.InfinispanRegionFactory.start(InfinispanRegionFactory.java:318)
	... 20 more

10:26:20,968 ERROR [org.jboss.as.server] (management-handler-thread - 4) JBAS015870: Deploy of deployment "jboss-as-helloworld-jdg.war" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.persistenceunit.\"jboss-as-helloworld-jdg.war#entityManager\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"jboss-as-helloworld-jdg.war#entityManager\": javax.persistence.PersistenceException: [PersistenceUnit: entityManager] Unable to build EntityManagerFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: entityManager] Unable to build EntityManagerFactory
    Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor]
    Caused by: org.hibernate.cache.CacheException: Unable to start region factory
    Caused by: java.lang.ClassCastException: org.infinispan.remoting.ReplicationQueueImpl cannot be cast to org.infinispan.remoting.ReplicationQueue"}}


Expected results:

Application deploys

Additional info:
Comment 1 Marek Schmidt 2013-08-21 04:36:02 EDT
Created attachment 788752 [details]
reproducer war
Comment 2 Marek Schmidt 2013-08-21 04:51:02 EDT
I cannot reproduce the problem on Wildfly 8.0.0.Alpha4
Comment 3 Radoslav Husar 2013-08-21 06:56:42 EDT
BTW I see 6.0.0 and 6.0.1 are unaffected, regression introduced in 6.1.0 release.
Comment 4 Paul Ferraro 2013-08-29 16:07:38 EDT
This is misfiled, IMO  This is a JDG issue - not an EAP issue.  It is JDG's responsibility to play nice with EAP, not the other way around.

In my opinion this is a design issue with JDG's "library mode".
Comment 5 Martin Gencur 2013-08-30 05:30:36 EDT
I created https://bugzilla.redhat.com/show_bug.cgi?id=1002931 for JDG. Thanks for testing this with several versions of the container. This is indeed a regression for JDG between EAP 6.0.1 and EAP 6.1. 

This bug can be closed.
Comment 7 Marek Novotny 2013-09-18 10:03:13 EDT
Please see my rationale to reopen this bug.

It is not solely an issue of JDG. Seam application which bundles infinispan library and uses hibernate 2lc in JPA is affected too, so it means every app which bundles ISPN and uses Hibernate 2 LC will experience the same issue.
Comment 9 dereed 2013-09-25 12:05:32 EDT
This is a classloading bug in the Infinispan bundled with EAP.
See comment #4 on BZ1002931 for more details.
Comment 13 Paul Ferraro 2014-02-11 09:01:48 EST
Please retest after Infinispan 5.2.8 upgrade.
Comment 14 Marek Schmidt 2014-02-21 04:32:25 EST
Still the same problem with both JDG 6.1 and JDG 6.2 on EAP 6.3.0.DR0
Comment 15 Marek Schmidt 2014-02-21 04:35:03 EST
btw. EAP 6.3.0.DR0 still has infinispan 5.2.7.Final-redhat-2, I assume this shouldn't have been ON_QA with DR0.
Comment 17 Richard Janík 2014-02-27 10:39:21 EST
Verified for DR1.

Note You need to log in before you can comment on or make changes to this bug.