Brms persistance.xml loading in MDB
dtalex Dec 12, 2013 5:39 AMHi,
I am trying to trigger jbpm events from a jms queue.
I use EAP 6.1.0 with BRMS 5.3.1. deployable.
I created an "org.drools" module including all brms libs.
And referenced it in my custom Classes.
Custom ejb references myBPMUtils
myBPMUtils uses the BRMSlibs
Here is the code invoking JTA
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );
Here is my custom libs module xml.
<module xmlns="urn:jboss:module:1.1" name="it.utils"> <resources> <resource-root path="BPMUtils.jar"/> <!-- Insert resources here --> </resources> <dependencies> <module name="org.drools"/> <module name="org.jbpm.persistence.jpa"/> </dependencies> </module>
Module is made global in standalone .xml and correctly used by my EJB.
I put following persistence.xml in my META-INF FOLDER
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source> <mapping-file>META-INF/JBPMorm.xml</mapping-file> <mapping-file>META-INF/ProcessInstanceInfoMapping.xml</mapping-file> <mapping-file>META-INF/ExtraIndexes.hbm.xml</mapping-file> <class>org.drools.persistence.info.SessionInfo</class> <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class> <class>org.drools.persistence.info.WorkItemInfo</class> <class>org.jbpm.process.audit.ProcessInstanceLog</class> <class>org.jbpm.process.audit.NodeInstanceLog</class> <class>org.jbpm.process.audit.VariableInstanceLog</class> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /> <property name="hibernate.max_fetch_depth" value="3" /> <property name="hibernate.hbm2ddl.auto" value="update" /> <property name="hibernate.show_sql" value="false" /> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transact" /> <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause proble --> <property name="hibernate.id.new_generator_mappings" value="false" /> </properties> </persistence-unit> </persistence>
And I get the following error when I try to start my EJB.
10:21:42,404 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 67) MSC000001: Failed to start service jboss.persistenceunit."QueueListenerMDB.jar#org.jbpm.persistence.jpa": org.jboss
.msc.service.StartException in service jboss.persistenceunit."QueueListenerMDB.jar#org.jbpm.persistence.jpa": javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] cla
ss or package not found
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103) [jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
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: org.jbpm.persistence.jpa] class or package not found
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1416)
at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:1199)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:1063)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:701)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:91)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200) [jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57) [jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99) [jboss-as-jpa-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
... 4 more
Caused by: java.lang.ClassNotFoundException: org.drools.persistence.info.SessionInfo from [Module "org.hibernate:main" from local module loader @4fcc8cf1 (finder: local module finder @7e394b24 (roo
ts: /opt/jboss/EAP-6.1.0/modules,/opt/jboss/EAP-6.1.0/modules/system/layers/base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_45]
at java.lang.Class.forName(Class.java:270) [rt.jar:1.7.0_45]
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:170)
at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1333)
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1405)
... 11 more
Suggestions?
Regards,
Ale