Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14115

InvalidPayloadException when doing GET

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.23.2
    • Fix Version/s: None
    • Component/s: camel-http
    • Labels:
      None
    • Environment:

      Windows Server 2016

      Camel runs with Spring Boot

    • Estimated Complexity:
      Unknown

      Description

      When doing a GET request to a REST API with a Java object as body the request fails with InvalidPayloadException:

      org.apache.camel.InvalidPayloadException: No body available of type: java.io.InputStream but has value: se.ri.plini.coworker.svc014.entity.Event@38cbb5c7 of type: se.ri.plini.coworker.svc014.entity.Event on: Message[ID-sp-integrat-u1a-1572450030405-0-5]. Caused by: No type converter available to convert from type: se.ri.plini.coworker.svc014.entity.Event to the required type: java.io.InputStream with value se.ri.plini.coworker.svc014.entity.Event@38cbb5c7. Exchange[ID-sp-integrat-u1a-1572450030405-0-4]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: se.ri.plini.coworker.svc014.entity.Event to the required type: java.io.InputStream with value se.ri.plini.coworker.svc014.entity.Event@38cbb5c7]org.apache.camel.InvalidPayloadException: No body available of type: java.io.InputStream but has value: se.ri.plini.coworker.svc014.entity.Event@38cbb5c7 of type: se.ri.plini.coworker.svc014.entity.Event on: Message[ID-sp-integrat-u1a-1572450030405-0-5]. Caused by: No type converter available to convert from type: se.ri.plini.coworker.svc014.entity.Event to the required type: java.io.InputStream with value se.ri.plini.coworker.svc014.entity.Event@38cbb5c7. Exchange[ID-sp-integrat-u1a-1572450030405-0-4]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: se.ri.plini.coworker.svc014.entity.Event to the required type: java.io.InputStream with value se.ri.plini.coworker.svc014.entity.Event@38cbb5c7] at org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:117) at org.apache.camel.component.http.HttpProducer.createRequestEntity(HttpProducer.java:494) at org.apache.camel.component.http.HttpProducer.createMethod(HttpProducer.java:418) at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:99) at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) at org.apache.camel.processor.SendDynamicProcessor$1.doInAsyncProducer(SendDynamicProcessor.java:178) at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:445) at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:160) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:113) at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:84) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:113) at org.apache.camel.processor.TryProcessor.process(TryProcessor.java:84) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:715) at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:638) at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:248) at org.apache.camel.processor.Splitter.process(Splitter.java:129) at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76) at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:110) at org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40) at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) at org.apache.camel.processor.Pipeline.access$100(Pipeline.java:43) at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:157) at org.apache.camel.processor.ThreadsProcessor$ProcessCall.run(ThreadsProcessor.java:87) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

       

      When looking into HttpProducer.java line 494 I see that Camel tries to transform the body to an InputStream. Why does Camel do that when I do a GET request? A GET request doesn't have a body, so there is no need to even look at the body...

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                heka Henrik Karlsson
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: