Bug 955527 - javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory
Summary: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Un...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DR5
: 6.0.0
Assignee: Kris Verlaenen
QA Contact: Zuzana Krejčová
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-23 08:42 UTC by Ryan Zhang
Modified: 2016-08-01 01:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Deploying both business-central and dashbuilder in parallel gives an error - javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory Consequence: Fails to start the server. Fix: Dash-builder is now upgraded to hibernate4 so that it can be deployed in parallel with business-central as per the installation procedure. Result: Both, busines-central.war and dashbuilder.war can now be deployed simultaneously without giving any errors.
Clone Of:
Environment:
Last Closed: 2014-08-06 20:09:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
server.log (26.96 KB, text/x-log)
2013-04-23 08:42 UTC, Ryan Zhang
no flags Details

Description Ryan Zhang 2013-04-23 08:42:02 UTC
Created attachment 738872 [details]
server.log

Description of problem:
The following error is found during the deployment of kie-ide.war when using JDK 6.
16:29:00,818 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 53) MSC000001: Failed to start service jboss.persistenceunit."kie-ide.war#org.jbpm.domain": org.jboss.msc.service.StartException in service jboss.persistenceunit."kie-ide.war#org.jbpm.domain": javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] Unable to build EntityManagerFactory
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_24]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_24]
	at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.domain] 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:1750)
	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.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath).
	at org.hibernate.cache.internal.NoCachingRegionFactory.buildTimestampsRegion(NoCachingRegionFactory.java:87)
	at org.hibernate.cache.spi.UpdateTimestampsCache.<init>(UpdateTimestampsCache.java:62)
	at org.hibernate.internal.CacheImpl.<init>(CacheImpl.java:72)
	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


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

How reproducible:


Steps to Reproduce:
1.Using oracle JDK 1.6.0_24+ to deploy kie-ide.war into EAP 6.1
2.Error happens during the deployment.
3.
  
Noticed that there is no such issue when using oracle JDK7
Actual results:


Expected results:


Additional info:

Comment 1 Ryan Zhang 2013-04-23 09:32:05 UTC
Have to correct the report issue:

The problem only happen to oracle JDK 1.6.0_24, not happen to oracle JDK 1.6.0_43.

cc Lee
What is the JRE you are using for reproducing the problem. 
I saw it is "java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_43]" in your email.

Comment 2 Zuzana Krejčová 2013-04-23 11:36:08 UTC
It doesn't seem to be dependent on the jdk used - happened to me once with some 1.6 jdk, when I stopped the server and started it again, the error was gone.

It seems to be a random bug.

Comment 3 lcarlon 2013-04-24 00:34:59 UTC
Ryan, for me it's,

java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)

Comment 4 Ryan Zhang 2013-05-09 05:54:44 UTC
(In reply to comment #2)
> It doesn't seem to be dependent on the jdk used - happened to me once with
> some 1.6 jdk, when I stopped the server and started it again, the error was
> gone.
> 
> It seems to be a random bug.
Agree, I can even reproduce this by 1.7 jdk.

This bug happens pretty randomly. But it is reproducable to me if you just try to restart the server for a couple of times.
e

Comment 6 Marek Winkler 2013-05-15 10:36:17 UTC
I have experienced this bug only 2-3 times from about 15 deployments of DR4 on jdk 1.7, EAP 6.1.Beta.

Nevertheless, I got a hint that it might be caused by an improperly configured dependency. EAP 6 loads modules in parallel and it might happen that some module not listed as a dependency is actually required by the deployment but not loaded yet.

Comment 7 Zuzana Krejčová 2013-05-15 10:51:26 UTC
Issue disappeared for me after I added these dependencies to the module.xml:

    <dependencies>
        <module name="org.infinispan.cachestore.jdbc"/>
        <module name="org.hibernate"/>
    </dependencies>

(file <server_dir>/modules/system/layers/bpms/org/jboss/as/product/bpms/module.xml for the bpms product)

Comment 8 Zuzana Krejčová 2013-05-15 10:53:18 UTC
My apologies, after trying a few times successfully, posting the above comment and trying again, it started failing again.

Comment 10 Maciej Swiderski 2013-05-21 10:18:55 UTC
do you deploy dashbuilder web app on the same server? 
This was observed when both applications are deployed at the same time and currently workaround for this is to deploy first kie-ide and then dash builder application - which usually mean deploy it (dashbuilder) after application server is up. Alternatively we could try to enforce the given order of deployments (http://stackoverflow.com/questions/13364735/jboss-as-7-deploying-wars-in-certain-order)

Comment 11 lcarlon 2013-05-22 04:02:24 UTC
Hi Maciej,

Yes I deployed them both at the same time. I moved onto a new machine yesterday (not because of this issue) and I haven't experienced this issue yet on the new machine.

Having said that, I just removed the dashbuilder war from the deployments directory on the old machine to test this, and kie-ide deployed and I was able to log in.

Lee

Comment 12 Rajesh Rajasekaran 2013-05-22 13:04:36 UTC
Our installation procedure is to unzip the bpms distribution we provide which includes both the wars on top of EAP. So we expect customers to have both wars deployed at the same time when starting EAP.

Comment 13 Kris Verlaenen 2013-05-30 10:25:38 UTC
The issue with dash-builder and kie-wb war when deployed together has been solved by upgrading dash-builder to hibernate4.

Comment 14 Zuzana Krejčová 2013-07-11 10:58:06 UTC
DR6:
After multiple restarts with both business-central and dashbuilder deployed in parallel, this issue still has not manifested). Seems to be fixed.

Comment 15 Kanchan Desai 2013-10-15 08:33:35 UTC
Hi Zuzana,

Doc Text has been added. Can you please review the CCFR.


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