title: Why does a "named query" I'm using in a Processor.process() method not work.? -how can I fixi it?
body: <p><em><strong>A  &quot;named query&quot; I'm using in a Processor.process() method doesn't work</strong></em></p>
  <p>--Why? -How can I fix it?</p>
  <p><em>thx for any help!  :-)</em></p>
  <p><em><strong>This is the JPA entity with the &quot;named query&quot; in question...</strong></em></p>
  <p>i.e.,</p>
  <pre><code>@NamedQuery(name = &quot;ThingTable.byUpdateTs&quot;, query = &quot;SELECT e FROM ThingTable e WHERE e.updateTs &gt; :updateTs&quot;)
  </code></pre>
  <p><em><strong>The &quot;named query&quot; is used in the process method code (below), but, is <em>not</em> working...</strong></em></p>
  <p>i.e.,</p>
  <pre><code>@Override
  public void process(Exchange msg) throws Exception {
      String firedTime = msg.getIn().getHeader(&quot;firedTime&quot;, String.class);
  
      ZonedDateTime zdtnow = ZonedDateTime.parse(firedTime, formatter2);
      zdtnow = zdtnow.withZoneSameInstant(ZoneId.of(&quot;America/New_York&quot;)); // ...in case springboot server defaults to UTC/GMT time zone...
  
      ZonedDateTime startZDT = zdtnow.minusMonths(24); //.minusSeconds(65); 
      
      //*********** this is the line of code using the &quot;named query&quot; ********** 
      String pollingQuery=&quot;jpa:aaa.bbb.ccc.jar.ThingTable?namedQuery=ThingTable.byUpdateTs&amp;updateTs='&quot; + startZDT.format(formatter) + &quot;'&quot;;
  
      msg.getIn().setBody(pollingQuery);
  }
  </code></pre>
  <p><em><strong>The Processor.process() method is used in this camel route...</strong></em></p>
  <p>i.e.,</p>
  <pre><code>from(&quot;timer://pollingTimer?fixedRate=true&amp;period=60000&quot;)
          .process(theProcessor::process)
          .toD(&quot;${body}&quot;)
          .split(body())
          .convertBodyTo(java.lang.String.class, &quot;UTF-8&quot;)
          .log(&quot;===============&gt;&gt;&gt; NEW MESSAGE: ${body}&quot;);  
  </code></pre>
  <p><em><strong>a snippet of stacktrace describing error:</strong></em></p>
  <p>i.e.,</p>
  <pre><code>-
  -
  -
  2020-12-30 23:53:32.191 ERROR 1 --- [://pollingTimer] o.a.c.p.e.DefaultErrorHandler            : Failed delivery for (MessageId: ID-7499dc21186b-1609372412151-0-1 on ExchangeId: ID-7499dc21186b-1609372412151-0-1). Exhausted after delivery attempt: 1 caught: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jpa://aaa.bbb.ccc.jar.ThingTable?namedQuery=byUpdateTs&amp;updateTs=%272018-12-30+18%3A53%3A31%27 due to: Failed to resolve endpoint: jpa://aaa.bbb.ccc.jar.ThingTable?namedQuery=byUpdateTs&amp;updateTs=%272018-12-30+18%3A53%3A31%27 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{updateTs='2018-12-30 18:53:31'}]
  
  Message History (complete message history is disabled)
  ---------------------------------------------------------------------------------------------------------------------------------------
  
  RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
  [route1            ] [route1            ] [from[timer://pollingTimer?fixedRate=true&amp;period=60000]                        ] [       333]
   ...
  [route1            ] [toD1              ] [${body}                                                                       ] [         0]
  
  Stacktrace
  ---------------------------------------------------------------------------------------------------------------------------------------
  
  
  org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: jpa://aaa.bbb.ccc.jar.ThingTable?namedQuery=byUpdateTs&amp;updateTs=%272018-12-30+18%3A53%3A31%27 due to: Failed to resolve endpoint: jpa://aaa.bbb.ccc.jar.ThingTable?namedQuery=byUpdateTs&amp;updateTs=%272018-12-30+18%3A53%3A31%27 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{updateTs='2018-12-30 18:53:31'}]
   at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:876) ~[camel-base-3.3.0.jar!/:3.3.0]
   at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:771) ~[camel-base-3.3.0.jar!/:3.3.0]
   at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:72) ~[camel-support-3.3.0.jar!/:3.3.0]
   at org.apache.camel.support.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:114) ~[camel-support-3.3.0.jar!/:3.3.0]
   at org.apache.camel.support.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:92) ~[camel-support-3.3.0.jar!/:3.3.0]
   at org.apache.camel.processor.SendDynamicProcessor.resolveEndpoint(SendDynamicProcessor.java:287) ~[camel-base-3.3.0.jar!/:3.3.0]
   at org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:155) ~[camel-base-3.3.0.jar!/:3.3.0]
   at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395) ~[camel-base-3.3.0.jar!/:3.3.0]
   at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148) ~[camel-base-3.3.0.jar!/:3.3.0]
   at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60) ~[camel-base-3.3.0.jar!/:3.3.0]
   -
   -
   -
   
   
  </code></pre>
  <p>(<em>Tried apache camel.apache.org website, but, so far, have been unable to find an example &quot;named query&quot; example that uses parameters - like mine, above</em>)</p>
  <p>e.g., <a href="https://camel.apache.org/components/latest/jpa-component.html" rel="nofollow noreferrer">https://camel.apache.org/components/latest/jpa-component.html</a>)</p>