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/07/13 23:38:14 UTC

How to use PropertyPlaceholderConfigurer to configure the autoStartup option

Hey guys, 
I am new to Camel. Currently, I want to use PropertyPlaceholderConfigurer to
specify the autoStartup option in Camel route. Here is the
PropertyPlaceholderConfigurer bean:
         
         <bean id="inventoryProperties" 
	
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<list>
				<value>
					autostartup.properties
				</value>
				
			</list>
		</property>
	</bean>

Here is the content of the autostartup.properties file:

route.autostart=true

Here is what I use in the spring DSL xml:

<route id="testingRoute1" autoStartup = "${route.autostart}" >


The error I got is 

[OnException[[class... because of Error parsing [${route.autostart}] as a
Boolean.


Can anyone help me here?




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option

Posted by bonnahu <bo...@gmail.com>.
Hi Willem,
I am using 2.10.1.

Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604p5735754.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option

Posted by Willem jiang <wi...@gmail.com>.
Hi

Which version of Camel are you using?

This issue is related to the schema definition, I think you need to disable the Spring schema validation[1]

I just checked the latest camel spring schema, the attribute type of autoStartup is string now, which means you will not hit this kind of issue in latest released Camel.

[1]http://stackoverflow.com/questions/4160104/disable-schema-validation-in-spring-3  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Sunday, July 14, 2013 at 5:38 AM, bonnahu wrote:

> Hey guys,  
> I am new to Camel. Currently, I want to use PropertyPlaceholderConfigurer to
> specify the autoStartup option in Camel route. Here is the
> PropertyPlaceholderConfigurer bean:
>  
> <bean id="inventoryProperties"  
>  
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
> <property name="locations">
> <list>
> <value>
> autostartup.properties
> </value>
>  
> </list>
> </property>
> </bean>
>  
> Here is the content of the autostartup.properties file:
>  
> route.autostart=true
>  
> Here is what I use in the spring DSL xml:
>  
> <route id="testingRoute1" autoStartup = "${route.autostart}" >
>  
>  
> The error I got is  
>  
> [OnException[[class... because of Error parsing [${route.autostart}] as a
> Boolean.
>  
>  
> Can anyone help me here?
>  
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
>  




Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option

Posted by bonnahu <bo...@gmail.com>.
Hi Claus,
It works for me! Thanks a lot!



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604p5735753.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to use PropertyPlaceholderConfigurer to configure the autoStartup option

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

See this page
http://camel.apache.org/using-propertyplaceholder.html

The syntax to use inside <camelContext> is {{ }}


On Sat, Jul 13, 2013 at 11:38 PM, bonnahu <bo...@gmail.com> wrote:
> Hey guys,
> I am new to Camel. Currently, I want to use PropertyPlaceholderConfigurer to
> specify the autoStartup option in Camel route. Here is the
> PropertyPlaceholderConfigurer bean:
>
>          <bean id="inventoryProperties"
>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>                 <property name="locations">
>                         <list>
>                                 <value>
>                                         autostartup.properties
>                                 </value>
>
>                         </list>
>                 </property>
>         </bean>
>
> Here is the content of the autostartup.properties file:
>
> route.autostart=true
>
> Here is what I use in the spring DSL xml:
>
> <route id="testingRoute1" autoStartup = "${route.autostart}" >
>
>
> The error I got is
>
> [OnException[[class... because of Error parsing [${route.autostart}] as a
> Boolean.
>
>
> Can anyone help me here?
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-use-PropertyPlaceholderConfigurer-to-configure-the-autoStartup-option-tp5735604.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