I found a working solution. Liberty 23.x does not expose TransactionManager over JNDI, you need to use reflection to obtain TransactionManager.
This bean definition helped me configure JtaTransactionManager.
@Bean
public JtaTransactionManager transactionManager() throws Exception {
InitialContext context = new InitialContext();
UserTransaction utx = (UserTransaction) context.lookup("java:comp/UserTransaction");
TransactionManager ibmTm = (TransactionManager) Class
.forName("com.ibm.tx.jta.TransactionManagerFactory")
.getDeclaredMethod("getTransactionManager")
.invoke(null);
return new JtaTransactionManager(utx, ibmTm);
}
I found the answer here: https://stackoverflow.com/a/79363034/30908754