camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gramanero <graman...@gmail.com>
Subject Re: String replacement via Spring
Date Tue, 18 Sep 2012 18:22:13 GMT
Thank you for the response Claus. Cool that this is possible. I have been
trying to work with the Simple language in order to not have to dive into
the other scripting languages. I have had mixed results, none of which have
actually worked yet.

If I just take your example verbatim, then I getting the following error:
/Failed delivery for exchangeId: ID-WMORMANS-63776-1347901580693-114-1.
Exhausted after delivery attempt: 1 caught:
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
invoke method: .replaceAll("foo","bar") on null due to:
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
invoke method: replaceAll("foo","bar") on null due to:
java.util.regex.PatternSyntaxException: Illegal repetition

{"FilePath":"E:\Publishing\NewDataReceived\ReferenceData\Ford","FileName":"TestFile.txt","FileSize":"14"}/

I also tried using the .replace() method, but that throws this error:
/Failed delivery for exchangeId: ID-WMORMANS-63776-1347901580693-116-1.
Exhausted after delivery attempt: 1 caught:
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
invoke method: .replace("foo","bar") on null due to:
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to
invoke method: replace("foo","bar") on null due to:
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
method invocations possible: [public java.lang.String
java.lang.String.replace(java.lang.CharSequence,java.lang.CharSequence),
public java.lang.String java.lang.String.replace(char,char)].
Exchange[Message:
{"FilePath":"E:\Publishing\NewDataReceived\ReferenceData\Ford","FileName":"TestFile.txt","FileSize":"14"}]/

I am guessing that I am hitting some limitations of the Simple language?
Both .replaceAll and .replace seems to work fine when put into a simple Java
program.




--
View this message in context: http://camel.465427.n5.nabble.com/String-replacement-via-Spring-tp5719498p5719540.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message