Bug 407279 - WebSphereTransactionController does not handle JTA on WebSphere 8.5
Summary: WebSphereTransactionController does not handle JTA on WebSphere 8.5
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, Documentation
Depends on:
Blocks:
 
Reported: 2013-05-06 06:57 EDT by Peer Törngren CLA
Modified: 2022-06-09 10:14 EDT (History)
3 users (show)

See Also:


Attachments
Adding TransactionManager support for WebSphere Liberty. (17.17 KB, patch)
2014-01-20 18:00 EST, Rick Curtis CLA
no flags Details | Diff
Add transaction manager support for WebSphere Liberty v2. (18.62 KB, patch)
2014-01-30 10:05 EST, Rick Curtis CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peer Törngren CLA 2013-05-06 06:57:53 EDT

    
Comment 1 Peer Törngren CLA 2013-05-06 07:08:56 EDT
Problem Context

Running JEE with WebSphere Liberty profile (8.5) and JTA. Configured persistence.xml to specify WebSphere as target server:

<property name="eclipselink.target-server" value="WebSphere_7"/>

When running my application, I get the following error:

javax.servlet.ServletException: Failed to get: Exception [EclipseLink-23004] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.TransactionException Exception Description: Error obtaining the Transaction Manager Internal Exception: java.lang.ClassNotFoundException: Could not find class 'com.ibm.ws.Transaction.TransactionManagerFactory' as resource 'com/ibm/ws/Transaction/TransactionManagerFactory.class'

Problem appears to be the hard-coded value in org.eclipse.persistence.transaction.was.WebSphereTransactionController, which does not match WAS 8.5. 

Current: TX_MANAGER_FACTORY_CLASS = "com.ibm.ws.Transaction.TransactionManagerFactory";

Should be: TX_MANAGER_FACTORY_CLASS = "com.ibm.tx.jta.TransactionManagerFactory";

Workaround: 

Create a custom class with proper value and register this in persistence.xml:
<property name="eclipselink.target-server" value="foo.bar.MyWebSphereTransactionController"/>

Desired solution:
Would want to register v 8.5 as target server in persistence.xml, e.g.
<property name="eclipselink.target-server" value="WebSphere_8_5"/>
Comment 2 Tom Ware CLA 2013-05-24 10:29:47 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 3 Albert Lee CLA 2013-08-29 11:00:07 EDT
WebSphere v8.5.5 introduces a new version of app server run time configuration named WebSphere Liberty profile. The traditional app server still coexists with the liberty profile and named WebSphere full profile.

The transaction manager factory used by these profiles are:

full    - com.ibm.ws.Transaction.TransactionManagerFactory
liberty - com.ibm.tx.jta.TransactionManagerFactory

We need to keep the full profile using com.ibm.ws.Transaction.TransactionManagerFactory class for all the existing WebSphere* target servers. "WebSphere_7" target server type can be used for v8.* full profile configuration.  

The desired solution is to add a new "WebSphere_Liberty" target server type to enable the Liberty profile in EclipseLink. AFAIK, one just needs to duplicate or extend existing WebSphere_7 supporting artifacts and change:

TX_MANAGER_FACTORY_CLASS = "com.ibm.tx.jta.TransactionManagerFactory";

It would also be nice to have additional "WebSphere_8" target server type, which is just an alias to "WebSphere_7" type.

Thank you for all the great support from EclipseLink development team.

P.S. May want to change the Severity from normal to enhancement since this is not a bug.
Comment 4 Peer Törngren CLA 2013-09-23 03:01:50 EDT
> P.S. May want to change the Severity from normal to enhancement since this
> is not a bug.

Beg to differ, I consider this to be a defect; EclipseLink claims to support WebSphere Application Server as a target platform, which IMO includes the Liberty profile. Still, since there is a workaround, I wouldn't consider this to be a severe defect.

Until this issues is resolved, it would be nice to have the workaround documented somewhere. e.g. on http://www.eclipse.org/eclipselink/documentation/2.4/solutions/websphere002.htm#CEGCHAJB (or the corresponding place in documentation for v 2.5, when finalized).
Comment 5 Rick Curtis CLA 2014-01-20 18:00:12 EST
Created attachment 239160 [details]
Adding TransactionManager support for WebSphere Liberty.

I created a new platform for WebSphere Liberty so that the TransactionManager can get wired in. This patch adds the new server type 'WebSphere_Liberty'. 

It was tested on WebSphere Base and WebSphere Liberty.

I'll point out that the unwrapConnection(...) method isn't quite correct as Liberty doesn't expose com.ibm.ws.rsadapter.jdbc.WSJdbcUtil that the org.eclipse.persistence.platform.server.was.WebSpherePlatform uses.
Comment 6 Rick Curtis CLA 2014-01-30 10:05:12 EST
Created attachment 239478 [details]
Add transaction manager support for WebSphere Liberty v2.
Comment 7 Tom Ware CLA 2014-02-03 09:30:40 EST
Changes checked into Master

Reviewed: Tom Ware reviewed contributed changes

Testing: Ran full compile and base testing.  Actual WebSpehere Liberty testing will be left for contributer
Comment 8 Tom Ware CLA 2014-02-04 14:08:46 EST
Patch checked into 2.4.3 and 2.5.2 streams
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:09:31 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 10 Eclipse Webmaster CLA 2022-06-09 10:14:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink