0

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?

user1927033
  • 142
  • 14

1 Answers1

0

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.

Arun Gupta
  • 3,965
  • 5
  • 31
  • 39
  • I've cleaned up quite a lot since this post: the persistence.xml is without provider and classes also and also removed Java-EE6 lib (since I'm having some 7 stuff like multi-catch and string switch). Deployment fails also outside IntelliJ - both via the admin utility and asadmin command. However after a sleepsles night I think that I've found the issue: classpath problem from the api my application needs to use.. I'm wondering whether somehow I can isolate one jar to be use only by another jar, not by the whole server. – user1927033 Sep 22 '13 at 08:48
  • multi-catch and string switch are JDK 7, they can be used independent of Java EE version. Seems like OSGi may work for your case, need to know more details. – Arun Gupta Sep 23 '13 at 14:20
  • Never done anything in OSGI. Basically the case is: The API is in 2 jars (that depend on each other), that has to be in my project. However the API was coded against a Weblogic server, so I need to include some huge (50 MB) weblogic.jar in GF (currentl under glassfish/glassfish/lib). By the looks of it, this is half a weblogic server, and so sometimes my app tries to look up the container transaction manager from it, instead from GF.. – user1927033 Sep 23 '13 at 14:34