Error while receiving JMS map message, "JMS Message Deserialization failed. Configured Message Type is [ Map]. Received Message class is [TibjmsMapMessage]".

Error while receiving JMS map message, "JMS Message Deserialization failed. Configured Message Type is [ Map]. Received Message class is [TibjmsMapMessage]".

book

Article ID: KB0094421

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Caused by: com.tibco.bw.jms.shared.api.exceptions.JMSMessageReceiveException: JMS Message Deserialization failed. Configured Message Type is [ Map]. Received Message class is [TibjmsMapMessage].

This error can be reproduced with any JMS provider. The error can be seen in Studio when using a BW 5.x sender as well as a .Net client API to send a JMS messages of type Map. The reason for the error is that when selecting a message type as "Map" in a sender or receiver, you have to select / create the schema in an input/output editor in order to send or receive the name-value pair message. If the schema definition, or specifically the structure is different on both the sender and receiver side, you will run into this issue. If a schema is defined in an output editor of the JMS receive activity and the schema defined in the input editor of the sender activity is the same or of the same structure, BW (both 5.x and 6.x) will not throw this error. If they are of a different structure, both BWs will show the error though the exception may be different.

Consider the following example:

Sender schema:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Body">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="F_Name" type="xsd:string"/>
            <xsd:element name="L_Name" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>

Receiver Schema:

  <complexType name="Body" tibex:source="bw.jms.send">
    <sequence>
     <element name="elements">
       <complexType>
          <sequence>
            <element name="F_Name" type="string"/>
            <element name="L_Name" type="string"/>
          </sequence>
        </complexType>
      </element>
    </sequence>
  </complexType>


With this type of configuration on the sender and receiver side, you will run into the reported issue. Note that at the receiver side schema, F_Name, L_Name belongs to complex element "elements". This "elements" is referenced under another complex element "Body". In the sender schema, the complex element "Body" directly contains F_Name and L_Name, hence the error. With the same structured schema at both the sender and receiver side, the message can be successfully consumed at the receiver side.

Issue/Introduction

Error while receiving JMS map message, "JMS Message Deserialization failed. Configured Message Type is [ Map]. Received Message class is [TibjmsMapMessage]".