IBM Support

How to integrate WebSphere MQ with WebSphere Application Server, so as to post a message via the HTTP API tester?

Troubleshooting


Problem

How to integrate WebSphere MQ with WebSphere Application Server, so as to post a message via the HTTP API tester?

Symptom

One sees the error described below when posting a message to the JMS queues on WebSphere MQ (WMQ) via the HTTP API tester. This occurs when using "fscontext" jndi or file bindings as commonly known.
Error Message
<Errors>
<Error ErrorCode="javax.naming.NoInitialContextException" ErrorDescription="Error description not available" ErrorRelatedMoreInfo="" ErrorUniqueExceptionId="127.0.0.112795501681490000000000002">
<Attribute Name="ErrorCode" Value="javax.naming.NoInitialContextException" />
<Attribute Name="ErrorDescription" Value="Error description not available" />
<Error ErrorCode="javax.naming.NoInitialContextException" ErrorDescription="" </font></div> <div>
java.naming.security.principal=mqm, java.naming.security.credentials=mqm, java.naming.referral=throw}">
<Stack>
javax.naming.NoInitialContextException: Failed to create InitialContext using factory specified in hashtable {java.naming.provider.url=file:/home, java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory, java.naming.factory.url.pkgs=com.ibm.ws.naming:com.ibm.ws.runtime:com.ibm.ws.nam ing:com.ibm.ws.naming, java.naming.security.principal=mqm, java.naming.security.credentials=mqm, java.naming.referral=throw} [Root exception is java.lang.NullPointerException]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:243)
at javax.naming.InitialContext.initializeDefaultInitCtx(InitialContext.java:327)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:357)
at javax.naming.InitialContext.internalInit(InitialContext.java:295) at javax.naming.InitialContext.<init>(InitialContext.java:212)

Resolving The Problem

In order to resolve this error, one needs to configure shared library references for the deployed MCF application on the WebSphere Console.
To do this:
       
  1.    
    Open the WebSphere Administrative Console.
       
  2.    
  3.    
    Select Applications -> Enterprise Applications -> <application_name> -> References -> Shared library references
       
  4.    
  5.    
    Select <application_name> -> Reference shared libraries
       
  6.    
  7.    
    Click New
       
  8.    
  9.    
    Select the appropriate scope (Node=<node_name>,server=<server_name>)
       
  10.    
  11.    
    Specify a suitable name and add all the WMQ jar files to the Classpath variable. Press Enter to separate each jar file. (Refer to the MCF Installation Guide for a list of Jar files).
       
  12.    
  13.    
    Click Apply, then OK
       
  14.    
  15.    
    Save the configuration changes to the master repository
       
  16.    
  17.    
    Select <application_name> -> Reference Shared Libraries
       
  18.    
  19.    
    Move the created shared library reference from "Available" to "Selected" using >>
       
  20.    
  21.    
    Restart the Application Server.
       
If there are still errors while posting a message via the HTTP API tester, contact Sterling Commerce Customer Support for assistance.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

NFX9536

Product Synonym

[<p><b>]Function Area[</b><p>];HTTP API tester;[<p><b>]Escalation ID[</b><p>];201198

Document Information

Modified date:
16 June 2018

UID

swg21552830