Fixes error message encoding issue when using qpid

Making the message only consist of primitive types
before sending it by qpid.

Fixes bug 1242734

Change-Id: I3ff7a19af9a7671f955345ada6acfba8bf573c70
(cherry picked from commit 94b9e66360387d24548f165cc4c7ee67f5160a0c)
Merge "Fixes error message encoding issue when using qpid" into stable/havana