NullPointerException in JtaTransaction when trying mark transaction for rollback

Description

The issues is similar to this https://community.jboss.org/thread/197482. Notice 'hibernate.transaction.jta.platform' and 'hibernate.transaction.factory_class' properties. Here Hibernate is joining existing transaction. SynchronizationCallbackCoordinatorImpl tries to mark transaction for rollback when exception occurs, the chain of calls results in NullPointerException at TransactionCoordinatorImpl.setRollbackOnly(). To simulate the scenario, I modified BasicDrivingTest(https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/test/java/org/hibernate/test/transaction/jta/BasicDrivingTest.java) which is attached with this issue(check line 76)

Environment

None

Assignee

Unassigned

Reporter

Adi Sesha Reddy

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure