Description
When deploy RAR from https://genericjmsra.java.net/ I see next error message in a log:
INFO OpenEJB.startup.config - Dumping Generated ra.xml to: /home/rb4400/JEE/apache-tomee-plus-1.7.1/temp/ra-265140642613974127
2015-01-20T12:24:56.366 [main] INFO OpenEJB.startup.config - Configuring Service(id=genericraRA, type=Resource, provider-id=genericraRA)
2015-01-20T12:24:56.369 [main] ERROR OpenEJB - FATAL ERROR: Unknown error in Assembler. Please send the following stack trace and this message to users@opene
java.lang.NullPointerException
at org.apache.openejb.config.AppInfoBuilder.buildConnectorModules(AppInfoBuilder.java:507)
...
I think it is a bug there in AppInfoBuilder.java
if (outbound != null) { String transactionSupport = "none"; switch (outbound.getTransactionSupport()) { // Line 507 case LOCAL_TRANSACTION: transactionSupport = "local"; break; case NO_TRANSACTION: transactionSupport = "none"; break; case XA_TRANSACTION: transactionSupport = "xa"; break; }
With this code transactionSupport newer be "none" . if outbound.getTransactionSupport() returns null, it breaks the switch. Will need to check for null before switch.
patch
# This patch file was generated by NetBeans IDE # It uses platform neutral UTF-8 encoding and \n newlines. --- <html>AppInfoBuilder.java (<b>d98242e</b>)</html> +++ <html><b>Current File</b></html> @@ -95,6 +95,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; +import org.apache.openejb.jee.TransactionSupportType; import static org.apache.openejb.util.URLs.toFile; @@ -504,7 +505,9 @@ final OutboundResourceAdapter outbound = resourceAdapter.getOutboundResourceAdapter(); if (outbound != null) { String transactionSupport = "none"; - switch (outbound.getTransactionSupport()) { + TransactionSupportType transactionSupportType = outbound.getTransactionSupport(); + if (transactionSupportType != null) { + switch (transactionSupportType) { case LOCAL_TRANSACTION: transactionSupport = "local"; break; @@ -515,6 +518,7 @@ transactionSupport = "xa"; break; } + } for (final ConnectionDefinition connection : outbound.getConnectionDefinition()) { final String id = this.getId(connection, outbound, connectorModule);