You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by rabi <ra...@wipro.com> on 2008/03/27 13:17:23 UTC

BinaryFileMarshaler does not work with FtpPoller

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.


RE: BinaryFileMarshaler does not work with FtpPoller

Posted by ra...@wipro.com.
created a JIRA issue and attached a patch.

________________________________

From: rabi [mailto:rabi.mishra@wipro.com]
Sent: Thu 3/27/2008 5:47 PM
To: users@servicemix.apache.org
Subject: BinaryFileMarshaler does not work with FtpPoller




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.




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com


RE: BinaryFileMarshaler does not work with FtpPoller

Posted by ra...@wipro.com.
created a JIRA issue and attached a patch.

________________________________

From: rabi [mailto:rabi.mishra@wipro.com]
Sent: Thu 3/27/2008 5:47 PM
To: users@servicemix.apache.org
Subject: BinaryFileMarshaler does not work with FtpPoller




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.




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com