You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by bonnahu <bo...@gmail.com> on 2013/09/09 22:47:57 UTC
Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Running on Camel 2.11.1.
I am trying to use a defined VM argument (e.g., -Dprop.env=DEV) in camel
context.
However, I got the error saying "PropertiesComponent with name properties
must be defined in CamelContext to support property placeholders". So I
need to add a propertyPlaceholder to make it
work. I guess it is related to this issue
https://issues.apache.org/jira/browse/CAMEL-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
But according to the comment, this issue has been fixed in 2.11.1. Did I
make any mistake here?
<camel:camelContext xmlns="http://camel.apache.org/schema/spring" >
<camel:route>
<camel:from uri="file:src/data?noop=true"/>
<camel:choice>
<camel:when>
<camel:xpath>/person/city = 'London'</camel:xpath>
<camel:log message="<b>{{prop.env}}*"/>
<camel:to uri="file:target/messages/uk"/>
</camel:when>
<camel:otherwise>
<camel:log message="Other message"/>
<camel:to uri="file:target/messages/others"/>
</camel:otherwise>
</camel:choice>
</camel:route>
</camel:camelContext>
--
View this message in context: http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by Claus Ibsen <cl...@gmail.com>.
Yes
On Wed, Sep 11, 2013 at 12:00 AM, bonnahu <bo...@gmail.com> wrote:
> Thanks Claus. So you are saying is that I still need to create a fake
> properties file, even I don't use it. Do I understand it correctly?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974p5739066.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by bonnahu <bo...@gmail.com>.
Thanks Claus. So you are saying is that I still need to create a fake
properties file, even I don't use it. Do I understand it correctly?
--
View this message in context: http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974p5739066.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by Claus Ibsen <cl...@gmail.com>.
You still need to add it, as its the property placeholder component
that understands and resolves the {{ }} stuff.
On Tue, Sep 10, 2013 at 5:15 PM, bonnahu <bo...@gmail.com> wrote:
> Hi Christian, I understand what you said
> "Camel's propertyPlaceholder must be available to use within the camel
> context."
> But here I was not planning to use a propertyPlaceholder, what I wanted to
> do is to
> use the defined VM argument ,prop.env in camel context, like following
> <camel:log message="{{prop.env}}"/>.
> So I don't think I need to add any propertyPlaceholder to the camel context,
> is it correct?
>
> thanks
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974p5739035.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by bonnahu <bo...@gmail.com>.
Hi Christian, I understand what you said
"Camel's propertyPlaceholder must be available to use within the camel
context."
But here I was not planning to use a propertyPlaceholder, what I wanted to
do is to
use the defined VM argument ,prop.env in camel context, like following
<camel:log message="{{prop.env}}"/>.
So I don't think I need to add any propertyPlaceholder to the camel context,
is it correct?
thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974p5739035.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by Christian Posta <ch...@gmail.com>.
Yah, publish to github or the like.
Camel's propertyPlaceholder must be available to use within the camel
context.
On Tue, Sep 10, 2013 at 6:14 AM, bonnahu <bo...@gmail.com> wrote:
> Hi Christian, I didn't define the propertyPlaceholder component in any
> other
> place. I added the propertyPlaceholder just to avoid the error. If you
> want,
> I can send the project to you to take a look.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974p5739022.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by bonnahu <bo...@gmail.com>.
Hi Christian, I didn't define the propertyPlaceholder component in any other
place. I added the propertyPlaceholder just to avoid the error. If you want,
I can send the project to you to take a look.
--
View this message in context: http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974p5739022.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Got an error "PropertiesComponent with name properties must be
defined in CamelContext to support property placeholders"
Posted by Christian Posta <ch...@gmail.com>.
Do you define the propertyPlaceholder component anywhere in your context?
http://camel.apache.org/using-propertyplaceholder.html
On Mon, Sep 9, 2013 at 1:47 PM, bonnahu <bo...@gmail.com> wrote:
> Running on Camel 2.11.1.
> I am trying to use a defined VM argument (e.g., -Dprop.env=DEV) in camel
> context.
> However, I got the error saying "PropertiesComponent with name properties
> must be defined in CamelContext to support property placeholders". So I
> need to add a propertyPlaceholder to make it
> work. I guess it is related to this issue
>
> https://issues.apache.org/jira/browse/CAMEL-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel
>
> But according to the comment, this issue has been fixed in 2.11.1. Did I
> make any mistake here?
>
>
>
> <camel:camelContext xmlns="http://camel.apache.org/schema/spring" >
>
> <camel:route>
> <camel:from uri="file:src/data?noop=true"/>
> <camel:choice>
> <camel:when>
> <camel:xpath>/person/city = 'London'</camel:xpath>
>
> <camel:log message="<b>{{prop.env}}*"/>
> <camel:to uri="file:target/messages/uk"/>
> </camel:when>
> <camel:otherwise>
> <camel:log message="Other message"/>
> <camel:to uri="file:target/messages/others"/>
> </camel:otherwise>
> </camel:choice>
> </camel:route>
> </camel:camelContext>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Got-an-error-PropertiesComponent-with-name-properties-must-be-defined-in-CamelContext-to-support-pro-tp5738974.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta