You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Müller <ch...@gmail.com> on 2013/06/02 22:53:55 UTC

Re: Camel Error - even when everything seems to be working fine, but log shows errors

I can confirm this issue. I created a JIRA to track it [1]. Thanks for
reporting Vamsi!

[1] https://issues.apache.org/jira/browse/CAMEL-6414

Best,

Christian Müller
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Fri, May 31, 2013 at 7:07 AM, Vegi, Vamsi (MAN-Corporate-CON) <
Vamsi.Vegi@manheim.com> wrote:

> I found the cause,
> but it's so surprising, may be someone give some explanation
> or may be it's a bug
>
>
> I have a route like
>
>
>                  //REJECT block
>                  from(CHECK_REJ_MSG_URI)
>                         .routeId(CHECK_REJ_MSG_RID)
>                         .log( " START
> -----------------------------------------")
>                         .bean(new RelRep2AuctAcctMsgRouter(),
> "checkIfMsgIsReject")
>                         .choice()
>                         .when(header(MSG_REJECT).isEqualTo(true))
>
> .log("-------------------------------------------------------THE MSG ID:" +
> "${header.JMSMessageID}" + ": isA  ----REJECTED
> -----------------------------------------")
>                                 .to(REJECT_Q_END_POINT_URI)
>
>
> The cause is the stmnt
> .log("-------------------------------------------------------THE MSG ID:"
> + "${header.JMSMessageID}" + ": isA  ----REJECTED
> -----------------------------------------")
>
> Camel is expecting ":isA" to be a number, so strange
>
> When I modified that stmnt as below, the error is gone
> .log("-------------------------------------------------------THE REJECTED
> MSG ID:" + "${header.JMSMessageID}" )
>
>
>
>
> ERROR 2013-05-31 00:59:39,990 Camel (ovc-inbound-jms-camel-app) thread #5
> - JmsConsumer[man.tibco.dev.ovc.rep2auctionacc
> t.inbound.queue] 8065 org.apache.camel.processor.DefaultErrorHandler
>  Failed delivery for (MessageId: ID-MSC-VVEGILP-561
> 76-1369976373598-0-2 on ExchangeId:
> ID-MSC-VVEGILP-56176-1369976373598-0-1). Exhausted after delivery attempt:
> 1 caught:
>  org.apache.camel.TypeConversionException: Error during type conversion
> from type: java.lang.String to the required type
> : java.lang.Number with value : isA   due java.lang.NumberFormatException:
> For input string: ": isA  ". Processed by fai
> lure processor:
> FatalFallbackErrorHandler[Pipeline[[Channel[BeanProcessor[com.manheim.ovc.inb.camel.CommonMsgRouterUtil(
> 0x56cfbba2)]],
> Channel[sendTo(Endpoint[direct://putInRejQ_REL_REP2AUCTACCT_MSG])]]]]
> org.apache.camel.TypeConversionException: Error during type conversion
> from type: java.lang.String to the required type:
>  java.lang.Number with value : isA   due java.lang.NumberFormatException:
> For input string: ": isA  "
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:130)
>         at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:37)
>         at
> org.apache.camel.language.simple.ast.UnaryExpression$2.evaluate(UnaryExpression.java:114)
>
>
> -----Original Message-----
> From: Vegi, Vamsi (MAN-Corporate-CON) [mailto:Vamsi.Vegi@Manheim.com]
> Sent: Friday, May 31, 2013 12:43 AM
> To: users@camel.apache.org
> Subject: Camel Error - even when everything seems to be working fine, but
> log shows errors
>
> Hello
>
> The routes are doing their job and the msg sits in the reject q, However
> the logs show the following error : org.apache.camel.TypeConversionException
>
> ERROR 2013-05-31 00:35:26,941 Camel (ovc-inbound-jms-camel-app) thread #5
> - JmsConsumer[man.tibco.dev.ovc.rep2auctionacc
> t.inbound.queue] 10516 org.apache.camel.processor.DefaultErrorHandler
>  Failed delivery for (MessageId: ID-MSC-VVEGILP-55
> 945-1369974917991-0-2 on ExchangeId:
> ID-MSC-VVEGILP-55945-1369974917991-0-1). Exhausted after delivery attempt:
> 1 caught
> : org.apache.camel.TypeConversionException: Error during type conversion
> from type: java.lang.String to the required typ
> e: java.lang.Number with value : is   due java.lang.NumberFormatException:
> For input string: ": is". Processed by failur
> e processor:
> FatalFallbackErrorHandler[Pipeline[[Channel[BeanProcessor[com.manheim.ovc.inb.camel.CommonMsgRouterUtil(0x2
> ab95c08)]],
> Channel[sendTo(Endpoint[direct://putInRejQ_REL_REP2AUCTACCT_MSG])]]]]
> org.apache.camel.TypeConversionException: Error during type conversion
> from type: java.lang.String to the required type:
> java.lang.Number with value : is   due java.lang.NumberFormatException:
> For input string: ": is"
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:130)
>         at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:37)
>         at
> org.apache.camel.language.simple.ast.UnaryExpression$2.evaluate(UnaryExpression.java:114)
>         at
> org.apache.camel.builder.ExpressionBuilder$57.evaluate(ExpressionBuilder.java:1346)
>         at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)
>         at
> org.apache.camel.processor.LogProcessor.process(LogProcessor.java:51)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:81)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)
>        at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java
> :48)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:60)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)
>         at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)
>         at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java
> :48)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>        at
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:60)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)
>         at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)
>         at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java
> :48)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:60)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)
>         at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:81)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:390)
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:273)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:335)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
>         at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
>         at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java
> :48)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
>         at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)
>         at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerCon
> tainer.java:560)
>         at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerConta
> iner.java:498)
>         at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerCo
> ntainer.java:467)
>         at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingM
> essageListenerContainer.java:325)
>         at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMes
> sageListenerContainer.java:263)
>         at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(D
> efaultMessageListenerContainer.java:1058)
>         at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLo
> op(DefaultMessageListenerContainer.java:1050)
>         at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessa
> geListenerContainer.java:947)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: org.apache.camel.RuntimeCamelException:
> java.lang.NumberFormatException: For input string: ": is"
>         at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1338)
>         at
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:984)
>         at
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:47)
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:275)
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:113)
>         ... 203 more
> Caused by: java.lang.NumberFormatException: For input string: ": is"
>         at
> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1222)
>         at java.lang.Double.valueOf(Double.java:475)
>         at
> org.apache.camel.converter.ObjectConverter.toDouble(ObjectConverter.java:265)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:980)
>         ... 206 more
> WARN  2013-05-31 00:35:27,268 Camel (ovc-inbound-jms-camel-app) thread #5
> - JmsConsumer[man.tibco.dev.ovc.rep2auctionacc
> t.inbound.queue] 10843
> org.apache.camel.component.jms.EndpointMessageListener  Execution of JMS
> message listener failed.
> Caused by: [org.apache.camel.RuntimeCamelException -
> java.lang.NumberFormatException: For input string: ": is"]
> org.apache.camel.RuntimeCamelException: java.lang.NumberFormatException:
> For input string: ": is"
>         at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1338)
>         at
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:984)
>         at
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:47)
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:275)
>         at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:113)
>         at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:37)
>         at
> org.apache.camel.language.simple.ast.UnaryExpression$2.evaluate(UnaryExpression.java:114)
>         at
> org.apache.camel.builder.ExpressionBuilder$57.evaluate(ExpressionBuilder.java:1346)
>         at
> org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)
>         at
> org.apache.camel.processor.LogProcessor.process(LogProcessor.java:51)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>         at
> org.apache.camel.processor.interceptor.BacklogTracerInterceptor.process(BacklogTracerInterceptor.java:84)
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
>
>

Re: mybatis, velocity and html response

Posted by Conneen Michael <mc...@infointegrators.com>.
Christoph (et all)

Thanks much..   OK.. I did get further.. I had a few errors.. 

1.  My SQLMapConfig.xml file was not there.. as when I use POJOs I usually name it differently and then use code to look it up.  I did see the reference to "If the file is located in another location, you will need to configure the configurationUri option on the MyBatisComponent component." on the http://camel.apache.org/mybatis.html .. so for now.. I simply named it back.. 

2.  My velocity template was not properly referencing the returned collection.  Fixed that and poof... 

So.. my route  of .. 
                from("direct:start")   // start from camel itself .. no input queue 
                .to("mybatis:selectMyList?statementType=SelectList")    // select list of bulletin board messages. 
                .log("Tapped message body is ${body}")
                .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
                .to("file://target/subfolder")    // write the output of the velocity to a file. 
                .to("mock:result");

now works as desired..   Last hurdle .. get this into the servlet output stream..   My travels thus far have taught me a bit more as to how to read and interpret 
http://camel.apache.org/servlet.html

I am inching closer to my "ah ha" moment..  

Kind Regards,

Michael L. Conneen
Information Integrators, Inc.
http://www.infointegrators.com
PGP Key: http://mconneen.infointegrators.net/mconneen.asc

On Jun 3, 2013, at 13:17 , Christoph Emmersberger wrote:

> Hi Michael,
> 
> any luck with taking a look at the producer template.
> 
> As far as I can observe your routes, everything looks OK, except that it is still only partial and not bound together.
> 
> You can always execute myBatis from a Processor within your route, I mean trigger your existing code base from a Processor that does the job. This might ease your ramp up with the myBatis component config an eventually provide you a bit more freedom. Nevertheless you won't utilize the entire Camel feature set.
> 
> What I've seen in your last route, is that you might want to take a look at the section "Using onConsume" in http://camel.apache.org/mybatis.html
> 
> Kind regards,
> 
> - Christoph
> 
> On Jun 3, 2013, at 2:09 PM, Conneen Michael wrote:
> 
>> Christoph (et all), 
>> 
>> Thanks for the reply... I apologize for not being clear.. I know that is important for effective use of everyones time.   Here is the use case.. 
>> User http posts a form to servlet (camel servlet.... 
>> 	I have this working via the camel tomcat example as starting point.. )
>> 
>> Servlet validates post, parses parameters, executes query, passes query results to velocity to generate html, returns response
>> 
>> It is the later that I broke down into junit tests to ensure I understand the syntax and that each step works.. So.. what I have is.. 
>> 
>> execute query .. 
>> 	I have this working via a junit that basically has a route of . 
>> 		from("direct:start") .to("mybatis:selectMyList?statementType=SelectList") .log("Tapped message body is ${body}") .to("mock:result"); 
>> 
>> 	and then after the template.sendBody() .. the junit does a 
>> 	List<Account> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class); 
>> 
>> 	and iterates over the returned collection .. so I know myBatis is working as designed. 
>> 
>> generate html from list.. 
>> 	I kind of have this working in a junit.. though I currently do not execute myBatis via a route.. I execute it as I always have..
>> 
>> 	I execute this .. (mainly because I am struggling to link the routes.. ) 
>> 	myList = mySqlSession.selectList("selectMyList");  // pojo style myBaits. 
>>       template.requestBody("direct:start", myList);
>> 
>> 	my route looks like.. 
>>       from("direct:start")   // start from camel itself .. no input queue 
>>       .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
>>       .to("file://target/subfolder")    // write the output of the velocity to a file. 
>>       ;
>> 
>> where I am trying to get to is something like this.. 
>> 
>> 	route looks like... 
>>       from("direct:start")   // start from camel itself .. no input queue 
>> 	.to("mybatis:selectMyList?statementType=SelectList") 
>> 	.log("Tapped message body is ${body}")
>>       .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
>>       .to("file://target/subfolder")    // write the output of the velocity to a file. 
>>       ;
>> 
>> and eventually ..  burry all that into a config.. using the example tomcat servlet as my starting point.. 
>> 
>> So..finally.. to provide response to your questions.. 
>>> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
>> 	I tried following the Camel In Action book's logic of an anonymous inner class "new Processor()..", but that seems to have moved to an interface now.  I will look into the ProducerTemplate...
>> 
>>> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other
>> 	I need to send to the servlet output stream as the use case is post form.. return formatted response.. 
>> 	I was just going to tackle this problem in a plain old servlet, but thought I would use this as an opportunity to learn camel's EIP capabilities. ;) 
>> 
>> Kind Regards,
>> 
>> Michael L. Conneen
>> Information Integrators, Inc.
>> http://www.infointegrators.com
>> PGP Key: http://mconneen.infointegrators.net/mconneen.asc
>> 
>> 
>> 
>> On Jun 3, 2013, at 02:55 , Christoph Emmersberger wrote:
>> 
>>> Hi Michael,
>>> 
>>> let me try to ask some questions:
>>> 
>>> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
>>> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other.
>>> 
>>> Cheers,
>>> 
>>> - Christoph
>>> 
>>> On Jun 2, 2013, at 11:01 PM, Conneen Michael wrote:
>>> 
>>>> Folks, 
>>>> 
>>>> I  suspect I am a stones throw away from the "ah ha" moment.. but I cannot seem to get there..   I am a newbie so I purchased and downloaded the Camel In Action ebook... Great overview and has gotten me this far.. I do have "some" of the individual pieces working.. I just cannot figure out how to build the route correctly. 
>>>> 
>>>> I have searched the camel user forum for "mybatis selectlist velocity" ... but have yet to find what I am looking for... 
>>>> 
>>>> Here is what I want to do.. 
>>>> 1.  Run camel using a servlet endpoint as the starting point.   
>>>> 	From the tomcat example, got this working and mostly understand the spring configuration... 
>>>> 		
>>>> 2.  Parse off a parameter and pass into a myBatis select list. .. 
>>>> 	I have worked with myBatis a lot from POJOs... so I have both POJOs.. and I think a direct junit test of the mybatis route.. 
>>>> 		
>>>> 3.  Route the query results to velocity to produce an html table. ... 
>>>> 	I have junit working where I pass a list via  template.requestBody("direct:in", list);
>>>> 		
>>>> 4.  Return the results of the velocity template as the html response
>>>> 	Have not tackled this yet.   Trying to get routes 2 and 3 above first.. 
>>>> 
>>>> Things I cannot figure out.. 
>>>> A.   via "to" routing syntax, how do I provide the appropriate list collection to velocity ?  I know the raw syntax is
>>>> 		List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
>>>> 		but velocity is expecting the collection as part of the body.. 
>>>> 		
>>>> B.  how do I pull the velocity results out and concatenate with my desired html output stream?
>>>> 
>>>> Any pointers to my "ah ha" moment much appreciated..
>>> 
>> 
> 


Re: mybatis, velocity and html response

Posted by Conneen Michael <mc...@infointegrators.com>.
Wow.. a PROACTIVE user forum.. I LOVE IT..   I have not had the chance to dig into that.. Thank you for the reference.. as well as the onConsume.. I plan on looking at both later today.

You guys ROCK! (that's a good thing in case there is any language differences on the list.. ;) 


Kind Regards,

Michael L. Conneen
Information Integrators, Inc.
http://www.infointegrators.com
PGP Key: http://mconneen.infointegrators.net/mconneen.asc




On Jun 3, 2013, at 13:17 , Christoph Emmersberger wrote:

> Hi Michael,
> 
> any luck with taking a look at the producer template.
> 
> As far as I can observe your routes, everything looks OK, except that it is still only partial and not bound together.
> 
> You can always execute myBatis from a Processor within your route, I mean trigger your existing code base from a Processor that does the job. This might ease your ramp up with the myBatis component config an eventually provide you a bit more freedom. Nevertheless you won't utilize the entire Camel feature set.
> 
> What I've seen in your last route, is that you might want to take a look at the section "Using onConsume" in http://camel.apache.org/mybatis.html
> 
> Kind regards,
> 
> - Christoph
> 
> On Jun 3, 2013, at 2:09 PM, Conneen Michael wrote:
> 
>> Christoph (et all), 
>> 
>> Thanks for the reply... I apologize for not being clear.. I know that is important for effective use of everyones time.   Here is the use case.. 
>> User http posts a form to servlet (camel servlet.... 
>> 	I have this working via the camel tomcat example as starting point.. )
>> 
>> Servlet validates post, parses parameters, executes query, passes query results to velocity to generate html, returns response
>> 
>> It is the later that I broke down into junit tests to ensure I understand the syntax and that each step works.. So.. what I have is.. 
>> 
>> execute query .. 
>> 	I have this working via a junit that basically has a route of . 
>> 		from("direct:start") .to("mybatis:selectMyList?statementType=SelectList") .log("Tapped message body is ${body}") .to("mock:result"); 
>> 
>> 	and then after the template.sendBody() .. the junit does a 
>> 	List<Account> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class); 
>> 
>> 	and iterates over the returned collection .. so I know myBatis is working as designed. 
>> 
>> generate html from list.. 
>> 	I kind of have this working in a junit.. though I currently do not execute myBatis via a route.. I execute it as I always have..
>> 
>> 	I execute this .. (mainly because I am struggling to link the routes.. ) 
>> 	myList = mySqlSession.selectList("selectMyList");  // pojo style myBaits. 
>>       template.requestBody("direct:start", myList);
>> 
>> 	my route looks like.. 
>>       from("direct:start")   // start from camel itself .. no input queue 
>>       .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
>>       .to("file://target/subfolder")    // write the output of the velocity to a file. 
>>       ;
>> 
>> where I am trying to get to is something like this.. 
>> 
>> 	route looks like... 
>>       from("direct:start")   // start from camel itself .. no input queue 
>> 	.to("mybatis:selectMyList?statementType=SelectList") 
>> 	.log("Tapped message body is ${body}")
>>       .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
>>       .to("file://target/subfolder")    // write the output of the velocity to a file. 
>>       ;
>> 
>> and eventually ..  burry all that into a config.. using the example tomcat servlet as my starting point.. 
>> 
>> So..finally.. to provide response to your questions.. 
>>> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
>> 	I tried following the Camel In Action book's logic of an anonymous inner class "new Processor()..", but that seems to have moved to an interface now.  I will look into the ProducerTemplate...
>> 
>>> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other
>> 	I need to send to the servlet output stream as the use case is post form.. return formatted response.. 
>> 	I was just going to tackle this problem in a plain old servlet, but thought I would use this as an opportunity to learn camel's EIP capabilities. ;) 
>> 
>> Kind Regards,
>> 
>> Michael L. Conneen
>> Information Integrators, Inc.
>> http://www.infointegrators.com
>> PGP Key: http://mconneen.infointegrators.net/mconneen.asc
>> 
>> 
>> 
>> On Jun 3, 2013, at 02:55 , Christoph Emmersberger wrote:
>> 
>>> Hi Michael,
>>> 
>>> let me try to ask some questions:
>>> 
>>> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
>>> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other.
>>> 
>>> Cheers,
>>> 
>>> - Christoph
>>> 
>>> On Jun 2, 2013, at 11:01 PM, Conneen Michael wrote:
>>> 
>>>> Folks, 
>>>> 
>>>> I  suspect I am a stones throw away from the "ah ha" moment.. but I cannot seem to get there..   I am a newbie so I purchased and downloaded the Camel In Action ebook... Great overview and has gotten me this far.. I do have "some" of the individual pieces working.. I just cannot figure out how to build the route correctly. 
>>>> 
>>>> I have searched the camel user forum for "mybatis selectlist velocity" ... but have yet to find what I am looking for... 
>>>> 
>>>> Here is what I want to do.. 
>>>> 1.  Run camel using a servlet endpoint as the starting point.   
>>>> 	From the tomcat example, got this working and mostly understand the spring configuration... 
>>>> 		
>>>> 2.  Parse off a parameter and pass into a myBatis select list. .. 
>>>> 	I have worked with myBatis a lot from POJOs... so I have both POJOs.. and I think a direct junit test of the mybatis route.. 
>>>> 		
>>>> 3.  Route the query results to velocity to produce an html table. ... 
>>>> 	I have junit working where I pass a list via  template.requestBody("direct:in", list);
>>>> 		
>>>> 4.  Return the results of the velocity template as the html response
>>>> 	Have not tackled this yet.   Trying to get routes 2 and 3 above first.. 
>>>> 
>>>> Things I cannot figure out.. 
>>>> A.   via "to" routing syntax, how do I provide the appropriate list collection to velocity ?  I know the raw syntax is
>>>> 		List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
>>>> 		but velocity is expecting the collection as part of the body.. 
>>>> 		
>>>> B.  how do I pull the velocity results out and concatenate with my desired html output stream?
>>>> 
>>>> Any pointers to my "ah ha" moment much appreciated..
>>> 
>> 
> 


Re: mybatis, velocity and html response

Posted by Christoph Emmersberger <ce...@googlemail.com>.
Hi Michael,

any luck with taking a look at the producer template.

As far as I can observe your routes, everything looks OK, except that it is still only partial and not bound together.

You can always execute myBatis from a Processor within your route, I mean trigger your existing code base from a Processor that does the job. This might ease your ramp up with the myBatis component config an eventually provide you a bit more freedom. Nevertheless you won't utilize the entire Camel feature set.

What I've seen in your last route, is that you might want to take a look at the section "Using onConsume" in http://camel.apache.org/mybatis.html

Kind regards,

- Christoph

On Jun 3, 2013, at 2:09 PM, Conneen Michael wrote:

> Christoph (et all), 
> 
> Thanks for the reply... I apologize for not being clear.. I know that is important for effective use of everyones time.   Here is the use case.. 
> User http posts a form to servlet (camel servlet.... 
> 	I have this working via the camel tomcat example as starting point.. )
> 
> Servlet validates post, parses parameters, executes query, passes query results to velocity to generate html, returns response
> 
> It is the later that I broke down into junit tests to ensure I understand the syntax and that each step works.. So.. what I have is.. 
> 
> execute query .. 
> 	I have this working via a junit that basically has a route of . 
> 		from("direct:start") .to("mybatis:selectMyList?statementType=SelectList") .log("Tapped message body is ${body}") .to("mock:result"); 
> 
> 	and then after the template.sendBody() .. the junit does a 
> 	List<Account> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class); 
> 
> 	and iterates over the returned collection .. so I know myBatis is working as designed. 
> 
> generate html from list.. 
> 	I kind of have this working in a junit.. though I currently do not execute myBatis via a route.. I execute it as I always have..
> 
> 	I execute this .. (mainly because I am struggling to link the routes.. ) 
> 	myList = mySqlSession.selectList("selectMyList");  // pojo style myBaits. 
>        template.requestBody("direct:start", myList);
> 
> 	my route looks like.. 
>        from("direct:start")   // start from camel itself .. no input queue 
>        .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
>        .to("file://target/subfolder")    // write the output of the velocity to a file. 
>        ;
> 
> where I am trying to get to is something like this.. 
> 
> 	route looks like... 
>        from("direct:start")   // start from camel itself .. no input queue 
> 	.to("mybatis:selectMyList?statementType=SelectList") 
> 	.log("Tapped message body is ${body}")
>        .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
>        .to("file://target/subfolder")    // write the output of the velocity to a file. 
>        ;
> 
> and eventually ..  burry all that into a config.. using the example tomcat servlet as my starting point.. 
> 
> So..finally.. to provide response to your questions.. 
>> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
> 	I tried following the Camel In Action book's logic of an anonymous inner class "new Processor()..", but that seems to have moved to an interface now.  I will look into the ProducerTemplate...
> 
>> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other
> 	I need to send to the servlet output stream as the use case is post form.. return formatted response.. 
> 	I was just going to tackle this problem in a plain old servlet, but thought I would use this as an opportunity to learn camel's EIP capabilities. ;) 
> 
> Kind Regards,
> 
> Michael L. Conneen
> Information Integrators, Inc.
> http://www.infointegrators.com
> PGP Key: http://mconneen.infointegrators.net/mconneen.asc
> 
> 
> 
> On Jun 3, 2013, at 02:55 , Christoph Emmersberger wrote:
> 
>> Hi Michael,
>> 
>> let me try to ask some questions:
>> 
>> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
>> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other.
>> 
>> Cheers,
>> 
>> - Christoph
>> 
>> On Jun 2, 2013, at 11:01 PM, Conneen Michael wrote:
>> 
>>> Folks, 
>>> 
>>> I  suspect I am a stones throw away from the "ah ha" moment.. but I cannot seem to get there..   I am a newbie so I purchased and downloaded the Camel In Action ebook... Great overview and has gotten me this far.. I do have "some" of the individual pieces working.. I just cannot figure out how to build the route correctly. 
>>> 
>>> I have searched the camel user forum for "mybatis selectlist velocity" ... but have yet to find what I am looking for... 
>>> 
>>> Here is what I want to do.. 
>>> 1.  Run camel using a servlet endpoint as the starting point.   
>>> 	From the tomcat example, got this working and mostly understand the spring configuration... 
>>> 		
>>> 2.  Parse off a parameter and pass into a myBatis select list. .. 
>>> 	I have worked with myBatis a lot from POJOs... so I have both POJOs.. and I think a direct junit test of the mybatis route.. 
>>> 		
>>> 3.  Route the query results to velocity to produce an html table. ... 
>>> 	I have junit working where I pass a list via  template.requestBody("direct:in", list);
>>> 		
>>> 4.  Return the results of the velocity template as the html response
>>> 	Have not tackled this yet.   Trying to get routes 2 and 3 above first.. 
>>> 
>>> Things I cannot figure out.. 
>>> A.   via "to" routing syntax, how do I provide the appropriate list collection to velocity ?  I know the raw syntax is
>>> 		List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
>>> 		but velocity is expecting the collection as part of the body.. 
>>> 		
>>> B.  how do I pull the velocity results out and concatenate with my desired html output stream?
>>> 
>>> Any pointers to my "ah ha" moment much appreciated..
>> 
> 


Re: mybatis, velocity and html response

Posted by Conneen Michael <mc...@infointegrators.com>.
Christoph (et all), 

Thanks for the reply... I apologize for not being clear.. I know that is important for effective use of everyones time.   Here is the use case.. 
User http posts a form to servlet (camel servlet.... 
	I have this working via the camel tomcat example as starting point.. )

Servlet validates post, parses parameters, executes query, passes query results to velocity to generate html, returns response

It is the later that I broke down into junit tests to ensure I understand the syntax and that each step works.. So.. what I have is.. 

execute query .. 
	I have this working via a junit that basically has a route of . 
		from("direct:start") .to("mybatis:selectMyList?statementType=SelectList") .log("Tapped message body is ${body}") .to("mock:result"); 

	and then after the template.sendBody() .. the junit does a 
	List<Account> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class); 

	and iterates over the returned collection .. so I know myBatis is working as designed. 
 
generate html from list.. 
	I kind of have this working in a junit.. though I currently do not execute myBatis via a route.. I execute it as I always have..

	I execute this .. (mainly because I am struggling to link the routes.. ) 
	myList = mySqlSession.selectList("selectMyList");  // pojo style myBaits. 
        template.requestBody("direct:start", myList);

	my route looks like.. 
        from("direct:start")   // start from camel itself .. no input queue 
        .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
        .to("file://target/subfolder")    // write the output of the velocity to a file. 
        ;

where I am trying to get to is something like this.. 

	route looks like... 
        from("direct:start")   // start from camel itself .. no input queue 
	.to("mybatis:selectMyList?statementType=SelectList") 
	.log("Tapped message body is ${body}")
        .to("velocity:myVelocityTemplate.vm")    // run velocity against input message
        .to("file://target/subfolder")    // write the output of the velocity to a file. 
        ;

and eventually ..  burry all that into a config.. using the example tomcat servlet as my starting point.. 

So..finally.. to provide response to your questions.. 
> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
	I tried following the Camel In Action book's logic of an anonymous inner class "new Processor()..", but that seems to have moved to an interface now.  I will look into the ProducerTemplate...

> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other
	I need to send to the servlet output stream as the use case is post form.. return formatted response.. 
	I was just going to tackle this problem in a plain old servlet, but thought I would use this as an opportunity to learn camel's EIP capabilities. ;) 

Kind Regards,

Michael L. Conneen
Information Integrators, Inc.
http://www.infointegrators.com
PGP Key: http://mconneen.infointegrators.net/mconneen.asc



On Jun 3, 2013, at 02:55 , Christoph Emmersberger wrote:

> Hi Michael,
> 
> let me try to ask some questions:
> 
> A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
> B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other.
> 
> Cheers,
> 
> - Christoph
> 
> On Jun 2, 2013, at 11:01 PM, Conneen Michael wrote:
> 
>> Folks, 
>> 
>> I  suspect I am a stones throw away from the "ah ha" moment.. but I cannot seem to get there..   I am a newbie so I purchased and downloaded the Camel In Action ebook... Great overview and has gotten me this far.. I do have "some" of the individual pieces working.. I just cannot figure out how to build the route correctly. 
>> 
>> I have searched the camel user forum for "mybatis selectlist velocity" ... but have yet to find what I am looking for... 
>> 
>> Here is what I want to do.. 
>> 1.  Run camel using a servlet endpoint as the starting point.   
>> 	From the tomcat example, got this working and mostly understand the spring configuration... 
>> 		
>> 2.  Parse off a parameter and pass into a myBatis select list. .. 
>> 	I have worked with myBatis a lot from POJOs... so I have both POJOs.. and I think a direct junit test of the mybatis route.. 
>> 		
>> 3.  Route the query results to velocity to produce an html table. ... 
>> 	I have junit working where I pass a list via  template.requestBody("direct:in", list);
>> 		
>> 4.  Return the results of the velocity template as the html response
>> 	Have not tackled this yet.   Trying to get routes 2 and 3 above first.. 
>> 
>> Things I cannot figure out.. 
>> A.   via "to" routing syntax, how do I provide the appropriate list collection to velocity ?  I know the raw syntax is
>> 		List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
>> 		but velocity is expecting the collection as part of the body.. 
>> 		
>> B.  how do I pull the velocity results out and concatenate with my desired html output stream?
>> 
>> Any pointers to my "ah ha" moment much appreciated..
> 


Re: mybatis, velocity and html response

Posted by Christoph Emmersberger <ce...@googlemail.com>.
Hi Michael,

let me try to ask some questions:

A: Are you executing this example as unit test? If so, why don't you apply the ProducerTemplate and simply pass the list when executing the sendBody() operation?
B: We'll, ... you probably need to send it somewhere via the to() statement, e.g. to the jetty component or any other.

Cheers,

- Christoph

On Jun 2, 2013, at 11:01 PM, Conneen Michael wrote:

> Folks, 
> 
> I  suspect I am a stones throw away from the "ah ha" moment.. but I cannot seem to get there..   I am a newbie so I purchased and downloaded the Camel In Action ebook... Great overview and has gotten me this far.. I do have "some" of the individual pieces working.. I just cannot figure out how to build the route correctly. 
> 
> I have searched the camel user forum for "mybatis selectlist velocity" ... but have yet to find what I am looking for... 
> 
> Here is what I want to do.. 
> 1.  Run camel using a servlet endpoint as the starting point.   
> 	From the tomcat example, got this working and mostly understand the spring configuration... 
> 		
> 2.  Parse off a parameter and pass into a myBatis select list. .. 
> 	I have worked with myBatis a lot from POJOs... so I have both POJOs.. and I think a direct junit test of the mybatis route.. 
> 		
> 3.  Route the query results to velocity to produce an html table. ... 
> 	I have junit working where I pass a list via  template.requestBody("direct:in", list);
> 		
> 4.  Return the results of the velocity template as the html response
> 	Have not tackled this yet.   Trying to get routes 2 and 3 above first.. 
> 
> Things I cannot figure out.. 
> A.   via "to" routing syntax, how do I provide the appropriate list collection to velocity ?  I know the raw syntax is
> 		List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
> 		but velocity is expecting the collection as part of the body.. 
> 		
> B.  how do I pull the velocity results out and concatenate with my desired html output stream?
> 
> Any pointers to my "ah ha" moment much appreciated..


mybatis, velocity and html response

Posted by Conneen Michael <mc...@infointegrators.com>.
Folks, 

I  suspect I am a stones throw away from the "ah ha" moment.. but I cannot seem to get there..   I am a newbie so I purchased and downloaded the Camel In Action ebook... Great overview and has gotten me this far.. I do have "some" of the individual pieces working.. I just cannot figure out how to build the route correctly. 
 
 I have searched the camel user forum for "mybatis selectlist velocity" ... but have yet to find what I am looking for... 
 
 Here is what I want to do.. 
 1.  Run camel using a servlet endpoint as the starting point.   
 	From the tomcat example, got this working and mostly understand the spring configuration... 
 		
 2.  Parse off a parameter and pass into a myBatis select list. .. 
	I have worked with myBatis a lot from POJOs... so I have both POJOs.. and I think a direct junit test of the mybatis route.. 
 		
 3.  Route the query results to velocity to produce an html table. ... 
	I have junit working where I pass a list via  template.requestBody("direct:in", list);
 		
 4.  Return the results of the velocity template as the html response
	Have not tackled this yet.   Trying to get routes 2 and 3 above first.. 
 
 Things I cannot figure out.. 
A.   via "to" routing syntax, how do I provide the appropriate list collection to velocity ?  I know the raw syntax is
 		List<?> list = mock.getReceivedExchanges().get(0).getIn().getBody(List.class);
 		but velocity is expecting the collection as part of the body.. 
 		
 B.  how do I pull the velocity results out and concatenate with my desired html output stream?

Any pointers to my "ah ha" moment much appreciated..