Problem whille unzip file using ZipFileDataFormat on Microsoft Windows

Solution Verified - Updated -

Issue

I am using JBoss Fuse 6.3.0 (6.3.0.redhat-224) in a standalone installation. With Apache Camel I try to unzip a file using the following route:

<route id="selfscan-poller">
    <from uri="file:c:/data/test/input?recursive=true&amp;antInclude=**/*.zip&amp;delete=true&amp;readLock=markerFile" />
    <unmarshal ref="zipFileDataFormat" />
    <split streaming="true">
        <simple>${body}</simple>
        <to uri="file:c:/data/test/output" />
    </split>
</route>

<bean id="zipFileDataFormat" class="org.apache.camel.dataformat.zipfile.ZipFileDataFormat">
    <property name="usingIterator" value="true" />
</bean>

By deploying this route in Microsoft Windows (which is my target system), it unzips the file correctly to the target directory, but the source zip file cannot be deleted (see stack trace below). The zip file still has a lock on it. It is even not possible to delete the file manually.

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot delete file: GenericFile[c:\data\test\input\file.zip]
    at org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.commit(GenericFileDeleteProcessStrategy.java:89)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:127)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:57)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:104)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:229)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.util.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:65)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:673)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:628)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:245)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:109)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:196)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:454)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:226)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:190)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)[232:org.apache.camel.camel-core:2.17.0.redhat-630224]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_144]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_144]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_144]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_144]
    at java.lang.Thread.run(Thread.java:748)[:1.8.0_144]

Environment

  • Red Hat JBoss Fuse
    • 6.3.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.