XAFactories which implement java.util.Map (MQXAConnectionFactory) cannot be initialized properly
XAFactories which implements java.util.Map (for example com.ibm.mq.jms.MQXAConnectionFactory), cannot be initialized correctly by .properties configuration. Problem is in the function bitronix.tm.utils.PropertyUtils.setProperty where is
if (currentTarget instanceof Map) { ... }
else { setDirectProperty( ... ) }.
The priority should be IMHO inverse. i.e.
if the property exists then { setDirectProperty(...) }
else {
if XAFactory is a map then {
setup map and log warning about setting value in the Map.
}
}
Thanks for the report. How about you create a PR with a test and a fix?
I'm working on the fix. Would be nice to have a confirmation that the proposed logic change ( the named property first, maps as the second ) is correct and do not clash with some another processes. As the first attempt I changed the XAFactoryHelper.java to use the setDirectProperty instead setProperty, but test testBindOneJdbc fails with NPE.
Well, your proposed logic seems reasonable at first look. I unfortunately couldn't tell you if there would be some undesired side-effect out of what the unit test would catch as I haven't worked on it in years.
Please be aware that while I would happily merge your PR, I do not have the means anymore to perform a release to maven central.