camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Nonnenmacher <vincent.nonnenmac...@gmail.com>
Subject Re: Zipping the content of several files into one file
Date Tue, 14 Feb 2012 10:35:39 GMT
Never used the zip data format
But weren't you supposed to write something like

<marshall ref="yourzipdataformatbean" /> ?
Where your bean coud be specified with the proper deflation setting.

But it sound from your stack trace that a ZipDataFormat is called by the
Marshall.process
What did say IOHelper at line 164 called from copy method ?

On Tuesday, February 14, 2012, Lars <lars.stuevold@ergogroup.no> wrote:
> Hi,
> I'm using Camel 2.9.0 and try to aggregate the content of xml-files in a
> directory into a zip-file. When I try to open the zip it is unreadable.
> Look at the route below to see if I done some stupid errors.
> Or maybe it is a better way to do this.
>
>        <route id="outGoingInvoiceRoute" routePolicyRef="outgoingPolicy">
>                        <from uri="{{file.inbox}}" />
>                        <convertBodyTo type="java.lang.String" />
>                        <bean ref="xmlValidation" method="validate" />
>                        <aggregate strategyRef="aggregatorStrategy"
>                                completionTimeout="3000" completionSize="5"
>                                aggregationRepositoryRef="invoiceRepo">
>                                <correlationExpression>
>                                        <constant>true</constant>
>                                </correlationExpression>
>                                <wireTap uri="{{ftp.outbox.nozip}}" />
>                                <marshal>
>                                        <zip></zip>
>                                </marshal>
>                                <setHeader headerName="CamelFileName">
>
 <simple>Invoice-${date:now:yyyyMMddHHmmssSSS}.zip</simple>
>                                </setHeader>
>                                <to uri="{{ftp.outbox.zipped}}" />
>                                <setHeader headerName="timestamp">
>                                        <simple>${date:now:yyyy-MM-dd
HH:mm:ss}</simple>
>                                </setHeader>
>                                <to uri="velocity:receiptMsg.vm" />
>                                <to uri="activemq:no.acme.SuccessQueue" />
>                        </aggregate>
>                 </route>
>
> *
> I also get some NPE during execution like this:*
> java.lang.NullPointerException
>        at
>
org.apache.camel.util.IOHelper.copy(IOHelper.java:164)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.util.IOHelper.copy(IOHelper.java:160)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.impl.ZipDataFormat.marshal(ZipDataFormat.java:48)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:322)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:213)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.aggregate.AggregateProcessor$1.run(AggregateProcessor.java:402)[camel-core-2.9.0.jar:2.9.0]
>        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source)[:1.6.0_30]
>        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source)[:1.6.0_30]
>        at java.util.concurrent.FutureTask.run(Unknown Source)[:1.6.0_30]
>        at
>
org.apache.camel.util.concurrent.SynchronousExecutorService.execute(SynchronousExecutorService.java:62)[camel-core-2.9.0.jar:2.9.0]
>        at java.util.concurrent.AbstractExecutorService.submit(Unknown
> Source)[:1.6.0_30]
>        at
>
org.apache.camel.processor.aggregate.AggregateProcessor.onSubmitCompletion(AggregateProcessor.java:394)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.aggregate.AggregateProcessor.access$1000(AggregateProcessor.java:77)[camel-core-2.9.0.jar:2.9.0]
>        at
>
org.apache.camel.processor.aggregate.AggregateProcessor$RecoverTask.run(AggregateProcessor.java:789)[camel-core-2.9.0.jar:2.9.0]
>        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source)[:1.6.0_30]
>        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown
> Source)[:1.6.0_30]
>        at java.util.concurrent.FutureTask.runAndReset(Unknown
Source)[:1.6.0_30]
>        at
>
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown
> Source)[:1.6.0_30]
>        at
>
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown
> Source)[:1.6.0_30]
>        at
>
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
> Source)[:1.6.0_30]
>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)[:1.6.0_30]
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)[:1.6.0_30]
>        at java.lang.Thread.run(Unknown Source)[:1.6.0_30]
>
>
> Thanks in advance!
>
> Best regards
>
> Lars Stuevold
>
>
>
> --
> View this message in context:
http://camel.465427.n5.nabble.com/Zipping-the-content-of-several-files-into-one-file-tp5481638p5481638.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message