[ 
https://issues.apache.org/activemq/browse/CAMEL-980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46524#action_46524
 ] 

Christian Schneider commented on CAMEL-980:
-------------------------------------------

Hi Claus,

I am running Windows Vista but I don“t think this is a OS dependent issue. 
Could you reproduce the error when you leave out the convertBodyTo ?

I have debugged the error. The problem seems to be in:
org.apache.camel.converter.jaxb.FallbackTypeConverter line 90

InputStream inputStream = parentTypeConverter.convertTo(InputStream.class, 
value);
            if (inputStream != null) {
>>>>                Object unmarshalled = unmarshaller.unmarshal(inputStream);
                return type.cast(unmarshalled);
            }

It opens an inputstream and calls unmarshall. I am not sure how unmarshall 
should work. Does it close the stream when all goes well?
In any case it leaves the stream open if some exception happens. So I think 
there should be a try {} finally {}  in FallbackTypeConverter that 
tries to close the stream. Of with a try catch on close. 

This block is probably also necessary for the other variants following.

What do you think?


> File component - can not delete consumed file when processing failed (look 
> into real cause)
> -------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-980
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-980
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Critical
>             Fix For: 1.5.0
>
>         Attachments: CamelExampleFileJaxb.zip
>
>
> See nabble:
> http://www.nabble.com/Problem-with-FileEndpoint-td19940096s22882.html
> *Workaround*
> Use .convertBodyTo(String.class) in the route so the file is read into 
> memory, and the java.io.File handler shouldn't be open/locked when camel 
> attempts to delete it after wards.

-- 
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