Uploaded image for project: 'JBoss A-MQ'
  1. JBoss A-MQ
  2. ENTMQ-228

ER1: JMS TCKs violations: session.getTransacted() throws NPE when called if connection is closed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBoss A-MQ 6.0
    • JBoss A-MQ 6.0
    • broker
    • None

    Description

      According to specification, javax.jms.IllegalStateException should be thrown. ActiveMQXASession.getTransacted() calls method on transactionContext, which is null after the connection is closed.Testing code from TCK test looks like this:| public void closedQueueConnectionGetTransactedTest() throws Fault {|

      boolean passed = false;
       
      try {
      createAndCloseConnection(JmsTool.QUEUE);
      logTrace("Try to call getTransacted() with closed connection.");
      try {
      boolean b = tool.getDefaultQueueSession().getTransacted();
       
      logTrace("Fail: Exception was not thrown!");
      {color:black}} catch (javax.jms.IllegalStateException ise) {{color}
      logTrace("Caught expected exception");
      passed = true;
      {color:black}} catch (Exception e) {{color}
      TestUtil.printStackTrace(e);
      logTrace("Fail: wrong exception: " + e.getClass().getName() + " was returned");
      {color:black}}|
      | if (!passed) {
      throw new Fault("Error: failures occurred during tests");
      {color:black}}|
      | {color:black}} catch (Exception e) {
      throw new Fault("closedQueueConnectionGetTransactedTest", e);
      {color:black}}|
      | }

      createAndCloseConnection() method creates connection from factory, then creates nontransacted auto-acknowledged session, producer, consumer, then close the connection.

      Attachments

        Activity

          People

            gtully@redhat.com Gary Tully
            jsedlacek Jiri Sedlacek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: