Bug 849706

Summary: Hibernate 3 on EAP 6.0: java.lang.ClassCastException: org.hibernate.ejb.EntityManagerFactoryImpl cannot be cast to org.hibernate.ejb.HibernateEntityManagerFactory
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jiri Svitak <jsvitak>
Component: jBPM 5Assignee: Geoffrey De Smet <gdesmet>
Status: CLOSED WONTFIX QA Contact: Jiri Svitak <jsvitak>
Severity: medium Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: brms-jira, lpetrovi, mbaluch, mproctor
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-29 06:16:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
server.log
none
business-central-server persistence.xml
none
jbpm-human-task persistence.xml
none
jboss-deployment-structure.xml
none
standalone.xml none

Description Jiri Svitak 2012-08-20 16:19:14 UTC
Created attachment 605731 [details]
server.log

"java.lang.ClassCastException: org.hibernate.ejb.EntityManagerFactoryImpl cannot be cast to org.hibernate.ejb.HibernateEntityManagerFactory" is thrown when using Hibernate 3 on EAP 6.0. Default Hibernate version in EAP 6.0 is 4, so to use Hibernate 3, then you have to disable it for your .war file manually by creating
app.war/WEB-INF/jboss-deployment-structure.xml. Setting up of my environment is described in this document:
https://docspace.corp.redhat.com/docs/DOC-111367

However Hibernate 4 detects persistence configuration of my .war files and throws the exception attached in server.log. I have tested human task with a simple test and the human task appears in business-central and it's possible to complete it, data passing in HT was not tested. So it's possible that Hibernate 4 has no effect on the deployed BRMS .war files that uses Hibernate 3, but it may bother server admins. To disable the error the only solution I have found is to disable whole JPA module and subsystem in standalone/configuration/standalone.xml of EAP 6.0, however that affects all other deployed applications which use Hibernate 4.

My environment:
EAP 6.0
BRMS 5.3.0 GA patch 01
PostgreSQL 9

Comment 1 Jiri Svitak 2012-08-20 16:24:22 UTC
Created attachment 605733 [details]
business-central-server persistence.xml

Comment 2 Jiri Svitak 2012-08-20 16:25:20 UTC
Created attachment 605735 [details]
jbpm-human-task persistence.xml

Comment 3 Jiri Svitak 2012-08-20 16:25:56 UTC
Created attachment 605736 [details]
jboss-deployment-structure.xml

Comment 4 Jiri Svitak 2012-08-20 16:27:05 UTC
Created attachment 605738 [details]
standalone.xml

Comment 6 Geoffrey De Smet 2012-08-24 11:03:39 UTC
When does this error happen? During deployment? What's the easiest way to reproduce?

Comment 8 Geoffrey De Smet 2012-08-24 14:04:48 UTC
Lukas has asked to me to stall working on this bugzilla, they are revising it.