Did you try to reset the StreamCache before try to read something from it? -- Willem Jiang
Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On December 16, 2014 at 3:04:45 PM, shanaloh (shana...@gmail.com) wrote: > hi guys, > > I am quite new to Camel. We are using Camel 2.14. > > I got this intermittent error which is quite annoying. It happens very > rarely and randomly. If I send the same request again, it will process just > fine. > > 2014-12-15 17:24:56.700 ERROR 1852673485@qtp-1010937526-2 > common.exception.MTSErrorHandler Received Exception > com.fasterxml.jackson.databind.JsonMappingException: No content to map due > to end-of-input > at Source: org.apache.camel.converter.stream.InputStreamCache@64288413; > line: 1, column: 1 > > After searching this exception, I have seen many places where people suggest > to use stream caching. However in our case, stream caching is already used. > I am not sure however if it is set up properly. > > Thanks in advance for any your inputs. > > Cheers > > Shan > > *This is our camel context config* > > > trace="${camel.trace:false}" streamCache="true"> > > When project starts up, this line indicates it is enabled: > 2014-12-16 16:13:04.300 INFO [main] [camel.spring.SpringCamelContext] > StreamCaching is enabled on CamelContext: camelContext > > > > *This is our code.* > > > RouteDefinition rdRouteDefinition = from( createListeningService() > ).routeId( getRouteId() ); > rdRouteDefinition.wireTap( > ABCMaintenanceRouteDefinition.AUDIT_LOGGING.getCamelRoute() ); > rdRouteDefinition > .process(new Processor() { > > @Override > public void process(Exchange exchange) throws Exception { > _log.info("Before unmarshall()" ); > _log.info("exchange body = " + exchange.getIn().getBody()); > _log.info("exchange body size = " + > exchange.getIn().getBody(InputStreamCache.class).length()); > } > > }) > .unmarshal().json(JsonLibrary.Jackson, ExecutionRequest.class) > .to(ABCRouteType.VALIDATOR.getRoutePrefix() + requestXsd) > .convertBodyTo(FIXExecutionReport.class) > .process(fixMessageProcessor) > .wireTap( ABCRouteType.LOG.getRoutePrefix() + _log.getName() + > ABCGenericConstants.LOGGING_ROUTE_OPTIONS ) > .inOnly( routeType.getRoutePrefix() + publishingDestination ); > > rdRouteDefinition.wireTap( > ABCMaintenanceRouteDefinition.AUDIT_LOGGING.getCamelRoute() ); > > > > *This is the logging * > > 2014-12-15 17:24:56.682 INFO 1852673485@qtp-1010937526-2 Before > unmarshall() > 2014-12-15 17:24:56.682 INFO 1852673485@qtp-1010937526-2 exchange body = > org.apache.camel.converter.stream.InputStreamCache@64288413 > 2014-12-15 17:24:56.683 INFO 1852673485@qtp-1010937526-2 exchange body size > = 646 > > 2014-12-15 17:24:56.700 ERROR 1852673485@qtp-1010937526-2 > common.exception.ABCErrorHandler Received Exception > com.fasterxml.jackson.databind.JsonMappingException: No content to map due > to end-of-input > at Source: org.apache.camel.converter.stream.InputStreamCache@64288413; > line: 1, column: 1 > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Intermittent-error-No-content-to-map-due-to-end-of-input-tp5760725.html > > Sent from the Camel - Users mailing list archive at Nabble.com. >