[ 
https://issues.apache.org/activemq/browse/SM-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41880#action_41880
 ] 

Rabi commented on SM-1295:
--------------------------

>I think this is a bad side effect of my change. Once I changed it because this 
>stream data source has the >problem, that the inputstream can only be gathered 
>once and every other try will end up in an IOException.
>I remember the test case was a file endpoint polling for binary files and 
>sending them to the mail sender >endpoint. The mail api was not able to send 
>the binary attachment for some reason. 
>Just changing the code now back to StreamDataSource usage will solve the ftp 
>problem but will cause >another problem to occur. I am not sure what to do 
>now. 

What is the other problem?? Is it the mail component related issue that you 
mentioned?  Can we revert to the earlier code till a new fix has been arrived 
at?

>I will have a deeper look on how to resolve this.



> BinaryFileMarshaler does not work with FTPPoller Endpoint
> ---------------------------------------------------------
>
>                 Key: SM-1295
>                 URL: https://issues.apache.org/activemq/browse/SM-1295
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-core
>    Affects Versions: 3.2.1, 3.3
>         Environment: Windows XP
>            Reporter: Rabi
>             Fix For: 3.3
>
>         Attachments: BinaryFileMarshaler-patch.txt
>
>
> When using BinaryFileMarshaler with FtpPoller 
> File not found excelption. It seems to be looking for the file on the local 
> server rather than ftp location. 
> 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) 
>  
> Code responsible for the problem are the following lines in 
> BinaryFileMarshaler
>  
>  public void readMessage(MessageExchange exchange, NormalizedMessage message, 
> InputStream in, String path) 
>         throws IOException, JBIException { 
> ......
>         DataSource ds = new FileDataSource(polledFile); 
>         DataHandler handler = new DataHandler(ds); 
> .....
>     } 
> Attaching the fix. Please validate and commit. I have tested and it works 
> fine with 3.3-SNAPSHOT.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to