camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: issue with @UriParam
Date Wed, 22 Jul 2015 16:52:53 GMT
Your setter/getter is now correct java standard naming. It should be
setPassword etc

On Wed, Jul 22, 2015 at 6:30 PM, mayur_bm <mayur.bm@gmail.com> wrote:
> Hi,
> i have built an custom component, whose endpoint implementation is as below:
>
> @UriEndpoint(scheme = "sapper")
> public class PersistenceEndpoint
> extends DefaultEndpoint {
>
>         @UriParam
>         protected String user = "";
>
>         @UriParam
>         protected String password = "";
>
>         public PersistenceEndpoint() {
>                 // TODO Auto-generated constructor stub
>         }
>
>         public PersistenceEndpoint(String uri, PersistenceComponent component) {
>
>                 // TODO Auto-generated constructor stub
>                 super(uri, component);
>         }
>
>         public PersistenceEndpoint(String uri, CamelContext camelContext,
> PersistenceComponent component) {
>                 // TODO Auto-generated constructor stub
>                 super(uri, component);
>
>         }
>
>         @ManagedAttribute(description = "user")
>         public String getuser() {
>                 return user;
>         }
>
>         @ManagedAttribute(description = "user")
>         public void setuser(String user) {
>                 this.user = user;
>         }
>
>         @ManagedAttribute(description = "password")
>         public String getpassword() {
>                 return password;
>         }
>
>         @ManagedAttribute(description = "password")
>         public void setpassword(String password) {
>                 this.password = password;
>         }
>
>         @Override
>         public Producer createProducer()
>         throws Exception {
>                 // TODO Auto-generated method stub
>                 return new PersistenceProducer(this);
>         }
>
>         @Override
>         public Consumer createConsumer(Processor processor)
>         throws Exception {
>                 // TODO Auto-generated method stub
>                 return null;
>         }
>
>         @Override
>         public boolean isSingleton() {
>                 // TODO Auto-generated method stub
>                 return true;
>         }
>
> when i try to call my custome component, iam getting below error:
>
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint:
> sapper://com.test.camel.component.persistence.PersistenceComponent?password=sql&user=DBA
> due to: Failed to resolve endpoint:
> sapper://com.test.camel.component.persistence.PersistenceComponent?password=sql&user=DBA
> due to: There are 2 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=[{password=sql, user=DBA}]
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:547)
> at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:72)
> at
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:202)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
> at
> org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
> at
> org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
> at
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
> at
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:942)
> ... 19 more
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/issue-with-UriParam-tp5769752.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Mime
View raw message