IBM Support

IV98480: After a broken TCP/IP connection, a Java NullPointerException isthrown when establishing a new connection

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A java.lang.NullPointerException and/or a
    java.lang.ArrayIndexOutOfBoundsException is thrown when an MQ
    classes for JMS application attempts to create a new CLIENT
    transport mode connection to a queue manager after receiving a
    JMSException with the MQ reason code 2009
    ('MQRC_CONNECTION_BROKEN').
    
    If the application was running within a WebSphere Application
    Server environment, the SystemOut.log file for the server would
    log errors similar to the following when the existing CLIENT
    transport mode connection was detected as being broken:
    
    [7/29/17 17:43:52:175 BST] 000000c2 ConnectionEve W   J2CA0206W:
    A connection error occurred.  To help determine the problem,
    enable the Diagnose Connection Usage option on the Connection
    Factory or Data Source. This is the multithreaded access
    detection option. Alternatively check that the Database or
    MessageProvider is available.
    
    [7/29/17 17:43:52:176 BST] 000000c2 ConnectionEve A   J2CA0056I:
    The Connection Manager received a fatal connection error from
    the Resource Adapter for resource jms/MyConnectionFactory. The
    exception is: com.ibm.msg.client.jms.DetailedJMSException:
    JMSWMQ2002: Failed to get a message from destination 'QUEUE1'.
    WebSphere MQ classes for JMS attempted to perform an MQGET;
    however WebSphere MQ reported an error.
    Use the linked exception to determine the cause of this
    error.:com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call
    failed with compcode '2' ('MQCC_FAILED') reason '2009'
    ('MQRC_CONNECTION_BROKEN').
    
    Caused by [3] --> Message : com.ibm.mq.jmqi.JmqiException:
    CC=2;RC=2009;AMQ9213: A communications error for 'TCP' occurred.
    [1=java.net.SocketException[Connection
    reset],4=TCP,5=sockInStream.read]
    Class :
      class com.ibm.mq.jmqi.JmqiException
    Stack :
    
    com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.receive(RemoteTC
    PConnection.java:1677)
    
    com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.receiveBuffer(Remote
    RcvThread.java:790)
    
    com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.receiveOneTSH(Remote
    RcvThread.java:751)
    
    com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.run(RemoteRcvThread.
    java:154)
    Caused by [4] --> Message : java.net.SocketException: Connection
    reset
    Class :
      class java.net.SocketException
    Stack :
      java.net.SocketInputStream.read(SocketInputStream.java:220)
      java.net.SocketInputStream.read(SocketInputStream.java:152)
    
    com.ibm.mq.jmqi.remote.impl.RemoteTCPConnection.receive(RemoteTC
    PConnection.java:1668)
    
    
    When the application, using the same thread, attempted to
    establish a new connection the following
    java.lang.NullPointerException could be thrown:
    
    [7/29/17 17:44:04:867 BST] 000000e8 FreePool      E   J2CA0046E:
    Method createManagedConnectionWithMCWrapper caught an exception
    during creation of the ManagedConnection for resource
    jms/MyConnectionFactory, throwing ResourceAllocationException.
    java.lang.NullPointerException
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnection.endTSHSegment
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.sendTSH
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSes
    sionFromNewConnection
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSes
    sion
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession
    	at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect
    	...
    
    Alternatively, the following
    java.lang.ArrayIndexOutOfBoundsException may be thrown:
    
    [7/25/17 13:39:07:356 EDT] 000000e8 FreePool      E   J2CA0046E:
    Method createManagedConnectionWithMCWrapper caught an exception
    during creation of the ManagedConnection for resource
    jms/MyConnectionFactory, throwing ResourceAllocationException.
    java.lang.ArrayIndexOutOfBoundsException
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.wrapSend
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.sendTSH
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.initSess
    	at com.ibm.mq.jmqi.remote.impl.RemoteConnection.connect
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSes
    sionFromNewConnection
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionSpecification.getSes
    sion
    	at
    com.ibm.mq.jmqi.remote.impl.RemoteConnectionPool.getSession
    	at com.ibm.mq.jmqi.remote.api.RemoteFAP.jmqiConnect
        ...
    

Local fix

  • Restart the Java Virtual Machine in which the application is
    running.
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the:
    
      - WebSphere MQ V7.1 classes for JMS
      - WebSphere MQ V7.1 classes for Java
      - WebSphere MQ V7.1 JCA resource adapter (including the
    WebSphere Application Server V8.5 MQ messaging provider)
    
      - WebSphere MQ V7.5 classes for JMS
      - WebSphere MQ V7.5 classes for Java
      - WebSphere MQ V7.5 JCA resource adapter
    
    who have applications that create CLIENT transport mode
    connections to queue managers, and have been configured to use
    channel send exits.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When an WebSphere MQ classes for JMS or classes for Java
    application has been configured with channel send exits, status
    information and temporary buffers for transmission data, which
    are specific to individual threads, are used before invoking the
    exit.  After a send exit has been invoked, an attempt is made to
    transmit the data returned from the exit over the CLIENT
    transport mode connection to the queue manager.  If a problem
    was then detected with the TCP/IP connection, such as a broken
    pipe or connection reset network condition, then an exception
    containing the MQ reason code 2009 ('MQRC_CONNECTION_BROKEN')
    was returned to the application.
    
    When this scenario occurred, the status information and the
    temporary data transmission buffers in the thread specific
    objects were not reset.  If the same application thread then
    attempted to create a new connection to a queue manager, the
    incorrect status information and temporary data transmission
    buffer could cause either a java.lang.NullPointerException or
    java.lang.ArrayIndexOutOfBoundsException to be thrown and the
    connection would not be established.
    

Problem conclusion

  • The WebSphere MQ classes for JMS and classes for Java have been
    updated to ensure that status information and temporary data
    transmission buffers on thread specific objects, used when a
    client-side channel send exit has been configured, are reset
    appropriately before new transmissions are constructed and the
    channel send exit(s) invoked.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v7.1       7.1.0.9
    v7.5       7.5.0.9
    
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006037
    
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006309
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV98480

  • Reported component name

    WMQ LIN X86 V7

  • Reported component ID

    5724H7224

  • Reported release

    710

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-07-27

  • Closed date

    2017-08-24

  • Last modified date

    2017-08-24

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WMQ LIN X86 V7

  • Fixed component ID

    5724H7224

Applicable component levels

  • R710 PSY

       UP

[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1"}]

Document Information

Modified date:
09 March 2021