I use the following code with aqapi.jar (11.2):
XAConnectionFactory cf = AQjmsFactory.getXAConnectionFactory(url, null);
con = cf.createXAConnection(user, pwd);
I get a
oracle.jms.AQjmsException: Error creating the db_connection
Caused by: java.lang.NullPointerException
Debbugging the cause I found:
/* 53*/ m_dbConn = null;
/* 77*/ providerKey = getProviderKey();
private String getProviderKey()
/* 98*/ OracleConnection oracleconnection = (OracleConnection)m_dbConn;
/* 99*/ String s = oracleconnection.getURL(); <--- NPE of course
so the field dbConn is set to null and used then.
I suppose its not my fault. ;-/
Has anybody ever used the XAConnectionFactory ??
I suffered from this problem too and, unfortunately, I have bad news because the API has a bug that it will be fixed in version 12.1, as it's documented in Oracle Support (Bug 10102373).
I was suffering from this issue as well, and after checking Metalink there seems to be a patch: Patch 10102373: UNABLE TO USE ORA11GR2 (22.214.171.124.0) AQAPI.JAR WHEN DOING XA FROM JCAPS 6.3
This patch replaces the 2 classes in which the NullPointerException occurs, so you can use the XA Connection Factory.
Take into account that with the use of aqapi 11g, issues can occur when communicating with applications using aqapi 10g. There has been a major change between the two regarding character set conversion, which can lead to NullPointerExceptions when the application using the 10g aqapi.jar receives JMSTextMessages.
Christiaan van Tienhoven
Edited by: user11063874 on 14-aug-2012 0:42
Edited by: user11063874 on 14-aug-2012 5:12