You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by erappa <ed...@gmail.com> on 2016/05/16 21:45:55 UTC

Error exception from CamelContinuationServlet

Hi,

I am trying to get JSON data from jetty endpoint (another service), create
output data and send them to one or more CVS files. I have 2 routes - first
one creates files for current date, based on cron settings, second one
exposes jetty endpoint to create files for any specified date on GET
request. They are exactly the same except starting point, I also tried to
send messages from second endpoint to first one... In both cases CSV files
are created but second route gives me
org.apache.camel.TypeConversionException. My route is:

from(httpServer +
"/lineups?throwExceptionOnFailure=false?httpMethodRestrict=GET")
.routeId("manualStart")
.setExchangePattern(ExchangePattern.InOnly)
.setHeader(Exchange.HTTP_URI, simple(apiEndpoint + "/lineups"))
.setHeader("target_date", simple("${in.header.date}"))
.setHeader(Exchange.HTTP_QUERY, simple("date=${in.header.date}"))
.setHeader(Exchange.HTTP_METHOD, constant("GET"))
.to("https://dummyhost")
.process(new MappingProcessor())
.split(body())
.setHeader("prefix", simple("${body.name}"))
.process(new FileNameProcessor())
.marshal(bindy)
.aggregate(header("prefix"), new FileAggregationStrategy())
.completionTimeout(60000L)
.to("file:" + fileLocation +
"?fileName=Nielsen.${in.header.prefix}.${in.header.target_date}.txt");

I got following exceptions:

16:41:50.493 [qtp1583020257-49] ERROR o.a.c.c.j.CamelContinuationServlet -
Error processing request
org.apache.camel.TypeConversionException: Error during type conversion from
type: java.lang.String to the required type: java.io.InputStream with value 
[com...beans.MyOutput@7c9c5406, com...beans.MyOutput@6e3e3511, com.... [Body
clipped after 1000 chars, total length is 23865] due Failed to convert from
type [java.util.ArrayList<?>] to type [java.io.InputStream] for value ...
...
com....beans.MyOutput@6f0c8349]'; 

nested exception is
org.springframework.core.convert.ConverterNotFoundException: No converter
found capable of converting from type [java.util.ArrayList<?>] to type
[java.io.InputStream]
    at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:610)
    at
org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:137)
    at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:72)
    at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:47)
    at
org.apache.camel.http.common.DefaultHttpBinding.doWriteDirectResponse(DefaultHttpBinding.java:396)
    at
org.apache.camel.http.common.DefaultHttpBinding.doWriteResponse(DefaultHttpBinding.java:332)
    at
org.apache.camel.http.common.DefaultHttpBinding.writeResponse(DefaultHttpBinding.java:264)
    at
org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:227)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
    at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)
    at
org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:45)
    at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
    at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
    at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
    at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
    at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
    at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
    at org.eclipse.jetty.server.Server.handleAsync(Server.java:567)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:325)
    at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
    at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
    at
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
    at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.core.convert.ConversionFailedException:
Failed to convert from type [java.util.ArrayList<?>] to type
[java.io.InputStream] for value...

My data format for CSV formatting:

DataFormat bindy = new BindyCsvDataFormat(MyOutput.class);

I tried to add .log() after each step and I see that exception is thrown on
.aggregate and I don't see any useful information on trace. My aggregation
strategy just concatenates 2 strings together. What could be wrong ? Another
route started from

from("quartz://start/api_cron/?cron=" + cronExpression + "&fireNow=true")

works without any exceptions. I've found that CamelContinuationServlet is a
part of Jetty component and it 'leverages Jetty Continuations'. I tried to
turn off jetty continuations using useContinuation=false option in endpoint
uri, but I still receive the exceptions...

Thank you



--
View this message in context: http://camel.465427.n5.nabble.com/Error-exception-from-CamelContinuationServlet-tp5782679.html
Sent from the Camel - Users mailing list archive at Nabble.com.