javaee-samples/javaee7-samples — pull request #188 by arjantijms (2014-01-08 17:34:32+00:00)
Title: Added tests for using an @DataSourceDefinition data source with JPA

Note that both tests fail on both GlassFish 4 and WildFly 8 cr1.

WildFly already fails at deployment time with:

ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "dca783dd-b383-4a16-85a4-1331a2f89354.war")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"dca783dd-b383-4a16-85a4-1331a2f89354.war#testPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.dca783dd-b383-4a16-85a4-1331a2f89354.MyApp.MyDS]"]}

ERROR [org.jboss.as.server] (management-handler-thread - 3) JBAS015870: Deploy of deployment "dca783dd-b383-4a16-85a4-1331a2f89354.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"dca783dd-b383-4a16-85a4-1331a2f89354.war#testPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.dca783dd-b383-4a16-85a4-1331a2f89354.MyApp.MyDS]"]}
17:59:59,156

While GlassFish fails at runtime with:

Caused by: org.omg.CORBA.INTERNAL: JTS5031: Exception [org.omg.CORBA.INTERNAL: vmcid: 0x0 minor code: 0 completed: Maybe] on Resource [rollback] operation. vmcid: 0x0 minor code: 0 completed: No
at com.sun.jts.CosTransactions.RegisteredResources.distributeRollback(RegisteredResources.java:1187)
at com.sun.jts.CosTransactions.TopCoordinator.rollback(TopCoordinator.java:2291)
at com.sun.jts.CosTransactions.CoordinatorTerm.rollback(CoordinatorTerm.java:530)
at com.sun.jts.CosTransactions.TerminatorImpl.rollback(TerminatorImpl.java:286)
at com.sun.jts.jta.TransactionImpl.rollback(TransactionImpl.java:162)
... 126 more

WARNING: RAR5035:Unexpected exception while destroying resource from pool __SYSTEM/pools/__datasource_definition/5f110772-6547-4c6e-9d56-1a437f052bd8/java:app/MyApp/MyDS. Exception message: This web container has not yet been started

Very similar code does run on JBoss EAP 6 and GlassFish 3.