Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

It is being inserted into an sftp camel route with {{com.password}} and I'm getting "Unknown parameters=[{m=}]"

& is being interpreted incorrectly. I've tried a few things, and can't find anything in the docs. What do I do to make it use the password verbatim?

EDIT:

<cm:property-placeholder id="blueprint.placeholder" persistent-id="com.props" >
</cm:property-placeholder>

ROUTE:

<camel:route id="uploadqueue">  
    <camel:from uri="file://{{com.dir}}/?antInclude=*.xml&amp;delay=10000&amp;move=processed/${file:name}&amp;moveFailed=error/${file:name}" />
    <camel:to uri="log:input?showAll=true&amp;level=INFO"/>
    <camel:to uri="sftp://192.168.0.1/?username={{com.user}}&amp;password={{com.password}}" />
</camel:route>

EDIT: Route now:

 <camel:to uri="sftp://192.168.0.1/?username={{com.user}}&amp;password=RAW({{com.password}})" />

Stacktrace. Slightly edited for confidentiality, but basically this. Password of $&m is interpreted as the HTML (%24) for $, as the password, & as the semantic ampersand, and m as a new parameter. i.e. RAW() did nothing.

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) ~[?:?]
    at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:62) ~[?:?]
    at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:56) ~[?:?]
    at org.apache.camel.model.ProcessorDefinition.makeProcessorImpl(ProcessorDefinition.java:562) ~[?:?]
    at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:523) ~[?:?]
    at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:239) ~[?:?]
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1300) ~[?:?]
    ... 26 more
                Could you please add your route definition as well?  Remember to remove sensitive information like credentials, IP Addresses etc.
– ShellDragon
                Oct 10, 2019 at 13:30
                try this <camel:to uri="sftp://192.168.0.1/?username={{com.user}}&amp;password=RAW({{com.password}})"
– pvpkiran
                Oct 10, 2019 at 13:41
                Checkout this part of the docs and use RAW(). If that doesn't work, please post the stacktrace too.
– ShellDragon
                Oct 10, 2019 at 13:47
                I see it in the stacktrace! How about changing config file to com.password=RAW($&m) and revert change on the route?
– ShellDragon
                Oct 10, 2019 at 14:10
                Ok, my bad.  It did work.  I just had the password twice, because the actual route had a redeliveryPolicy bit with the password again.
– djb
                Oct 10, 2019 at 14:09
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.