All,
I am trying to use BinaryFileMarshaler with FtpPoller
But I am getting a file not found excelption. I am trying to access the
attachment from a servicemix-bean component.
DEBUG - BeanComponent - Retrieved correlation id:
ID:192.168.56.35-118ef461068-14:0
java.io.FileNotFoundException: \dnbusr1\ks\control\Input.txt (The system
cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at
javax.activation.FileDataSource.getInputStream(FileDataSource.java:97)
at javax.activation.DataHandler.getInputStream(DataHandler.java:237)
at
org.apache.servicemix.samples.pojo.ResponseHandlerBean.onMessageExchange(ResponseHandlerBean.java:59)
I think problem is in this code from BinaryFileMarshaler, that assumes the
polled file as local file, not reading using FTPClient
public void readMessage(MessageExchange exchange, NormalizedMessage
message, InputStream in, String path)
throws IOException, JBIException {
File polledFile = new File(path);
DataSource ds = new FileDataSource(polledFile);
DataHandler handler = new DataHandler(ds);
message.addAttachment(attachment, handler);
message.setProperty(FILE_NAME_PROPERTY, polledFile.getName());
message.setProperty(FILE_PATH_PROPERTY, path);
}
Thanks,
Rabi
--
View this message in context:
http://www.nabble.com/BinaryFileMarshaler-does-not-work-with-FtpPoller-tp16324519s12049p16324519.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.