Hans-

We might not have Jonas' TransactionManager location configured in the automatic TM lookup in OpenJPA. Can you try to manually specify it with the following property:

openjpa.ManagedRuntime: jndi(TransactionManagerName=java:comp/ UserTransaction)

if that doesn't work, try:

openjpa.ManagedRuntime: jndi(TransactionManagerName=/ UserTransaction)

(apparently, Jonas' UserTransaction implementation is also their TransactionManager implementation)

If that doesn't work, can you post the complete stack trace?

If it does work, please let us know so we can add it to the list of auto-discovered transaction managers.



On Feb 5, 2007, at 12:05 PM, Hans J. Prueller wrote:

Hi there,



I'm trying to migrate our "old" J2EE1.4 / EJB2.1 applications persistence to
openJPA. Currently I got stuck when

trying to configure OpenJPA persistence, when creating the
EntityManagerFactory and the EntityManager instance,

I get the following error:



<4|true|0.9.6-incubating>
org.apache.openjpa.persistence.InvalidStateException:

Could not perform automatic lookup of EJB container's
javax.transaction.Transact

ionManager implementation. Please ensure that you are running the
application fr

om within an EJB 1.1 compliant EJB container, and then set the
org.apache.openjp

a.ManagedRuntime property to the appropriate value to obtain the
TransactionMana

ger.

        at
org.apache.openjpa.ee.AutomaticManagedRuntime.getTransactionManager(A

utomaticManagedRuntime.java:180)

        at
org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransa

ction(AbstractBrokerFactory.java:598)

        at
org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:292)

        at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBro

kerFactory.java:165)

        at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(Delegatin

gBrokerFactory.java:139)

        at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityM

anager(EntityManagerFactoryImpl.java:187)





Currently I'm running the application within the JOnAS 4.8.3 J2EE Server.
How can I configure open JPA to

use the provided managed Transactions of JOnAS? (this works also with
Hibernate 2.x so I assume it should

somehow be possible with openJPA?)



any help appreciated!



regards,

HANS



===========================
virtually hanzz...



 <http://hanzz.zapto.org> http://hanzz.zapto.org (personal)
 <http://www.cse.dmu.ac.uk/~hansp> http://www.cse.dmu.ac.uk/~hansp
(research)




Reply via email to