Jason Chen
Jason Chen

Reputation: 11

No transaction is currently active under the eclipselink and jboss

Server: Jboss EAP6.2

JPA: eclipselink 2.4.*

transaction-type="JTA"

get error message:

Exception Description: No transaction is currently active

... at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:189)...

...[some ejb]$$view[some number].[some method](Unknow Source) ...

Upvotes: 0

Views: 1545

Answers (2)

JE Zamora
JE Zamora

Reputation: 146

You will need add in the configuration file persistence.xml the next entry

<property name="eclipselink.target-server" value="JBoss" />

Example complete:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

    <persistence-unit name="SQLServer" transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>java:jboss/datasources/SQLServer</jta-data-source>

        <properties>
            <property name="eclipselink.target-server" value="JBoss" />
        </properties>
    </persistence-unit>

</persistence>

Upvotes: 2

Jason Chen
Jason Chen

Reputation: 11

<property name="eclipselink.target-server" value="JBoss" />

this config can solved that error

Upvotes: 1

Related Questions