You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Andreas A." <an...@gmail.com> on 2010/11/05 11:34:11 UTC

[Camel 2.5] Propertyplaceholders and Spring DSL still not working?

Hi

I'm upgrading to Camel 2.5 and this property is still not being resolved it
seems, do I need to do something special to make it work?

"The EIP now supports property placeholders in the String based options (a
few spots in Java DSL where its not possible). For example:
<convertBodyTo type="String" charset="{{foo.myCharset}}"/>"

My route:
<choice>
	<when><simple>${properties:charset.external} != ''</simple>
		<convertBodyTo type="String" charset="{{charset.external}}" />
	</when>
	<otherwise>
		<convertBodyTo type="String" />
	</otherwise>
</choice>

Exception:
Caused by: java.nio.charset.IllegalCharsetNameException:
{{charset.external}}
	at java.nio.charset.Charset.checkName(Charset.java:284)
	at java.nio.charset.Charset.lookup2(Charset.java:458)
	at java.nio.charset.Charset.lookup(Charset.java:437)
	at java.nio.charset.Charset.isSupported(Charset.java:479)
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251608.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Camel 2.5] Propertyplaceholders and Spring DSL still not working?

Posted by "Andreas A." <an...@gmail.com>.
JIRA ticket: https://issues.apache.org/activemq/browse/CAMEL-3314
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251823.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Camel 2.5] Propertyplaceholders and Spring DSL still not working?

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

Can you create a JIRA.
I suspect there is an issue when its part of a sub route such as in a <choice>



On Fri, Nov 5, 2010 at 2:16 PM, Andreas A. <an...@gmail.com> wrote:
>
> Hi
>
> This must be a bug. When used nested in the <choice> tag the resolving
> fails:
>
> This works:
> <route>
>        <from uri="file:data/in" />
>        <convertBodyTo type="String" charset="{{charset.external}}" />
>        <log message="Charset: {{charset.external}}" />
>        <to uri="file:data/out" />
> </route>
>
> This fails:
> <route>
>        <from uri="file:data/in" />
>        <choice>
>                <when>
>                        <constant>true</constant>
>                        <convertBodyTo type="String" charset="{{charset.external}}" />
>                </when>
>        </choice>
>        <log message="Charset: {{charset.external}}" />
>        <to uri="file:data/out" />
> </route>
>
> Can you confirm this by testing Claus?
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251790.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: [Camel 2.5] Propertyplaceholders and Spring DSL still not working?

Posted by "Andreas A." <an...@gmail.com>.
Hi

This must be a bug. When used nested in the <choice> tag the resolving
fails:

This works:
<route>
	<from uri="file:data/in" />
	<convertBodyTo type="String" charset="{{charset.external}}" />		
	<log message="Charset: {{charset.external}}" />
	<to uri="file:data/out" />
</route>

This fails:
<route>
	<from uri="file:data/in" />
	<choice>
		<when>
			<constant>true</constant>
			<convertBodyTo type="String" charset="{{charset.external}}" />		
		</when>
	</choice>
	<log message="Charset: {{charset.external}}" />
	<to uri="file:data/out" />
</route>

Can you confirm this by testing Claus?
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251790.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Camel 2.5] Propertyplaceholders and Spring DSL still not working?

Posted by "Andreas A." <an...@gmail.com>.
Ok, silly mistake. Had to manually clean up my Eclipse project since Eclipse
was still using the old jars.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251707.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Camel 2.5] Propertyplaceholders and Spring DSL still not working?

Posted by "Andreas A." <an...@gmail.com>.
Do I need Spring 3.0.4?
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251631.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: [Camel 2.5] Propertyplaceholders and Spring DSL still not working?

Posted by Claus Ibsen <cl...@gmail.com>.
Works fine for me check the unit test in camel-spring source code
camel-spring/src/test/resources/org/apache/camel/component/properties/SpringPropertiesComponentEIPConvertBodyToTest.xml


On Fri, Nov 5, 2010 at 11:34 AM, Andreas A. <an...@gmail.com> wrote:
>
> Hi
>
> I'm upgrading to Camel 2.5 and this property is still not being resolved it
> seems, do I need to do something special to make it work?
>
> "The EIP now supports property placeholders in the String based options (a
> few spots in Java DSL where its not possible). For example:
> <convertBodyTo type="String" charset="{{foo.myCharset}}"/>"
>
> My route:
> <choice>
>        <when><simple>${properties:charset.external} != ''</simple>
>                <convertBodyTo type="String" charset="{{charset.external}}" />
>        </when>
>        <otherwise>
>                <convertBodyTo type="String" />
>        </otherwise>
> </choice>
>
> Exception:
> Caused by: java.nio.charset.IllegalCharsetNameException:
> {{charset.external}}
>        at java.nio.charset.Charset.checkName(Charset.java:284)
>        at java.nio.charset.Charset.lookup2(Charset.java:458)
>        at java.nio.charset.Charset.lookup(Charset.java:437)
>        at java.nio.charset.Charset.isSupported(Charset.java:479)
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-5-Propertyplaceholders-and-Spring-DSL-still-not-working-tp3251608p3251608.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/