找不到Glassfish v4 Transaction Manager [英] Glassfish v4 Transaction Manager not found

查看:129
本文介绍了找不到Glassfish v4 Transaction Manager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



pre $ [2013-09- Eclipse的持久性[EclipseLink-23004](Eclipse持久性代码:[EclipseLink-23004])[EclipseTrust_Reporter_war_exploded]服务 - 2.5.0.v20130507-3faac2b):org.eclipse.persistence.exceptions.TransactionException
异常描述:获取事务管理器错误
内部异常:异常[EclipseLink-23001](Eclipse持久性服务 - 2.5.0.v20130507-3faac2b):org.eclipse.persistence.exceptions.TransactionException
异常说明:在JNDI名称下查找外部事务资源时出错[java:appserver / TransactionManager]
内部异常:javax。 naming.NameNotFoundException:其余名称:/ appserver / TransactionManager]]

然而,重新启动整个服务器和de部署应用程序正常工作。只有重新部署失败。

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

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



以下是我的persistence.xml:


 < persistence-unit name =GTWunittransaction-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应用程序甚至不需要这样做。


I'm getting the following exception thrown when redeploying an application from IntelliJ to 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]]

However, restarting the whole server and deploying the application works fine. Only re-deployment fails.

My assumption is that something is missing from the app descriptors, but I can't seem to find the my error.

I have defined the DB (MySQL) in Glassfish's JDBC Database Pool and JDBC Resource (and I can read and write to it, when the transaction manager doesn't crashes)

Here is my 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>

In the artifacts I've added Glassfish's LIB as provided and Java-EE 6 as compile dependency.

Any ideas what might be the root cause?

解决方案

Have you tried deploying to GlassFish directly ? Does the redeploy fail outside of InteilliJ too ?

Any particular reason you are explicitly including Entity classes in your persistence.xml.

Ditto with persistence provider as well.

Why have you added GlassFish's LIB as provided. That should not even be required for a standard Java EE 6 application.

这篇关于找不到Glassfish v4 Transaction Manager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆