You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Alex Soto <al...@envieta.com> on 2016/02/24 16:04:03 UTC

Unknown File Language Syntax

Hello:

Anybody can tell me what is wrong with this?


<pollEnrich timeout="5000">
   <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>  
</pollEnrich>


I am getting this exception:


Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
	at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
	at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
	at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
	at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
	at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
	at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
	at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
	at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
	... 85 more



Best regards,
Alex soto



Re: Unknown File Language Syntax

Posted by Claus Ibsen <cl...@gmail.com>.
The <constant> is good if there is nothing dynamic in it. And it help
workaround that bug in the simple parser.

That said we could likely consider removing the backwards compatible
in simple which was introduced in Camel 2.9 when the parser was
re-done.



On Wed, Feb 24, 2016 at 6:46 PM, Alex Soto <al...@envieta.com> wrote:
> So, to summarize:
>
>          if I have ${} then use <simple>,  if not, use <constant>
>
> I am not sure I have seen this explained anywhere in the documentation, perhaps it should be, to save others time.
>
> Thanks for the help Claus.
>
> Best regards,
> Alex soto
>
>
>> On Feb 24, 2016, at 12:04 PM, Claus Ibsen <cl...@gmail.com> wrote:
>>
>> Yes because you have ${ } somewhere in there so the backward
>> compatible parser is not in use.
>>
>> On Wed, Feb 24, 2016 at 5:54 PM, Alex Soto <al...@envieta.com> wrote:
>>> Constant works, however it stops working when I add option to consume a specific file name:
>>>
>>> <pollEnrich timeout="5000">
>>>   <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false&amp;fileName=${body}</constant>
>>> </pollEnrich>
>>>
>>> In this case, is is processing any file name, instead of the one I am passing in the body.
>>> Curiously, changing back <constant> to <simple> works now without any issue.
>>>
>>>
>>> Best regards,
>>> Alex soto
>>>
>>>
>>>
>>>> On Feb 24, 2016, at 10:58 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>
>>>> Hi
>>>>
>>>> Yeah there was a bug in the backwards compatible parser (checking the
>>>> old simple style)
>>>> https://issues.apache.org/jira/browse/CAMEL-9641
>>>>
>>>> The problem is that your text starts with file: which is the file
>>>> language part of simple where you can refer to ${file:name} etc. And
>>>> the old parser supported without ${ } style hence file:xxx triggered
>>>> it to barf.
>>>>
>>>> So use constant instead.
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Feb 24, 2016 at 4:26 PM, Alex Soto <al...@envieta.com> wrote:
>>>>> Startup resolution is fine, as the home directory is not expected to change.
>>>>> So it is <constant> and not <simple>?  This is strange, I wouldn’t have guessed it.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Best regards,
>>>>> Alex soto
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On Feb 24, 2016, at 10:21 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>>>
>>>>>> The simple function is
>>>>>> ${sysenv:HOME}
>>>>>>
>>>>>>
>>>>>> The {{ }} is property placeholders, which is replaced upon startup
>>>>>>
>>>>>> On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
>>>>>>> Sorry,  I am using Camel 2.16.0
>>>>>>>
>>>>>>> Do you mean, like this?
>>>>>>>
>>>>>>> <pollEnrich timeout="5000">
>>>>>>> <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
>>>>>>> </pollEnrich>
>>>>>>>
>>>>>>>
>>>>>>> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>>>>>>>
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Use <constant>
>>>>>>>>
>>>>>>>> But what version of Camel are you using?
>>>>>>>>
>>>>>>>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>>>>>>>> Hello:
>>>>>>>>>
>>>>>>>>> Anybody can tell me what is wrong with this?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <pollEnrich timeout="5000">
>>>>>>>>> <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>>>>>>>> </pollEnrich>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am getting this exception:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>>>>>>>     at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>>>>>>>     at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>>>>>>>     at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>>>>>>>     at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>>>>>>>     at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>>>>>>>     at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>>>>>>>     at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>>>>>>>     at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>>>>>>>     ... 85 more
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Alex soto
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Claus Ibsen
>>>>>>>> -----------------
>>>>>>>> http://davsclaus.com @davsclaus
>>>>>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Claus Ibsen
>>>>>> -----------------
>>>>>> http://davsclaus.com @davsclaus
>>>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> -----------------
>>>> http://davsclaus.com @davsclaus
>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>



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

Re: Unknown File Language Syntax

Posted by Alex Soto <al...@envieta.com>.
So, to summarize:

	 if I have ${} then use <simple>,  if not, use <constant>

I am not sure I have seen this explained anywhere in the documentation, perhaps it should be, to save others time.

Thanks for the help Claus.

Best regards,
Alex soto


> On Feb 24, 2016, at 12:04 PM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> Yes because you have ${ } somewhere in there so the backward
> compatible parser is not in use.
> 
> On Wed, Feb 24, 2016 at 5:54 PM, Alex Soto <al...@envieta.com> wrote:
>> Constant works, however it stops working when I add option to consume a specific file name:
>> 
>> <pollEnrich timeout="5000">
>>   <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false&amp;fileName=${body}</constant>
>> </pollEnrich>
>> 
>> In this case, is is processing any file name, instead of the one I am passing in the body.
>> Curiously, changing back <constant> to <simple> works now without any issue.
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>>> On Feb 24, 2016, at 10:58 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>> 
>>> Hi
>>> 
>>> Yeah there was a bug in the backwards compatible parser (checking the
>>> old simple style)
>>> https://issues.apache.org/jira/browse/CAMEL-9641
>>> 
>>> The problem is that your text starts with file: which is the file
>>> language part of simple where you can refer to ${file:name} etc. And
>>> the old parser supported without ${ } style hence file:xxx triggered
>>> it to barf.
>>> 
>>> So use constant instead.
>>> 
>>> 
>>> 
>>> 
>>> On Wed, Feb 24, 2016 at 4:26 PM, Alex Soto <al...@envieta.com> wrote:
>>>> Startup resolution is fine, as the home directory is not expected to change.
>>>> So it is <constant> and not <simple>?  This is strange, I wouldn’t have guessed it.
>>>> 
>>>> Thanks
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Feb 24, 2016, at 10:21 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>> 
>>>>> The simple function is
>>>>> ${sysenv:HOME}
>>>>> 
>>>>> 
>>>>> The {{ }} is property placeholders, which is replaced upon startup
>>>>> 
>>>>> On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
>>>>>> Sorry,  I am using Camel 2.16.0
>>>>>> 
>>>>>> Do you mean, like this?
>>>>>> 
>>>>>> <pollEnrich timeout="5000">
>>>>>> <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
>>>>>> </pollEnrich>
>>>>>> 
>>>>>> 
>>>>>> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>>>>>> 
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>>>> 
>>>>>>> Use <constant>
>>>>>>> 
>>>>>>> But what version of Camel are you using?
>>>>>>> 
>>>>>>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>>>>>>> Hello:
>>>>>>>> 
>>>>>>>> Anybody can tell me what is wrong with this?
>>>>>>>> 
>>>>>>>> 
>>>>>>>> <pollEnrich timeout="5000">
>>>>>>>> <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>>>>>>> </pollEnrich>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> I am getting this exception:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>>>>>>     at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>>>>>>     at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>>>>>>     at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>>>>>>     at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>>>>>>     at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>>>>>>     at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>>>>>>     at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>>>>>>     at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>>>>>>     ... 85 more
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Best regards,
>>>>>>>> Alex soto
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Claus Ibsen
>>>>>>> -----------------
>>>>>>> http://davsclaus.com @davsclaus
>>>>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Claus Ibsen
>>>>> -----------------
>>>>> http://davsclaus.com @davsclaus
>>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Unknown File Language Syntax

Posted by Claus Ibsen <cl...@gmail.com>.
Yes because you have ${ } somewhere in there so the backward
compatible parser is not in use.

On Wed, Feb 24, 2016 at 5:54 PM, Alex Soto <al...@envieta.com> wrote:
> Constant works, however it stops working when I add option to consume a specific file name:
>
> <pollEnrich timeout="5000">
>    <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false&amp;fileName=${body}</constant>
> </pollEnrich>
>
> In this case, is is processing any file name, instead of the one I am passing in the body.
> Curiously, changing back <constant> to <simple> works now without any issue.
>
>
> Best regards,
> Alex soto
>
>
>
>> On Feb 24, 2016, at 10:58 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>
>> Hi
>>
>> Yeah there was a bug in the backwards compatible parser (checking the
>> old simple style)
>> https://issues.apache.org/jira/browse/CAMEL-9641
>>
>> The problem is that your text starts with file: which is the file
>> language part of simple where you can refer to ${file:name} etc. And
>> the old parser supported without ${ } style hence file:xxx triggered
>> it to barf.
>>
>> So use constant instead.
>>
>>
>>
>>
>> On Wed, Feb 24, 2016 at 4:26 PM, Alex Soto <al...@envieta.com> wrote:
>>> Startup resolution is fine, as the home directory is not expected to change.
>>> So it is <constant> and not <simple>?  This is strange, I wouldn’t have guessed it.
>>>
>>> Thanks
>>>
>>> Best regards,
>>> Alex soto
>>>
>>>
>>>
>>>
>>>> On Feb 24, 2016, at 10:21 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>
>>>> The simple function is
>>>> ${sysenv:HOME}
>>>>
>>>>
>>>> The {{ }} is property placeholders, which is replaced upon startup
>>>>
>>>> On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
>>>>> Sorry,  I am using Camel 2.16.0
>>>>>
>>>>> Do you mean, like this?
>>>>>
>>>>> <pollEnrich timeout="5000">
>>>>>  <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
>>>>> </pollEnrich>
>>>>>
>>>>>
>>>>> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>>>>>
>>>>>
>>>>> Best regards,
>>>>> Alex soto
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>>>
>>>>>> Use <constant>
>>>>>>
>>>>>> But what version of Camel are you using?
>>>>>>
>>>>>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>>>>>> Hello:
>>>>>>>
>>>>>>> Anybody can tell me what is wrong with this?
>>>>>>>
>>>>>>>
>>>>>>> <pollEnrich timeout="5000">
>>>>>>> <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>>>>>> </pollEnrich>
>>>>>>>
>>>>>>>
>>>>>>> I am getting this exception:
>>>>>>>
>>>>>>>
>>>>>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>>>>>      at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>>>>>      at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>>>>>      at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>>>>>      at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>>>>>      at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>>>>>      at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>>>>>      at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>>>>>      at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>>>>>      ... 85 more
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Claus Ibsen
>>>>>> -----------------
>>>>>> http://davsclaus.com @davsclaus
>>>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> -----------------
>>>> http://davsclaus.com @davsclaus
>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>



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

Re: Unknown File Language Syntax

Posted by Alex Soto <al...@envieta.com>.
Constant works, however it stops working when I add option to consume a specific file name:

<pollEnrich timeout="5000">
   <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false&amp;fileName=${body}</constant>  
</pollEnrich>

In this case, is is processing any file name, instead of the one I am passing in the body.
Curiously, changing back <constant> to <simple> works now without any issue.


Best regards,
Alex soto



> On Feb 24, 2016, at 10:58 AM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> Hi
> 
> Yeah there was a bug in the backwards compatible parser (checking the
> old simple style)
> https://issues.apache.org/jira/browse/CAMEL-9641
> 
> The problem is that your text starts with file: which is the file
> language part of simple where you can refer to ${file:name} etc. And
> the old parser supported without ${ } style hence file:xxx triggered
> it to barf.
> 
> So use constant instead.
> 
> 
> 
> 
> On Wed, Feb 24, 2016 at 4:26 PM, Alex Soto <al...@envieta.com> wrote:
>> Startup resolution is fine, as the home directory is not expected to change.
>> So it is <constant> and not <simple>?  This is strange, I wouldn’t have guessed it.
>> 
>> Thanks
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On Feb 24, 2016, at 10:21 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>> 
>>> The simple function is
>>> ${sysenv:HOME}
>>> 
>>> 
>>> The {{ }} is property placeholders, which is replaced upon startup
>>> 
>>> On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
>>>> Sorry,  I am using Camel 2.16.0
>>>> 
>>>> Do you mean, like this?
>>>> 
>>>> <pollEnrich timeout="5000">
>>>>  <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
>>>> </pollEnrich>
>>>> 
>>>> 
>>>> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>>>> 
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>> 
>>>>> Use <constant>
>>>>> 
>>>>> But what version of Camel are you using?
>>>>> 
>>>>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>>>>> Hello:
>>>>>> 
>>>>>> Anybody can tell me what is wrong with this?
>>>>>> 
>>>>>> 
>>>>>> <pollEnrich timeout="5000">
>>>>>> <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>>>>> </pollEnrich>
>>>>>> 
>>>>>> 
>>>>>> I am getting this exception:
>>>>>> 
>>>>>> 
>>>>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>>>>      at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>>>>      at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>>>>      at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>>>>      at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>>>>      at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>>>>      at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>>>>      at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>>>>      at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>>>>      ... 85 more
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Best regards,
>>>>>> Alex soto
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Claus Ibsen
>>>>> -----------------
>>>>> http://davsclaus.com @davsclaus
>>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Unknown File Language Syntax

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah there was a bug in the backwards compatible parser (checking the
old simple style)
https://issues.apache.org/jira/browse/CAMEL-9641

The problem is that your text starts with file: which is the file
language part of simple where you can refer to ${file:name} etc. And
the old parser supported without ${ } style hence file:xxx triggered
it to barf.

So use constant instead.




On Wed, Feb 24, 2016 at 4:26 PM, Alex Soto <al...@envieta.com> wrote:
> Startup resolution is fine, as the home directory is not expected to change.
> So it is <constant> and not <simple>?  This is strange, I wouldn’t have guessed it.
>
> Thanks
>
> Best regards,
> Alex soto
>
>
>
>
>> On Feb 24, 2016, at 10:21 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>
>> The simple function is
>> ${sysenv:HOME}
>>
>>
>> The {{ }} is property placeholders, which is replaced upon startup
>>
>> On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
>>> Sorry,  I am using Camel 2.16.0
>>>
>>> Do you mean, like this?
>>>
>>> <pollEnrich timeout="5000">
>>>   <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
>>> </pollEnrich>
>>>
>>>
>>> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>>>
>>>
>>> Best regards,
>>> Alex soto
>>>
>>>
>>>
>>>
>>>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>>>
>>>> Use <constant>
>>>>
>>>> But what version of Camel are you using?
>>>>
>>>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>>>> Hello:
>>>>>
>>>>> Anybody can tell me what is wrong with this?
>>>>>
>>>>>
>>>>> <pollEnrich timeout="5000">
>>>>>  <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>>>> </pollEnrich>
>>>>>
>>>>>
>>>>> I am getting this exception:
>>>>>
>>>>>
>>>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>>>       at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>>>       at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>>>       at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>>>       at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>>>       at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>>>       at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>>>       at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>>>       at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>>>       ... 85 more
>>>>>
>>>>>
>>>>>
>>>>> Best regards,
>>>>> Alex soto
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> -----------------
>>>> http://davsclaus.com @davsclaus
>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>



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

Re: Unknown File Language Syntax

Posted by Alex Soto <al...@envieta.com>.
Startup resolution is fine, as the home directory is not expected to change.
So it is <constant> and not <simple>?  This is strange, I wouldn’t have guessed it.

Thanks

Best regards,
Alex soto




> On Feb 24, 2016, at 10:21 AM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> The simple function is
> ${sysenv:HOME}
> 
> 
> The {{ }} is property placeholders, which is replaced upon startup
> 
> On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
>> Sorry,  I am using Camel 2.16.0
>> 
>> Do you mean, like this?
>> 
>> <pollEnrich timeout="5000">
>>   <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
>> </pollEnrich>
>> 
>> 
>> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>> 
>>> Use <constant>
>>> 
>>> But what version of Camel are you using?
>>> 
>>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>>> Hello:
>>>> 
>>>> Anybody can tell me what is wrong with this?
>>>> 
>>>> 
>>>> <pollEnrich timeout="5000">
>>>>  <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>>> </pollEnrich>
>>>> 
>>>> 
>>>> I am getting this exception:
>>>> 
>>>> 
>>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>>       at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>>       at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>>       at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>>       at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>>       at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>>       at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>>       at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>>       at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>>       ... 85 more
>>>> 
>>>> 
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Claus Ibsen
>>> -----------------
>>> http://davsclaus.com @davsclaus
>>> Camel in Action 2: https://www.manning.com/ibsen2
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Unknown File Language Syntax

Posted by Claus Ibsen <cl...@gmail.com>.
The simple function is
${sysenv:HOME}


The {{ }} is property placeholders, which is replaced upon startup

On Wed, Feb 24, 2016 at 4:13 PM, Alex Soto <al...@envieta.com> wrote:
> Sorry,  I am using Camel 2.16.0
>
> Do you mean, like this?
>
> <pollEnrich timeout="5000">
>    <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>
> </pollEnrich>
>
>
> My intention is to have {{env:HOME}}  substituted with the home directory at runtime
>
>
> Best regards,
> Alex soto
>
>
>
>
>> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
>>
>> Use <constant>
>>
>> But what version of Camel are you using?
>>
>> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>>> Hello:
>>>
>>> Anybody can tell me what is wrong with this?
>>>
>>>
>>> <pollEnrich timeout="5000">
>>>   <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>>> </pollEnrich>
>>>
>>>
>>> I am getting this exception:
>>>
>>>
>>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>>        at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>>        at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>>        at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>>        at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>>        at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>>        at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>>        at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>>        at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>>        ... 85 more
>>>
>>>
>>>
>>> Best regards,
>>> Alex soto
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>



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

Re: Unknown File Language Syntax

Posted by Alex Soto <al...@envieta.com>.
Sorry,  I am using Camel 2.16.0

Do you mean, like this?

<pollEnrich timeout="5000">
   <constant>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</constant>  
</pollEnrich>


My intention is to have {{env:HOME}}  substituted with the home directory at runtime


Best regards,
Alex soto




> On Feb 24, 2016, at 10:09 AM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> Use <constant>
> 
> But what version of Camel are you using?
> 
> On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
>> Hello:
>> 
>> Anybody can tell me what is wrong with this?
>> 
>> 
>> <pollEnrich timeout="5000">
>>   <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
>> </pollEnrich>
>> 
>> 
>> I am getting this exception:
>> 
>> 
>> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>>        at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>>        at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>>        at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>>        at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>>        at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>>        at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>>        at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>>        at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>>        ... 85 more
>> 
>> 
>> 
>> Best regards,
>> Alex soto
>> 
>> 
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Unknown File Language Syntax

Posted by Claus Ibsen <cl...@gmail.com>.
Use <constant>

But what version of Camel are you using?

On Wed, Feb 24, 2016 at 4:04 PM, Alex Soto <al...@envieta.com> wrote:
> Hello:
>
> Anybody can tell me what is wrong with this?
>
>
> <pollEnrich timeout="5000">
>    <simple>file:{{env:HOME}}/.ra/chains?autoCreate=false&amp;noop=true&amp;idempotent=false</simple>
> </pollEnrich>
>
>
> I am getting this exception:
>
>
> Caused by: org.apache.camel.language.simple.types.SimpleParserException: Unknown file language syntax: /Users/asoto/.ra/chains?autoCreate=false&noop=true&idempotent=false
>         at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleFileExpression(SimpleFunctionExpression.java:409)
>         at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createSimpleExpression(SimpleFunctionExpression.java:144)
>         at org.apache.camel.language.simple.ast.SimpleFunctionExpression.createExpression(SimpleFunctionExpression.java:55)
>         at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.doParseExpression(SimpleBackwardsCompatibleParser.java:72)
>         at org.apache.camel.language.simple.SimpleBackwardsCompatibleParser.parseExpression(SimpleBackwardsCompatibleParser.java:47)
>         at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:127)
>         at org.apache.camel.language.simple.SimpleLanguage.createExpression(SimpleLanguage.java:160)
>         at org.apache.camel.builder.SimpleBuilder.createExpression(SimpleBuilder.java:107)
>         ... 85 more
>
>
>
> Best regards,
> Alex soto
>
>



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