camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: I got weird problem with aggregator
Date Thu, 23 Jan 2014 08:19:21 GMT
For JDBC you need to store serializable objects in the message as they
need to be able to be written to a database.

See at section what is preserved when persisting:
http://camel.apache.org/sql-component.html


On Wed, Jan 22, 2014 at 10:20 PM, nono <yan.wang@db-is.com> wrote:
> I got weird problem with jdbc aggregator   , could it be my aggregate method
> problem?
> I mean should i use Object instead of Map ?
> The problem does not happen often
>
>  public Exchange aggregate(Exchange oldEx, Exchange newEx) {
>         Map newBody = newEx.getIn().getBody(Map.class);
>         ArrayList<Map> list = null;
>         if (oldEx == null) {
>                 list = new ArrayList<Map>();
>                 list.add(newBody);
>                 newEx.getIn().setBody(list);
>                 return newEx;
>         } else {
>                 list = oldEx.getIn().getBody(ArrayList.class);
>                 list.add(newBody);
>                 return oldEx;
>         }
>     }
>
> below is error log
>      at
> org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
>
>         at
> org.apache.camel.processor.aggregate.AggregateProcessor$AggregationTimeoutMap.purge(AggregateProcessor.java:671)[141:org.apache.camel.camel-core:2.
>
> 9.0.fuse-70-084]
>
>         at
> org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)[141:org.apache.camel.camel-core:2.9.0.fuse-70-084]
>
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_24]
>
>         at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)[:1.6.0_24]
>
>         at
> java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)[:1.6.0_24]
>
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)[:1.6.0_24]
>
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)[:1.6.0_24]
>
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)[:1.6.0_24]
>
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_24]
>
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_24]
>
>         at java.lang.Thread.run(Thread.java:662)[:1.6.0_24]
>
> Caused by: java.lang.ClassNotFoundException: null class
>
>         at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)[:1.6.0_24]
>
>         at java.util.HashMap.readObject(HashMap.java:1030)[:1.6.0_24]
>
>         at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
>
>         at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
>
>         at
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)[:1.6.0_24]
>
>         at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)[:1.6.0_24]
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/I-got-weird-problem-with-aggregator-tp5746367.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Mime
View raw message