I have tried to rename it to

CamelRestExample

But the error continues:

2022-03-17 15:53:26,166 INFO  [org.apa.cam.k.Runtime] (main) Apache
Camel K Runtime 1.12.0
2022-03-17 15:53:26,215 INFO
[org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Bootstrap runtime:
org.apache.camel.quarkus.main.CamelMainRuntime
2022-03-17 15:53:26,281 INFO  [org.apa.cam.k.lis.SourcesConfigurer]
(main) Loading routes from: SourceDefinition{name='CamelRestExample',
language='java', type='source',
location='file:/etc/camel/sources/CamelRestExample.java', }
2022-03-17 15:53:30,079 ERROR [org.apa.cam.qua.mai.CamelMainRuntime]
(main) Failed to start application:
java.lang.IllegalArgumentException: Cannot find getter method: service
on bean: class org.apache.camel.main.RestConfigurationProperties when
binding property: service.host
at 
org.apache.camel.support.PropertyBindingSupport.doBuildPropertyOgnlPath(PropertyBindingSupport.java:297)
at 
org.apache.camel.support.PropertyBindingSupport.doBindProperties(PropertyBindingSupport.java:224)
at 
org.apache.camel.support.PropertyBindingSupport.access$100(PropertyBindingSupport.java:100)
at 
org.apache.camel.support.PropertyBindingSupport$Builder.bind(PropertyBindingSupport.java:1835)
at org.apache.camel.main.MainHelper.setPropertiesOnTarget(MainHelper.java:297)
at 
org.apache.camel.main.BaseMainSupport.doConfigureCamelContextFromMainConfiguration(BaseMainSupport.java:815)
at org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:401)
at 
org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:541)
at org.apache.camel.quarkus.main.CamelMain.initCamelContext(CamelMain.java:116)
at org.apache.camel.quarkus.main.CamelMain.doInit(CamelMain.java:86)
at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:137)
at 
org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
at 
org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)

On Thu, Mar 17, 2022 at 11:51 AM Pasquale Congiusti
<pasquale.congiu...@gmail.com> wrote:
>
> Hello,
> try calling your class differently than *CamelRest* (ie, CamelRest2) . I
> think it makes some mess because it conflicts with the component name.
>
> Cheers,
> Pasquale.
>
> On Thu, Mar 17, 2022 at 1:58 PM Roberto Camelk <betonetotbo.cam...@gmail.com>
> wrote:
>
> > I'm trying to run the REST example from here:
> > https://camel.apache.org/manual/rest-dsl.html#_rest_dsl_with_java_dsl
> >
> > This is my final source:
> >
> > //camel-k: dependency=camel-rest
> >
> > import org.apache.camel.builder.RouteBuilder;
> >
> > public class CamelRest extends RouteBuilder {
> >
> >     @Override
> >     public void configure() throws Exception {
> >       rest("/say")
> >         .get("/hello").to("direct:hello")
> >         .get("/bye").consumes("application/json").to("direct:bye")
> >         .post("/bye").to("mock:update");
> >
> >         from("direct:hello")
> >             .transform().constant("Hello World");
> >
> >         from("direct:bye")
> >             .transform().constant("Bye World");
> >     }
> >
> > }
> >
> >
> > But I'm getting this error:
> >
> > 2022-03-17 12:56:39,160 ERROR [org.apa.cam.qua.mai.CamelMainRuntime]
> > (main) Failed to start application:
> > java.lang.IllegalArgumentException: Cannot find getter method: service
> > on bean: class org.apache.camel.main.RestConfigurationProperties when
> > binding property: service.host
> > at
> > org.apache.camel.support.PropertyBindingSupport.doBuildPropertyOgnlPath(PropertyBindingSupport.java:297)
> > at
> > org.apache.camel.support.PropertyBindingSupport.doBindProperties(PropertyBindingSupport.java:224)
> > at
> > org.apache.camel.support.PropertyBindingSupport.access$100(PropertyBindingSupport.java:100)
> > at
> > org.apache.camel.support.PropertyBindingSupport$Builder.bind(PropertyBindingSupport.java:1835)
> > at
> > org.apache.camel.main.MainHelper.setPropertiesOnTarget(MainHelper.java:297)
> > at
> > org.apache.camel.main.BaseMainSupport.doConfigureCamelContextFromMainConfiguration(BaseMainSupport.java:815)
> > at
> > org.apache.camel.main.BaseMainSupport.autoconfigure(BaseMainSupport.java:401)
> > at
> > org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:541)
> > at
> > org.apache.camel.quarkus.main.CamelMain.initCamelContext(CamelMain.java:116)
> > at org.apache.camel.quarkus.main.CamelMain.doInit(CamelMain.java:86)
> > at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> > at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:137)
> > at
> > org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
> > at
> > org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
> > at
> > io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown
> > Source)
> >

Reply via email to