3 Replies Latest reply: Aug 14, 2012 7:15 AM by 955621 RSS

    JMS with AQ and XAConnectionFactory (Error creating the db_connection)

    880535
      Hi!

      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

      wiht nested:

      Caused by: java.lang.NullPointerException
           at oracle.jms.AQjmsGeneralDBConnection.getProviderKey(AQjmsGeneralDBConnection.java:99)
           at oracle.jms.AQjmsGeneralDBConnection.<init>(AQjmsGeneralDBConnection.java:77)

      Debbugging the cause I found:
      AQjmsGeneralDBConnection(...)
      /* 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 ??

      Thanks

      juergen schmied