Hello,
I crated a sample application to test the persistent of drools workflow. I
tried the example given in the documentation using H2 Db, everything works
fine.
But when I tried to move to Oracle, I have several problems. I resolved the
bug related to entity names when they are longer than 30, but I still have
an other problem with BitronixTransactionManager
Can you please check if I'm missing some things ?
Here's my stack trace
INFO: schema export complete
May 11, 2011 12:50:14 PM bitronix.tm.BitronixTransactionManager logVersion
INFO: Bitronix Transaction Manager version 1.3.2
May 11, 2011 12:50:14 PM bitronix.tm.Configuration buildServerIdArray
WARNING: cannot get this JVM unique ID. Make sure it is configured and you
only use ASCII characters. Will use IP address instead (unsafe for
production usage!).
May 11, 2011 12:50:14 PM bitronix.tm.Configuration buildServerIdArray
INFO: JVM unique ID: <184.51.16.220>
May 11, 2011 12:50:14 PM bitronix.tm.journal.DiskJournal open
WARNING: active log file is unclean, previous server crash ?
javax.persistence.PersistenceException: [PersistenceUnit:
org.drools.persistence.jpa] Unable to build EntityManagerFactory
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:60)
at com.sample.ProcessTest.main(ProcessTest.java:52)
Caused by: org.hibernate.HibernateException: Could not obtain BTM
transaction manager instance
at
org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:50)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:357)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:47)
... 8 more
Caused by: bitronix.tm.utils.InitializationException: recovery failed,
cannot safely start the transaction manager
at
bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:65)
at
bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:41)
... 13 more
Caused by: bitronix.tm.recovery.RecoveryException: error running recovery on
resource jdbc/CCOD02 (XAER_RMERR)
at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:191)
at bitronix.tm.recovery.Recoverer.run(Recoverer.java:105)
at
bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:49)
... 14 more
Caused by: javax.transaction.xa.XAException
at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:626)
at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:74)
at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:39)
at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:230)
at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:185)
... 16 more
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code =
-2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):
[../../../src/share/back/util.c:820]
I overwrote the file persistence.xml of drools-persistence-jpa-5.0.1.jar
<?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.drools.persistence.jpa"
transaction-type="RESOURCE_LOCAL" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/db</jta-data-source>
<class>org.drools.persistence.session.SessionInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceEventInfo</class>
<class>org.drools.persistence.processinstance.WorkItemInfo</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.connection.driver_class"
value="oracle.jdbc.OracleDriver"/>
<property name="javax.persistence.jdbc.url"
value="jdbc:oracle:thin:@gfxdevdb01.fr.world.xxx:1567:xxxx"/>
<property name="javax.persistence.jdbc.user" value="user"/>
<property name="javax.persistence.jdbc.password"
value="pwd"/>
<property name="hibernate.connection.autocommit" value="true"
/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
The data source is created with API way :
PoolingDataSource ds = new PoolingDataSource();
ds.setUniqueName("jdbc/db");
ds.setClassName("oracle.jdbc.xa.client.OracleXADataSource");
ds.setMaxPoolSize(3);
ds.setAllowLocalTransactions(true);
ds.getDriverProperties().put("user", "user");
ds.getDriverProperties().put("password", "pwd");
ds.getDriverProperties().put("URL",
"jdbc:oracle:thin:@gfxdevdb01.fr.world.xxx:1567:xxxx");
ds.init();
the exception is launched in this line
EntityManagerFactory emf = Persistence.createEntityManagerFactory(
"org.drools.persistence.jpa" );
Thanks for your help
Moundir
--
View this message in context:
http://drools.46999.n3.nabble.com/Drools-flow-persistence-with-Oracle-Cou...
Sent from the Drools: User forum mailing list archive at
Nabble.com.