ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » IOException MQMessag2.readConvertedString():MALFORMED[1]

Post new topic  Reply to topic
 IOException MQMessag2.readConvertedString():MALFORMED[1] « View previous topic :: View next topic » 
Author Message
MABeatty1978
PostPosted: Mon Oct 23, 2017 12:12 pm    Post subject: IOException MQMessag2.readConvertedString():MALFORMED[1] Reply with quote

Acolyte

Joined: 17 Jul 2014
Posts: 54

I've got a C program that sends a message to a queue which a java program is reading. Up to this point, it works fine. The Java and C programs have been running on a Linux machine. I've since moved the application over to a Solaris machine. I recompiled the C program and now when the Java program reads the queue it throws an IOExepction:


java.io.IOException: MQJE088: Decoding failed ('MQMessag2.readConvertedString():MALFORMED[1]').
at com.ibm.mq.MQMessage.readConvertedString(MQMessage.java:3010)
at com.ibm.mq.MQMessage.readStringOfCharLength(MQMessage.java:1233)


One thing probably worth nothing, the Linux version is using MQ version 7.0.1. On Solaris is 8.0.0.

Here is my java code that's reading the message
Code:
MQGetMessageOptions gmo = new MQGetMessageOptions();
                gmo.options = MQConstants.MQGMO_FAIL_IF_QUIESCING;
                MQMessage msg = new MQMessage();
                String cmd = null;

                //Now check for command messages
                try {
                        cmdQ.get(msg, gmo);
                }
                catch (MQException ex) {
                        //2033 No messages available, just continue on
                        if(ex.getReason() == 2033){
                                return;
                        }
                        else{
                                throw ex;
                        }
                }
                cmd = msg.readStringOfCharLength(msg.getMessageLength()).trim();



Here is the C programs PUT:
Code:
//We are now ready to send our request
                                //Build message descriptor and set put message options
                                md.MsgType = MQMT_REQUEST; //Request Message
                                md.Report = MQRO_EXCEPTION_WITH_DATA;
                                strncpy(md.ReplyToQ, odr.ObjectName, MQ_Q_NAME_LENGTH);

                                strncpy(md.ReplyToQMgr, qMName, MQ_Q_MGR_NAME_LENGTH);
                                md.Encoding = CCSID_UTF8;               //Set Message Descriptor encoding
                                memcpy(md.Format, MQFMT_STRING, (size_t) MQ_FORMAT_LENGTH);
                                pmo.Version = MQPMO_VERSION_3;  // message handles were added to version 3 of the PMO
                                pmo.Options |= MQPMO_NEW_MSG_ID;

                                //Put message to destination queue to start the load
                                MQPUT(Hcon,
                                          Hobj,
                                          &md,
                                          &pmo,
                                          strlen(message),
                                          message,
                                          &CompCode,
                                          &Reason);



Any help would be appreciated.
Back to top
View user's profile Send private message
tczielke
PostPosted: Mon Oct 23, 2017 2:13 pm    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

It's possible you might be experiencing this default data conversion change for Java/JMS at MQ v8.

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.pro.doc/q127520_.htm

Note that if you want to use the system property setting that the link talks about to go back to the v7 data conversion approach, the system property has a defect where it does not work until 8.0.0.6.
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
tczielke
PostPosted: Mon Oct 23, 2017 5:26 pm    Post subject: Reply with quote

Guardian

Joined: 08 Jul 2010
Posts: 939
Location: Illinois, USA

I also noticed that you are putting a 1208 ( UTF-8 ) message. There is a tool in the MH06 Trace Tools supportpac called message parsing that could be helpful here to trace your message and then do analysis on the bytes to see if there is any invalid UTF-8 data in the message.

This MQTC session covers how to use message parsing in MH06 on slide 29, if you are interested.

http://www.mqtechconference.com/sessions_v2016/MQTC_v2016_DataConversion.pdf
_________________
Working with MQ since 2010.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » IOException MQMessag2.readConvertedString():MALFORMED[1]
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.