Skip to main content

Message encoding problem occurs after migrating the application from WebSphere Enterprise Service Bus (WESB) Version 6.1.2.0 to Version 6.1.2 Fix Pack 3


Technote (troubleshooting)


Problem(Abstract)

A mediation flow component uses an MQ binding to get a message from an MQ queue, parses the message, changes the message encoding, and puts the new message into another MQ queue, from which a subsequent component reads the message. The application works fine on WebSphere Enterprise Service Bus 6.1.2.0. However, if you upgrade WebSphere Enterprise Service Bus to Version 6.1.2 Fix Pack 3, the subsequent component application fails to parse the message.

Symptom

You can see the following exception in the SystemOut.log file from the subsequent component:

ExceptionUtil E   CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "transactionRequiredActivitySessionSupports" on bean "BeanId(TestApp#TestEJB.jar#Module, null)". Exception data: java.io.IOException: Error reading XML
at com.ibm.ws.bo.service.BOXMLSerializerImpl.load(BOXMLSerializerImpl.java:271)
at com.ibm.ws.bo.service.BOXMLSerializerImpl.readXMLDocumentWithOptions(BOXMLSerializerImpl.java:509)
at com.ibm.ws.sca.internal.sdo.impl.BOXMLSerializerDelegatorImpl.load(BOXMLSerializerDelegatorImpl.java:95)
at com.ibm.ws.sca.internal.sdo.impl.XMLFileServiceImpl.load(XMLFileServiceImpl.java:329)
at com.ibm.wsspi.sca.sdo.XMLFileService$1.load(XMLFileService.java:70)
at com.ibm.ws.sca.databinding.impl.DataBindingImplXML.read(DataBindingImplXML.java:226)
at com.ibm.websphere.sca.mq.data.impl.MQDataBindingImplXML.parseNativeData(MQDataBindingImplXML.java:242)
at com.ibm.websphere.sca.mq.data.impl.MQDataBindingImplXML.getDataObject(MQDataBindingImplXML.java:215)
......

Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:145)
at java.io.BufferedInputStream.available(BufferedInputStream.java:386)
at java.io.FilterInputStream.available(FilterInputStream.java:169)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.readBuffer(XMLLoadImpl.java:328)
.....

Cause

There change is a code change made by APAR IC57780 between WebSphere Enterprise Service Bus Version 6.1.2.0 and V6.1.2 Fix Pack 3. In V6.1.2.0, the CCSID value set in the Service Component Architecture (SCA) message is not propagated into the outbound MQ message. However, in V6.1.2 Fix Pack 3, the CCSID value can propagate to the outbound MQ message. In V6.1.2 Fix Pack 3, the outbound message encoding changes to the default EBCDIC. The mediation component fails to change the message encoding. Because of the resulting message encoding inconsistency, the subsequent component fails to parse the message.

Resolving the problem

In WebSphere Enterprise Service Bus 6.1.2 Fix Pack 3, you can solve this problem by adding the following Java™ code to the mediation flow component. It modifies the CCSID to the specific encoding value.


MQControl mqControl = smo.getHeaders().getMQHeader().getControl();
if (mqControl == null) {
    mqControl = WMQStructuresFactory.eINSTANCE.createMQControl();
    smo.getHeaders().getMQHeader().setControl(mqControl);
}

mqControl.setCodedCharSetId(1208); //Change this value(1208) to modify the message  encoding
mqControl.setEncoding(MQC.MQENC_INTEGER_NORMAL |
                      MQC.MQENC_DECIMAL_NORMAL |
                      MQC.MQENC_FLOAT_IEEE_NORMAL);
mqControl.setFormat(MQC.MQFMT_NONE);
out.fire(smo);


Rate this page:

(0 users)Average rating

Copyright and trademark information

IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.

Rate this page:


(0 users)Average rating

Add comments

Document information

WebSphere Enterprise Service Bus

Data Handler Primitive


Software version:
6.1.2.3


Operating system(s):
AIX, HP-UX, Linux, Solaris, Windows, i5/OS


Reference #:
1619243


Modified date:
2013-01-08

Translate my page

Content navigation