Service Virtualization

Expand all | Collapse all

Getting error messgae while posting a message in IBM MQ

  • 1.  Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 01:36 AM

    Hi,

     

    I am trying to post a message to IBM MQ and getting following error when VS is deployed in VSE. If I run the same service in ITR there is no error message and able to successfully put the message. Please do the needful.

     

    ============================================================================

    | Unable to write inner payload: Input length = 1

    ============================================================================

    ----------------------------------------------------------------------------

    | Message:     Unable to write inner payload: Input length = 1

    ----------------------------------------------------------------------------

    | Trapped Exception: Unable to write inner payload: Input length = 1

    | Trapped Message:  

     

    Thanks,

    Narasimha.



  • 2.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 03:26 AM

    Do you have the full exception with stack trace?  What versions of IBM MQ and DevTest are you using? 

     

    Are your Workstation and VSE server on the same machine?  If not, then do you have the same IBM MQ jars and patches applied in both places?



  • 3.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 03:35 AM
      |   view attached

    Thanks a lot for looking into this Kevin.

     

     

    1)      Full Stack trace: PFA—>Stack Trace.txt

     

    2)      Dev Test: 9.5.1

     

    3)      Server is on UNIX box and work station is in Windows machine. And we have placed same JAR’s in Server and work station.

     

    Note: I have deployed multiple instances of the same stub in same VSE. Miserably one is working and second one is throwing this error.

     

     

    Kind Regards,

     

    Narasimha Lingam

    Service Virtualization Analyst, Quality Assurance Engineering & Analytics

    Technology & Operations | National Australia Bank Limited

    700 Bourke Street, Docklands, VIC, 3008

    Mobile: 0470 204 549 |  Narasimharao.X.Lingam@nab.com.au<mailto:Narasimharao.X.Lingam@nab.com.au>

    Attachment(s)

    zip
    Stack Trace.txt.zip   910 B 1 version


  • 4.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 12:04 PM
    java.nio.charset.UnmappableCharacterException: Input length = 1
                    at java.nio.charset.CoderResult.throwException(CoderResult.java:282)
                    at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:816)
                    at com.ibm.mq.jmqi.system.JmqiCodepage.stringToBytes(JmqiCodepage.java:703)
                    at com.ibm.mq.MQMessage.writeString(MQMessage.java:2746)
                    at com.itko.lisa.messaging.providers.ibmmq.payload.IbmMqMessagePayload.writeBodyToHeaderObject(IbmMqMessagePayload.java:652)
                    ...
                    at com.itko.lisa.messaging.builder.AbstractSendReceiveOperation.doExecute(AbstractSendReceiveOperation.java:152)

     

    What exact version of the MQ jars are you using?  You can check by opening one of the jars up like a .zip file, looking at the META-INF/MANIFEST.MF file, and looking for a line like this:

    Specification-Version: 8.0.0.2

     

    Is this a VSM that you built by hand?  Are you specifying a character set (CCSID field)?  How are you generating the response body?  Is your response data in something other than UTF-8?



  • 5.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 07:15 PM

    Hi Kevin,

     

     

    -          We are using IBM MQ- 8.0.0.2.

     

    -          I have created VSM manually(From scratch).

     

    -          I have not mentioned character set explicitly.

     

    -          Response I am creating in “output log message” step and using “store step response” property to save the response. And finally used this property in PUT step.

     

    -          Response data is purely XML format.

     

     

    Kind Regards,

     

    Narasimha Lingam

    Service Virtualization Analyst, Quality Assurance Engineering & Analytics

    Technology & Operations | National Australia Bank Limited

    700 Bourke Street, Docklands, VIC, 3008

    Mobile: 0470 204 549 |  Narasimharao.X.Lingam@nab.com.au<mailto:Narasimharao.X.Lingam@nab.com.au>



  • 6.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 07:33 PM

    The "UnmappableCharacterException" means that your response body contains one or more characters that cannot be encoded according to the chosen character set.  IBM MQ's default character set is CCSID 819, which is ISO/IEC 8859-1/ASCII.  This character set cannot encode some of the more obscure characters used by some non-English languages.  If your response data includes characters like that then try using CCSID 1208, which is UTF-8.  That should support any and all obscure characters you could possibly use.  However, care must be taken to ensure the receiving application supports UTF-8.



  • 7.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 07:47 PM

    Hi Kevin,

     

    Surprisingly the same stub is working in ITR without any issues?

     

    Kind Regards,

     

    Narasimha Lingam

    Service Virtualization Analyst, Quality Assurance Engineering & Analytics

    Technology & Operations | National Australia Bank Limited

    700 Bourke Street, Docklands, VIC, 3008

    Mobile: 0470 204 549 |  Narasimharao.X.Lingam@nab.com.au<mailto:Narasimharao.X.Lingam@nab.com.au>



  • 8.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 09:17 PM

    Are you driving the stub with the exact same request in the ITR and when deployed to VSE?  Did you try UTF-8?

     

    It's hard to ask any more questions without getting more info, like your actual VSM, your ITR state, or maybe just seeing the exact response body you're trying to send.



  • 9.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 05, 2016 11:07 PM
      |   view attached

    Hi Kevin,

    PFA, this is the request I am placing in the queue.

    I am using the same request(format and data) which is failed when the stub deployed to VSE. But the same request is working

     

    I don’t find any option to select UTF-8 while sending the request.

     

    Kind Regards,

     

    Narasimha Lingam

    Service Virtualization Analyst, Quality Assurance Engineering & Analytics

    Technology & Operations | National Australia Bank Limited

    700 Bourke Street, Docklands, VIC, 3008

    Mobile: 0470 204 549 |  Narasimharao.X.Lingam@nab.com.au<mailto:Narasimharao.X.Lingam@nab.com.au>

    Attachment(s)

    zip
    Result.txt.zip   1 KB 1 version


  • 10.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 06, 2016 03:00 AM

    Make sure the 'PRO' button in the upper right is enabled, and click on 'Header Properties' -> 'Open Editor':

     

    Click '+' -> 'Advanced' -> 'Character set':

     

    Enter '1208':



  • 11.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 06, 2016 06:44 PM

    Thanks a lot Kevin. It’s working now… Can I mention character set as 1208 every time. Could you please let me know the different character sets to use.

     

    Thank you so much for your support.

     

    Kind Regards,

     

    Narasimha Lingam

    Service Virtualization Analyst, Quality Assurance Engineering & Analytics

    Technology & Operations | National Australia Bank Limited

    700 Bourke Street, Docklands, VIC, 3008

    Mobile: 0470 204 549 |  Narasimharao.X.Lingam@nab.com.au<mailto:Narasimharao.X.Lingam@nab.com.au>



  • 12.  Re: Getting error messgae while posting a message in IBM MQ

    Posted Dec 06, 2016 07:26 PM

    Sorry, the default character set is hard-coded to be 819 in the MQ client library, and we don't have a good way to override their default with our own.  With normal VSE use cases, the character set is either recorded from live data or generated with a RR pair sidecar file and you don't have to explicitly define it in a step.  But since you're building your own VSM from scratch, you will have to specify 1208 yourself.

     

    > Could you please let me know the different character sets to use.

    If you do a google search for "CCSID" and pick the first IBM link then you will find a list of almost 800 character set IDs

     

    Out of all those, I commonly see only a handful:

    • 819: ISO 8951-1/ASCII
    • 500, 37: EBCDIC
    • 1208: UTF-8
    • 1200-1205: variations of UTF-16