What component send the exchange ?
Also, you need to ensure that the DONE
status is only returned after you have fully
processed the exchange.


On 10/18/06, Paul Haeder <[EMAIL PROTECTED]> wrote:

Hi,


after receiving a message, I'm using the BinaryFileMarshaler to extract the
enclosed file:


String name = marshaler.getOutputName(exchange, message);

newFile = new File("myDir", name);

After that I want the file to be written to the file system:


BufferedOutputStream out = new BufferedOutputStream(new
FileOutputStream(newFile));

marshaler.writeMessage(exchange, message, out, name);


During the execution of that last line an IOException occurs (Stream
closed). The file isn't written at all or sometimes just partly. I did not
write any code that closes the OutputStream, so I suppose that some part of
ServiceMix does so...


Any help would be appreciated.


Cheers,

Paul




PS: Here's the execption:


java.io.IOException: Stream closed

        at
java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145
)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:304)

        at java.io.FilterInputStream.read(FilterInputStream.java:90)

        at
org.apache.servicemix.jbi.util.FileUtil.copyInputStream(FileUtil.java:94)

        at
org.apache.servicemix.components.util.BinaryFileMarshaler.writeMessage(BinaryFileMarshaler.java:75)

...


--
View this message in context: 
http://www.nabble.com/IOException-when-reading-a-binary-file-tf2463465.html#a6867735
Sent from the ServiceMix - User mailing list archive at Nabble.com.




--
Cheers,
Guillaume Nodet

Reply via email to