将应用程序从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]]
但是,重新启动整个服务器和部署应用程序工作正常。只有重新部署失败。
我的假设是app描述符中缺少某些东西,但我似乎无法找到我的错误。
我在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作为编译依赖。
什么想法可能是根本原因?
您是否尝试过直接部署到GlassFish?重新部署是否也在InteilliJ之外失败?
您在persistence.xml中明确包含实体类的任何特定原因。
与持久性提供程序同样如此。
为什么要按照提供的方式添加GlassFish的LIB。标准Java EE 6应用程序甚至不需要这样做。