You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Imran Raza Khan <im...@gmail.com> on 2017/11/28 00:30:35 UTC

Unknown parameters=[{myConfig=myconfig}] error while creating custom component - CiA-2 - Chapter 8

Hi,

While creating custom component i want to pass one object as
parameter, but i am getting following error

org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route1 at: >>> To[mycomponent://foo?param1=value1&myConfig=myconfig]
<<<  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=[{myConfig=myconfig}]

I extended Apache Camel in Action - Chapter 8 example

MyEndpoint:

public class MyEndpoint extends DefaultEndpoint {

@UriPath @Metadata(required = "true")
private String name;

@UriParam(defaultValue = "10")
private int option = 10;

@UriParam(label = "advanced")
 private MyConfiguration myConfig;

In my Route of springBoot calling like this


 @Bean(name = "myconfig")
    public Configuration getXmlConfiguration() {
            return new MyConfiguration();
    }

    @Override
    public void configure() throws Exception {

        from("timer://foo?fixedRate=true&period=60000")
        .to("mycomponent://foo?param1=value1&myConfig=myconfig")
        .to("log:DEBUG?showBody=true&showHeaders=true")
        .to("mock:result");

    }

I tried with below option too but still same error
mycomponent://foo?param1=value1&myConfig=#myconfig