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.