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.