服务器: Jboss EAP6.2
JPA: eclipselink 2.4。*
交易类型="的 JTA "
收到错误消息:
例外说明:当前没有交易活动
... 在org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:189)......
... [some ejb] $$ view [some number]。[some method](Unknow Source) ...
答案 0 :(得分:1)
您需要在配置文件persistence.xml中添加下一个条目
<property name="eclipselink.target-server" value="JBoss" />
示例完成:
<?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>
答案 1 :(得分:0)
<
属性名称=&#34; eclipselink.target-server&#34;值=&#34;的JBoss&#34; / >
强>
此配置可以解决该错误