I have managed to configure and test OpenJPA in XA environment, and
everything works ok,
but cant configure it together with ODE.

Thanks in advance

On Feb 18, 2008 11:00 AM, xenHalfLife <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I have created database before running but now get some other error which
> I cant solve. Example
> in usage is same as previously explained. Also, running with or without
> file persistence.xml in META-INF/ folder
> does not help either. (Tried with both JTA and RESOURCE_LOCAL definition).
>
> Contents of the persistence.xml are as follows:
> =========================================================
> <?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";
>     version="1.0">
>     <persistence-unit name="testunit" transaction-type="RESOURCE_LOCAL">
>         <class>my.jpa.test.Message</class>
>         <properties>
>             <property name="openjpa.Connection2URL"
> value="jdbc:mysql://localhost/bpel"/>
>             <property name="openjpa.Connection2DriverName" value="
> com.mysql.jdbc.Driver"/>
>             <property name="openjpa.Connection2UserName" value="root"/>
>             <property name="openjpa.Connection2Password" value="root"/>
>             <property name="openjpa.Log" value="DefaultLevel=TRACE"/>
>         </properties>
>     </persistence-unit>
> </persistence>
> =========================================================
>
> Following error occurs, thanks for any tips in advance:
>
> =========================================================
> 2008-02-18 10:42:13,440 DEBUG [openjpa.MetaData] - Resolving mapping for "
> [EMAIL PROTECTED]".
> 2008-02-18 10:42:13,440 DEBUG [openjpa.MetaData] - "
> org.apache.ode.store.jpa.DeploymentUnitDaoImpl" has mapping strategy
> "full".
> 2008-02-18 10:42:13,440 DEBUG [openjpa.MetaData] -     Resolving field "
> [EMAIL PROTECTED]".
> org.apache.ode.bpel.iapi.ContextException: DbError
>     at org.apache.ode.store.ProcessStoreImpl.exec(ProcessStoreImpl.java
> :545)
>     at org.apache.ode.store.ProcessStoreImpl.deploy(ProcessStoreImpl.java
> :179)
>     at org.ode.xa.MockBpelServer.deploy(MockBpelServer.java:91)
>     at org.ode.xa.Main2.main(Main2.java:29)
> Caused by: java.util.concurrent.ExecutionException: 
> <openjpa-1.0.1-r420667:592145
> nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: error enlisting a
> JdbcConnectionHandle of a JdbcPooledConnection from datasource mysql-1 in
> state ACCESSIBLE wrapping
> [EMAIL PROTECTED] on
> [EMAIL PROTECTED] {SELECT t0.id,
> t0.VERSION FROM STORE_VERSIONS t0} [code=0, state=null]2008-02-18
> 10:42:13,455 DEBUG [openjpa.MetaData] -     "_processes" has mapping
> strategy "
> org.apache.openjpa.jdbc.meta.strats.RelationCollectionInverseKeyFieldStrategy
> ".
> 2008-02-18 10:42:13,502 DEBUG [openjpa.jdbc.Schema] - Reading table
> information for schema name "null", table name "OPENJPA_SEQUENCE_TABLE".
> 2008-02-18 10:42:13,502 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> getColumns: bpel, null, OPENJPA_SEQUENCE_TABLE, null
> 2008-02-18 10:42:13,565 DEBUG [openjpa.jdbc.Schema] - Reading column
> information for table "openjpa_sequence_table".
> 2008-02-18 10:42:13,565 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "ID" on table "openjpa_sequence_table".
> 2008-02-18 10:42:13,565 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "SEQUENCE_VALUE" on table "openjpa_sequence_table".
> 2008-02-18 10:42:13,612 DEBUG [openjpa.jdbc.Schema] - Reading table
> information for schema name "null", table name "STORE_DU".
> 2008-02-18 10:42:13,612 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> getColumns: bpel, null, STORE_DU, null
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.Schema] - Reading column
> information for table "store_du".
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "NAME" on table "store_du".
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "DEPLOYDT" on table "store_du".
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "DEPLOYER" on table "store_du".
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "DIR" on table "store_du".
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.Schema] - Reading table
> information for schema name "null", table name "STORE_PROCESS".
> 2008-02-18 10:42:13,643 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> getColumns: bpel, null, STORE_PROCESS, null
> 2008-02-18 10:42:13,659 DEBUG [openjpa.jdbc.Schema] - Reading column
> information for table "store_process".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "PID" on table "store_process".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "STATE" on table "store_process".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "TYPE" on table "store_process".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "VERSION" on table "store_process".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "DU" on table "store_process".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.Schema] - Reading table
> information for schema name "null", table name "STORE_PROCESS_PROP".
> 2008-02-18 10:42:13,674 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> getColumns: bpel, null, STORE_PROCESS_PROP, null
> 2008-02-18 10:42:13,705 DEBUG [openjpa.jdbc.Schema] - Reading column
> information for table "store_process_prop".
> 2008-02-18 10:42:13,705 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "id" on table "store_process_prop".
> 2008-02-18 10:42:13,705 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "PROP_KEY" on table "store_process_prop".
> 2008-02-18 10:42:13,705 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "PROP_VAL" on table "store_process_prop".
> 2008-02-18 10:42:13,705 DEBUG [openjpa.jdbc.Schema] - Reading table
> information for schema name "null", table name "STORE_PROC_TO_PROP".
> 2008-02-18 10:42:13,705 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> getColumns: bpel, null, STORE_PROC_TO_PROP, null
> 2008-02-18 10:42:13,737 DEBUG [openjpa.jdbc.Schema] - Reading column
> information for table "store_proc_to_prop".
> 2008-02-18 10:42:13,737 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "ProcessConfDaoImpl_PID" on table "store_proc_to_prop".
> 2008-02-18 10:42:13,737 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "element_id" on table "store_proc_to_prop".
> 2008-02-18 10:42:13,737 DEBUG [openjpa.jdbc.Schema] - Reading table
> information for schema name "null", table name "STORE_VERSIONS".
> 2008-02-18 10:42:13,737 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> getColumns: bpel, null, STORE_VERSIONS, null
> 2008-02-18 10:42:13,752 DEBUG [openjpa.jdbc.Schema] - Reading column
> information for table "store_versions".
> 2008-02-18 10:42:13,752 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "id" on table "store_versions".
> 2008-02-18 10:42:13,768 DEBUG [openjpa.jdbc.Schema] - Found existing
> column "VERSION" on table "store_versions".
> 2008-02-18 10:42:13,768 DEBUG [openjpa.jdbc.Schema] - Reading sequence
> information for schema "null", sequence name "null".
> 2008-02-18 10:42:13,768 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> [0 ms] commit
> 2008-02-18 10:42:13,768 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 17189485> [0 ms] close
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Processing registered
> persistence-capable class "class
> org.apache.ode.store.jpa.VersionTrackerDAOImpl".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Processing registered
> persistence-capable class "class
> org.apache.ode.store.jpa.ProcessConfPropertyDaoImpl".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Processing registered
> persistence-capable class "class
> org.apache.ode.store.jpa.DeploymentUnitDaoImpl".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Processing registered
> persistence-capable class "class
> org.apache.ode.store.jpa.ProcessConfDaoImpl".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Loading metadata for
> "class org.apache.ode.store.jpa.VersionTrackerDAOImpl" under mode
> "[META][QUERY]".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Parsing class "
> org.apache.ode.store.jpa.VersionTrackerDAOImpl".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Parsing package "
> org.apache.ode.store.jpa.VersionTrackerDAOImpl".
> 2008-02-18 10:42:14,065 DEBUG [openjpa.MetaData] - Generating default
> metadata for type "org.apache.ode.store.jpa.VersionTrackerDAOImpl".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - Set persistence-capable
> superclass of "org.apache.ode.store.jpa.VersionTrackerDAOImpl" to "null".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - Resolving metadata for
> "[EMAIL PROTECTED]".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] -     Resolving field "
> [EMAIL PROTECTED]".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - Preparing mapping for "
> org.apache.ode.store.jpa.VersionTrackerDAOImpl".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] -     Resolving field "
> [EMAIL PROTECTED]".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] -     "_version" has
> mapping strategy "
> org.apache.openjpa.jdbc.meta.strats.PrimitiveFieldStrategy".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - "
> org.apache.ode.store.jpa.VersionTrackerDAOImpl<discriminator>" has mapping
> strategy "none".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - "
> org.apache.ode.store.jpa.VersionTrackerDAOImpl<version>" has mapping
> strategy "none".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - Resolving mapping for "
> [EMAIL PROTECTED]".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - "
> org.apache.ode.store.jpa.VersionTrackerDAOImpl" has mapping strategy
> "full".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] - Initializing mapping
> for "[EMAIL PROTECTED]".
> 2008-02-18 10:42:14,080 DEBUG [openjpa.MetaData] -     Resolving field "
> [EMAIL PROTECTED]".
> 2008-02-18 10:42:14,159 DEBUG [openjpa.Query] - Executing query: select v
> from VersionTrackerDAOImpl v
> 2008-02-18 10:42:14,268 DEBUG [openjpa.jdbc.JDBC] - <t 21324485, conn
> 18330704> [0 ms] close
>
>     at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
>     at java.util.concurrent.FutureTask.get(Unknown Source)
>     at org.apache.ode.store.ProcessStoreImpl.exec(ProcessStoreImpl.java
> :543)
>     ... 3 more
> Caused by: <openjpa-1.0.1-r420667:592145 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: error enlisting a
> JdbcConnectionHandle of a JdbcPooledConnection from datasource mysql-1 in
> state ACCESSIBLE wrapping
> [EMAIL PROTECTED] on
> [EMAIL PROTECTED] {SELECT t0.id,
> t0.VERSION FROM STORE_VERSIONS t0} [code=0, state=null]
>     at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(
> DBDictionary.java:3938)
>     at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
> SQLExceptions.java:97)
>     at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
> SQLExceptions.java:83)
>     at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
> SQLExceptions.java:59)
>     at
> org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.handleCheckedException
> (SelectResultObjectProvider.java:155)
>     at org.apache.openjpa.lib.rop.EagerResultList.<init>(
> EagerResultList.java:40)
>     at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1223)
>     at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:990)
>     at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:799)
>     at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:769)
>     at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:765)
>     at org.apache.openjpa.kernel.DelegatingQuery.execute(
> DelegatingQuery.java:517)
>     at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java
> :238)
>     at org.apache.openjpa.persistence.QueryImpl.getResultList(
> QueryImpl.java:277)
>     at org.apache.ode.store.jpa.ConfStoreConnectionJpa.getNextVersion(
> ConfStoreConnectionJpa.java:76)
>     at org.apache.ode.store.ProcessStoreImpl$1.call(ProcessStoreImpl.java
> :181)
>     at org.apache.ode.store.ProcessStoreImpl$1.call(ProcessStoreImpl.java
> :180)
>     at org.apache.ode.store.ProcessStoreImpl$Callable.call(
> ProcessStoreImpl.java:702)
>     at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
>     at java.util.concurrent.FutureTask.run(Unknown Source)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: error
> enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource
> mysql-1 in state ACCESSIBLE wrapping
> [EMAIL PROTECTED] on
> [EMAIL PROTECTED] {SELECT t0.id,
> t0.VERSION FROM STORE_VERSIONS t0} [code=0, state=null]
>     at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(
> LoggingConnectionDecorator.java:201)
>     at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$000(
> LoggingConnectionDecorator.java:57)
>     at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement
> (LoggingConnectionDecorator.java:228)
>     at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(
> DelegatingConnection.java:163)
>     at
> org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement
> (ConfiguringConnectionDecorator.java:140)
>     at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(
> DelegatingConnection.java:163)
>     at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement
> (JDBCStoreManager.java:1308)
>     at org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(
> DelegatingConnection.java:152)
>     at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(
> SQLBuffer.java:475)
>     at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(
> SQLBuffer.java:455)
>     at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:354)
>     at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:327)
>     at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(
> LogicalUnion.java:407)
>     at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java
> :218)
>     at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java
> :208)
>     at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(
> SelectResultObjectProvider.java:94)
>     at org.apache.openjpa.lib.rop.EagerResultList.<init>(
> EagerResultList.java:34)
>     ... 17 more
> Feb 18, 2008 10:42:14 AM bitronix.tm.BitronixTransactionManager shutdown
> INFO: shutting down Bitronix Transaction Manager
> =========================================================
>
>
>
>
> On Feb 11, 2008 5:47 PM, Alex Boisvert <[EMAIL PROTECTED]> wrote:
>
> > Looks like OpenJPA is trying to synchronize your database schema with
> > its
> > own internal model... which results in DDL statements and those are not
> > transactional so can't run within a transaction.
> >
> > I would try either,
> > 1) initialize/synchronize your database schema before starting Ode
> > 2) disable schema synchronization in OpenJPA
> >
> > http://openjpa.apache.org/docs/latest/manual/manual.html#openjpa.jdbc.SynchronizeMappings
> >
> > alex
> >
> > On 2/9/08, xenHalfLife <[EMAIL PROTECTED]> wrote:
> > >
> > > Hello all,
> > >
> > > I am still trying to configure ODE in XA environment. Next example is
> > > based on
> > > MockBpelServer class found in org.apache.ode.bpel.runtime package.
> > That
> > > example
> > > demonstrates how to manage transactions using TransactionManager
> > > interface.
> > >
> > > Only changes I have made to MockBpelServer are the injection of
> > DataSource
> > > and
> > > TransactionManager objects by me. These 2 objects are created
> > externally,
> > > and
> > > set to MockBpelServer for further usage. All other code of
> > MockBpelServer
> > > is
> > > untouched, including 2 crucial methods: deploy and invoke.
> > >
> > > MySql is used as database and Bitrnoix as JTA transaction manager. I
> > have
> > > tested
> > > these two with ActiveMq JMS broker, and they function correctly.
> > >
> > > Thanks in advance.
> > >
> > > Main method contains following code, and it tries only to
> > transactionally
> > > invoke
> > > ODE by using JTA API (it is not trying to invoke ODE and some other XA
> > > resource,
> > > that would be next step when this is working)
> > >
> > >
> >
>
>

Reply via email to