|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
IOException MQMessag2.readConvertedString():MALFORMED[1] |
« View previous topic :: View next topic » |
Author |
Message
|
MABeatty1978 |
Posted: Mon Oct 23, 2017 12:12 pm Post subject: IOException MQMessag2.readConvertedString():MALFORMED[1] |
|
|
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 |
|
 |
tczielke |
Posted: Mon Oct 23, 2017 2:13 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 Location: Illinois, USA
|
|
Back to top |
|
 |
tczielke |
Posted: Mon Oct 23, 2017 5:26 pm Post subject: |
|
|
Guardian
Joined: 08 Jul 2010 Posts: 941 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|