未找到Glassfish v4事务管理器

时间:2013-09-11 10:11:35

标签: java-ee glassfish war glassfish-4

将应用程序从IntelliJ重新部署到Glassfish v4时,我收到以下异常:

[2013-09-11T12:55:44.122+0300] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [[
  Exception while deploying the app [gtwcustreporter_war_exploded] : Exception [EclipseLink-23004] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.TransactionException
Exception Description: Error obtaining the Transaction Manager
Internal Exception: Exception [EclipseLink-23001] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.TransactionException
Exception Description: Error looking up external Transaction resource under JNDI name [java:appserver/TransactionManager]
Internal Exception: javax.naming.NameNotFoundException: remaining name: /appserver/TransactionManager]]

但是,重新启动整个服务器并部署应用程序正常。只有重新部署失败。

我的假设是应用程序描述符中缺少某些内容,但我似乎无法找到我的错误。

我在Glassfish的JDBC数据库池和JDBC资源中定义了DB(MySQL)(当事务管理器没有崩溃时,我可以读取和写入它)

这是我的persistence.xml:

<persistence-unit name="GTWunit" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/gtwcust</jta-data-source>
    <class>net.metarex.ga.jpa.LocationCode</class>
    <class>net.metarex.ga.jpa.Shipment</class>
</persistence-unit>

在工件中,我添加了Glassfish的LIB,Java-EE 6作为编译依赖。

任何想法可能是根本原因?

1 个答案:

答案 0 :(得分:0)

您是否尝试过直接部署到GlassFish?重新部署是否也在InteilliJ之外失败了?

您在persistence.xml中明确包含实体类的任何特殊原因。

同样使用持久性提供程序。

为什么要按照提供的方式添加GlassFish的LIB。标准Java EE 6应用程序甚至不需要这样做。

相关问题