找不到 Glassfish v4 事务管理器



将应用程序从 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 Resource 中定义了 DB(MySQL)(当事务管理器没有崩溃时,我可以读取和写入它)

这是我的坚持.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 作为编译依赖项。

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

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

在持久性中显式包含实体类的任何特定原因.xml。

持久性提供程序相同。

为什么您添加了GlassFish的LIB。对于标准的Java EE 6应用程序来说,这甚至不应该是必需的。

最新更新