You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Achim Nierbeck <bc...@googlemail.com> on 2011/08/05 16:41:19 UTC

Strange behavior of Camel-Bindy and windows

Hi

I do have a very strange behavior with
camel 2.8 and the camel-bindy module on my windows machine.

My camel route is quite straight forward

		<camel:route id="readBrandConfig">
			<camel:from ref="fileEndpoint" />
				<camel:unmarshal ref="bindyDataformat" />
				<camel:convertBodyTo
					type="myentity.entity.Dummy" />
				<camel:to id="storeEntity"
					uri="jpa://myentity.entity.Dummy" />
				<camel:to uri="mock:test" />
		</camel:route>

Now while debugging I'm in the class BindyCsvDataFormat
running through the unmarshall method.

after the Scanner class is created with the given InputStreamReader
the scanner obect looks good.
There is no entry for the lastException field inside of the scanner object.

After the while loop with
scanner.hasNextLine()

the scanner object contains a lastException
which is IOException
telling me that the file is locked by another process.

Now I used the SysInternals handle exec to give me a clue which process
does take a hold on this file that is supposed to be unmarshalled.
It shows me that my java executable does take a hold on my csv file twice.
I guess this is the problem but how can I get around it?

Thanx, Achim


-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/>

Re: Strange behavior of Camel-Bindy and windows

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Jon,

thanx, but this didn't help
but found that I had the readLock set to file lock in my uri.

 uri="file://target/conf-dir?filter=#myAntFilter&amp;move=.done&amp;delay=2000&amp;readLock=fileLock"


I thought this wouldn't matter.

Btw. it also did prevent me from converting it into a string like you
suggested.

Regards, Achim

2011/8/5 Jon Anstey <ja...@gmail.com>:
> Hi Achim,
>
> This could be a Windows only problem occurring... but you could try putting
> a <convertBodyTo type="java.lang.String"/> before the unmarshal to see if
> loading the file content into memory will workaround this.
>
> Cheers,
> Jon
>
> On Fri, Aug 5, 2011 at 12:11 PM, Achim Nierbeck <bc...@googlemail.com>wrote:
>
>> Hi
>>
>> I do have a very strange behavior with
>> camel 2.8 and the camel-bindy module on my windows machine.
>>
>> My camel route is quite straight forward
>>
>>                <camel:route id="readBrandConfig">
>>                        <camel:from ref="fileEndpoint" />
>>                                <camel:unmarshal ref="bindyDataformat" />
>>                                <camel:convertBodyTo
>>                                        type="myentity.entity.Dummy" />
>>                                <camel:to id="storeEntity"
>>                                        uri="jpa://myentity.entity.Dummy" />
>>                                <camel:to uri="mock:test" />
>>                </camel:route>
>>
>> Now while debugging I'm in the class BindyCsvDataFormat
>> running through the unmarshall method.
>>
>> after the Scanner class is created with the given InputStreamReader
>> the scanner obect looks good.
>> There is no entry for the lastException field inside of the scanner object.
>>
>> After the while loop with
>> scanner.hasNextLine()
>>
>> the scanner object contains a lastException
>> which is IOException
>> telling me that the file is locked by another process.
>>
>> Now I used the SysInternals handle exec to give me a clue which process
>> does take a hold on this file that is supposed to be unmarshalled.
>> It shows me that my java executable does take a hold on my csv file twice.
>> I guess this is the problem but how can I get around it?
>>
>> Thanx, Achim
>>
>>
>> --
>>
>> Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
>> Committer & Project Lead
>> blog <http://notizblog.nierbeck.de/>
>>
>
>
>
> --
> Cheers,
> Jon
> ---------------
> FuseSource
> Email: jon@fusesource.com
> Web: fusesource.com
> Twitter: jon_anstey
> Blog: http://janstey.blogspot.com
> Author of Camel in Action: http://manning.com/ibsen
>



-- 
--
*Achim Nierbeck*


Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
Committer & Project Lead
blog <http://notizblog.nierbeck.de/>

Re: Strange behavior of Camel-Bindy and windows

Posted by Jon Anstey <ja...@gmail.com>.
Hi Achim,

This could be a Windows only problem occurring... but you could try putting
a <convertBodyTo type="java.lang.String"/> before the unmarshal to see if
loading the file content into memory will workaround this.

Cheers,
Jon

On Fri, Aug 5, 2011 at 12:11 PM, Achim Nierbeck <bc...@googlemail.com>wrote:

> Hi
>
> I do have a very strange behavior with
> camel 2.8 and the camel-bindy module on my windows machine.
>
> My camel route is quite straight forward
>
>                <camel:route id="readBrandConfig">
>                        <camel:from ref="fileEndpoint" />
>                                <camel:unmarshal ref="bindyDataformat" />
>                                <camel:convertBodyTo
>                                        type="myentity.entity.Dummy" />
>                                <camel:to id="storeEntity"
>                                        uri="jpa://myentity.entity.Dummy" />
>                                <camel:to uri="mock:test" />
>                </camel:route>
>
> Now while debugging I'm in the class BindyCsvDataFormat
> running through the unmarshall method.
>
> after the Scanner class is created with the given InputStreamReader
> the scanner obect looks good.
> There is no entry for the lastException field inside of the scanner object.
>
> After the while loop with
> scanner.hasNextLine()
>
> the scanner object contains a lastException
> which is IOException
> telling me that the file is locked by another process.
>
> Now I used the SysInternals handle exec to give me a clue which process
> does take a hold on this file that is supposed to be unmarshalled.
> It shows me that my java executable does take a hold on my csv file twice.
> I guess this is the problem but how can I get around it?
>
> Thanx, Achim
>
>
> --
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>
> Committer & Project Lead
> blog <http://notizblog.nierbeck.de/>
>



-- 
Cheers,
Jon
---------------
FuseSource
Email: jon@fusesource.com
Web: fusesource.com
Twitter: jon_anstey
Blog: http://janstey.blogspot.com
Author of Camel in Action: http://manning.com/ibsen