While attempting to use last participant support (LPS), the transaction fails with a J2CA0030E logged due to a com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException.
The following exceptions are logged in the SystemOut.log file:
[8/5/15 10:51:11:469 CDT] 00000036 RegisteredRes E WTRN0062E: An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
[8/5/15 10:51:11:938 CDT] 00000036 LocalTransact E J2CA0030E: Method enlist caught com.ibm.ws.Transaction.IllegalResourceIn2PCTransactionException: Illegal attempt to enlist multiple 1PC XAResources
These errors will occur when there are more than one one-phase capable (1PC) resources in an XA transaction. If this is the case, then the WTRN0062E is correct and working as designed.
Resolving The Problem
Review all of your resources (data sources) and verify that you only have one one-phase capable resource in the global transaction. This can be done by referring to the JDBC provider used for each data source. In the WebSphere Application Server Information Center, the article entitled "JDBC provider summary" to determine if any of your data sources are using a non-XA (that is, 1pc) driver. (Note, the link provided is for the WebSphere Application Server v7).
With Last Participant Support (LPS), you are only allowed to have one one-phase capable resource with any number of two-phase capable resources in the same global transaction. Using the administrative console: select Enterprise Applications > your_ear_file >
Last participant support extension, if the box for Accept
heuristic hazard is checked, then the application has LPS enabled.
If you are receiving this message, then the application has more than one 1pc data source involved in the global transaction. The two ways that this may be addressed are
1. change the transaction settings so that one of the 1pc resources is involved in a separate global transaction. See the Information Center article "Setting EJB module ActivitySession deployment attributes".
2. change from using a non-XA JDBC provider to an XA JDBC provider for one of the data sources that is non-XA. That is, ensure that there is only one 1pc resource in the global tx.
15 June 2018