deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelly Goedert <kelly.goed...@gmail.com>
Subject Re: deltaspike data - A JTA EntityManager cannot use getTransaction
Date Tue, 30 Jun 2015 12:08:10 GMT
With the properties file it worked. Thanks

On Tue, Jun 30, 2015 at 9:01 AM Thomas Hug <thomas.hug@gmail.com> wrote:

> That's correct, on Wildfly it's global alternatives plus the
> ContainerManagedTransactionStrategy.
>
> On Tue, Jun 30, 2015 at 1:58 PM, Thomas Andraschko <
> andraschko.thomas@gmail.com> wrote:
>
> > You probably need to use global alternatives:
> > http://deltaspike.apache.org/documentation/jpa.html#JTASupport
> >
> > 2015-06-30 13:51 GMT+02:00 Kelly Goedert <kelly.goedert@gmail.com>:
> >
> > > Hi,
> > >
> > > I am trying to use deltaspike data 1.4.1 on wildfly 8.2. When saving an
> > > object I get:
> > >
> > > Caused by: java.lang.IllegalStateException: A JTA EntityManager cannot
> > use
> > > getTransaction()
> > > at
> > >
> > >
> >
> org.hibernate.jpa.spi.AbstractEntityManagerImpl.getTransaction(AbstractEntityManagerImpl.java:1368)
> > > [hibernate-entitymanager-4.3.7.Final.jar:4.3.7.Final]
> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > [rt.jar:1.8.0_31]
> > > at
> > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> > > [rt.jar:1.8.0_31]
> > > at
> > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> > > [rt.jar:1.8.0_31]
> > > at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_31]
> > > at
> > >
> > >
> >
> org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
> > > [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
> > > at
> > >
> > >
> >
> org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)
> > > [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
> > > at
> > >
> > >
> >
> org.jboss.weld.proxies.EntityManager$1240822178$Proxy$_$$_WeldClientProxy.getTransaction(Unknown
> > > Source) [weld-core-impl-2.2.6.Final.jar:]
> > > at
> > >
> > >
> >
> org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.getTransaction(ResourceLocalTransactionStrategy.java:370)
> > > [deltaspike-jpa-module-impl-1.4.1.jar:1.4.1]
> > > at
> > >
> > >
> >
> org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.rollbackAllTransactions(ResourceLocalTransactionStrategy.java:336)
> > > [deltaspike-jpa-module-impl-1.4.1.jar:1.4.1]
> > > at
> > >
> > >
> >
> org.apache.deltaspike.jpa.impl.transaction.ResourceLocalTransactionStrategy.execute(ResourceLocalTransactionStrategy.java:154)
> > > [deltaspike-jpa-module-impl-1.4.1.jar:1.4.1]
> > > at
> > >
> > >
> >
> org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeTransactional(TransactionalQueryRunner.java:72)
> > > [deltaspike-data-module-impl-1.4.1.jar:1.4.1]
> > > at
> > >
> > >
> >
> org.apache.deltaspike.data.impl.tx.TransactionalQueryRunner.executeQuery(TransactionalQueryRunner.java:54)
> > > [deltaspike-data-module-impl-1.4.1.jar:1.4.1]
> > > at
> > >
> > >
> >
> org.apache.deltaspike.data.impl.handler.QueryHandler.invoke(QueryHandler.java:79)
> > > [deltaspike-data-module-impl-1.4.1.jar:1.4.1]
> > > ... 115 more
> > >
> > > My persistence.xml is as follows:
> > >
> > > <persistence version="2.1"
> > > xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="
> > > http://www.w3.org/2001/XMLSchema-instance"
> > > xsi:schemaLocation="
> > > http://xmlns.jcp.org/xml/ns/persistence
> > > http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
> > > <persistence-unit name="fooca">
> > > <jta-data-source>java:/foocaDS</jta-data-source>
> > > <properties>
> > > <!-- Properties for Hibernate -->
> > > <property name="hibernate.show_sql" value="true" />
> > > </properties>
> > > </persistence-unit>
> > > </persistence>
> > >
> > > My beans.xml
> > >
> > >
> > > <alternatives>
> > >
> > >
> >
> <class>org.apache.deltaspike.jpa.impl.transaction.ContainerManagedTransactionStrategy</class>
> > > </alternatives>
> > >
> > > I also tried
> > >
> > >
> > > <alternatives>
> > >
> > >
> >
> <class>org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy</class>
> > > </alternatives>
> > >
> > > What configuration am I missing?
> > >
> > > Thanks
> > >
> > > Kelly
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message