我在属性文件中有一个密码
com.password=$&m
它被插入到 sftp 骆驼路由中{{com.password}},我得到了"Unknown parameters=[{m=}]"
& 被错误地解释。我尝试了一些方法,但在文档中找不到任何内容。我该怎么做才能让它逐字使用密码?
编辑:
<cm:property-placeholder id="blueprint.placeholder" persistent-id="com.props" >
</cm:property-placeholder>
路线:
<camel:route id="uploadqueue">
<camel:from uri="file://{{com.dir}}/?antInclude=*.xml&delay=10000&move=processed/${file:name}&moveFailed=error/${file:name}" />
<camel:to uri="log:input?showAll=true&level=INFO"/>
<camel:to uri="sftp://192.168.0.1/?username={{com.user}}&password={{com.password}}" />
</camel:route>
编辑:现在路线:
<camel:to uri="sftp://192.168.0.1/?username={{com.user}}&password=RAW({{com.password}})" />
堆栈跟踪。出于保密原因略有编辑,但基本上就是这样。$&m 的密码被解释为 $ 的 HTML (%24),即密码,& 作为语义与符号,m 作为新参数。即 RAW() 什么也没做。
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: sftp://192.168.0.1/?password=%24&m=&username=USERNAME due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{m=}]
at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:215) ~[?:?]
at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:139) ~[?:?]
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:711) ~[?:?]
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80) ~[?:?]
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:219) ~[?:?]
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:115) ~[?:?]
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:121) ~[?:?]
慕虎7371278
相关分类