How to fix Missing ${ from the text: error - Apache Camel 2.12 to 2.16.4 uprade

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to fix Missing ${ from the text: error - Apache Camel 2.12 to 2.16.4 uprade

Troy1900
Hello,

We are upgrading from Apache Camel 2.12 to 2.16.4 and running into issues
with one of the routes.

Caused by: java.lang.IllegalArgumentException: Missing ${ from the text:
file:C:\OnDemandOutput?fileName=RPFPos_L2W.$simple{in.header.accountNum}-${date:now:yyyyMMddHHmmssSSS}.csv












*<camelContext        xmlns="http://camel.apache.org/schema/spring
<http://camel.apache.org/schema/spring>">    <propertyPlaceholder
id="ignoreId" location="classpath:reformMB.properties"
             prefixToken="${" suffixToken="}"/><route
id="sendNotification">            <from
uri="jms:queue:queue.sendNotification"/>            <to
uri="file:${OnDemand.output.url}?fileName=RPFPos_L2W.$simple{in.header.accountNum}-${date:now:yyyyMMddHHmmssSSS}.csv"/>
</route></camelContext>*


As per documentation this should have worked. Can someone help me in
understanding what is wrong ?
http://camel.apache.org/using-propertyplaceholder.html

Clashing Spring Property Placeholders with Camels Simple Language Take
notice when using Spring bridging placeholder then the spring ${} syntax
clashes with the Simple in Camel, and therefore take care.

Example:

xml {{file.rootdir}}/${in.header.CamelFileName} clashes with Spring
property placeholders, and you should use $simple{} to indicate using the
Simple language in Camel.

xml {{file.rootdir}}/$simple{in.header.CamelFileName}
Reply | Threaded
Open this post in threaded view
|

Re: How to fix Missing ${ from the text: error - Apache Camel 2.12 to 2.16.4 uprade

Claus Ibsen-2
Hi

Looks like you mix $simple{ and ${

Use just $simple{

On Tue, Jul 16, 2019 at 5:32 PM Rajiv Jacob Cheriyan
<[hidden email]> wrote:

>
> Hello,
>
> We are upgrading from Apache Camel 2.12 to 2.16.4 and running into issues
> with one of the routes.
>
> Caused by: java.lang.IllegalArgumentException: Missing ${ from the text:
> file:C:\OnDemandOutput?fileName=RPFPos_L2W.$simple{in.header.accountNum}-${date:now:yyyyMMddHHmmssSSS}.csv
>
>
>
>
>
>
>
>
>
>
>
>
> *<camelContext        xmlns="http://camel.apache.org/schema/spring
> <http://camel.apache.org/schema/spring>">    <propertyPlaceholder
> id="ignoreId" location="classpath:reformMB.properties"
>              prefixToken="${" suffixToken="}"/><route
> id="sendNotification">            <from
> uri="jms:queue:queue.sendNotification"/>            <to
> uri="file:${OnDemand.output.url}?fileName=RPFPos_L2W.$simple{in.header.accountNum}-${date:now:yyyyMMddHHmmssSSS}.csv"/>
> </route></camelContext>*
>
>
> As per documentation this should have worked. Can someone help me in
> understanding what is wrong ?
> http://camel.apache.org/using-propertyplaceholder.html
>
> Clashing Spring Property Placeholders with Camels Simple Language Take
> notice when using Spring bridging placeholder then the spring ${} syntax
> clashes with the Simple in Camel, and therefore take care.
>
> Example:
>
> xml {{file.rootdir}}/${in.header.CamelFileName} clashes with Spring
> property placeholders, and you should use $simple{} to indicate using the
> Simple language in Camel.
>
> xml {{file.rootdir}}/$simple{in.header.CamelFileName}



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2