The copy method of org.apache.servicemix.common.util.MessageUtil does not seem to handle attachments correctly in some cases. When an attachment is created using the org.apache.servicemix.components.util.BinaryFileMarshaler, it will be implemented as FileInputStream and can only be read successfully once. MessageUtil.copy() reads the source attachment and successfully copies it but, in the process, makes the original attachment unusable.
To work around this problem, I created my own MessageUtil class and modified it so that it creates two copies and assigns one back to the source attachment (see attached file). I http://old.nabble.com/file/p26312893/MyUtil.java MyUtil.java If there is a better way to do this, I would be really interested in hearing about it. Otherwise, I'd like to get a similar change made to the real MessageUtil. -- View this message in context: http://old.nabble.com/Copying-a-NormalizedMessage-with-attachments-tp26312893p26312893.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
