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

jsonpath: If used after platform-http-vertx, it causes PathNotFoundException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.9.0
    • Fix Version/s: 3.10.0
    • Component/s: camel-jsonpath
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When following route:

              from("platform-http:/hello").
              choice().when().jsonpath("$.room[?(@.temperature > 20)]").
                  setBody(simple("HOT")).
              otherwise().
                  setBody(constant("WARM")).
              end();
      

      Is executed with body

      {room:{temperature:30}}
      

      Exception is triggered:

      com.jayway.jsonpath.PathNotFoundException: Missing property in path $['room']
      at com.jayway.jsonpath.internal.path.PathToken.handleObjectProperty(PathToken.java:72)
      at com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:79)
      at com.jayway.jsonpath.internal.path.RootPathToken.evaluate(RootPathToken.java:62)
      at com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:53)
      at com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:61)
      at com.jayway.jsonpath.JsonPath.read(JsonPath.java:187)
      at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:102)
      at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:89)
      at org.apache.camel.jsonpath.JsonPathEngine.readWithAdapter(JsonPathEngine.java:262)
      at org.apache.camel.jsonpath.JsonPathEngine.doRead(JsonPathEngine.java:187)
      at org.apache.camel.jsonpath.JsonPathEngine.read(JsonPathEngine.java:105)
      at org.apache.camel.jsonpath.JsonPathExpression.evaluateJsonPath(JsonPathExpression.java:190)
      at org.apache.camel.jsonpath.JsonPathExpression.evaluate(JsonPathExpression.java:144)
      at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
      at org.apache.camel.support.ExpressionSupport.matches(ExpressionSupport.java:36)
      at org.apache.camel.processor.FilterProcessor.matches(FilterProcessor.java:77)
      at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:71)
      at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463)
      at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179)
      at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
      at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
      at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
      at org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConsumer.lambda$handleRequest$2(VertxPlatformHttpConsumer.java:184)
      at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.base/java.lang.Thread.run(Thread.java:834)

      org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[C7B428C77B12413-0000000000000000]
      at org.apache.camel.CamelExecutionException.wrapCamelExecutionException(CamelExecutionException.java:45)
      at org.apache.camel.support.ExchangeHelper.extractResultBody(ExchangeHelper.java:698)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:591)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:587)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:189)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:195)
      at org.apache.camel.jsonpath.JsonPathPojoTransformTest.testPojo(JsonPathPojoTransformTest.java:46)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
      at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
      at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
      at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
      at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
      at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
      at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
      at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
      at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
      at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
      at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
      at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
      at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
      at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206)
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
      at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
      at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
      at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
      at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
      at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
      at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
      at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
      at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:188)
      at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:154)
      at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:128)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
      at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
      at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
      Caused by: org.apache.camel.ExpressionEvaluationException: org.apache.camel.CamelExchangeException: Cannot read message body as supported JSON value. Exchange[]
      at org.apache.camel.jsonpath.JsonPathExpression.evaluate(JsonPathExpression.java:159)
      at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:45)
      at org.apache.camel.processor.TransformProcessor.process(TransformProcessor.java:47)
      at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463)
      at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179)
      at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
      at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
      at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
      at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:96)
      at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:217)
      at org.apache.camel.impl.engine.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:111)
      at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)
      at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108)
      at org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:190)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153)
      at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:187)
      ... 70 more
      Caused by: org.apache.camel.CamelExchangeException: Cannot read message body as supported JSON value. Exchange[]
      at org.apache.camel.jsonpath.JsonPathEngine.doRead(JsonPathEngine.java:213)
      at org.apache.camel.jsonpath.JsonPathEngine.read(JsonPathEngine.java:105)
      at org.apache.camel.jsonpath.JsonPathExpression.evaluateJsonPath(JsonPathExpression.java:190)
      at org.apache.camel.jsonpath.JsonPathExpression.evaluate(JsonPathExpression.java:144)
      ... 87 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jondruse Jiri Ondrusek
                Reporter:
                jondruse Jiri Ondrusek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: