I'm working with SMX4 and want to send an object from one servicemix-bean to another.
Here is my code: In the sender bean: ... EntryObject entryObject = ....; DataHandler dataHandler = new DataHandler(entryObject, "application/octet-stream"); normalizedMessage.addAttachment(Constants.AUDITLOGENTRY_OBJECT, dataHandler); ... In the receiver bean: DataHandler dataHandler= message.getAttachment(Constants.AUDITLOGENTRY_OBJECT); Object object=dataHandler.getContent(); System.out.println(object.getClass().getName()); // here I get a class cast exception -> java.lang.ClassCastException: com.xyz.EntryObject cannot be cast to com.xyz.EntryObject EntryObject entryObject = (EntryObject)object; This is really strange for me. Also debugging shows me that the object received is the same as sent. Could anybody of you give me a hint what's wrong? TIA Regards Martin -- View this message in context: http://www.nabble.com/Strange-ClassCastException-on-sending-an-object-as-attachment-from-one-smx-bean-to-another-tp20933798p20933798.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
