Hi,
no need to install the Knative Apache Camel Operator in this case.
The example needs to be updated because in 1.2.0 we enforce every source to
be a RoutesBuilder, so if you just extend RoutesBuilder and provide an
empty configure() method it should work again.
There's also a more idiomatic way to run that example using only
property-based configuration without customizers.

Nicola

On Mon, Nov 16, 2020 at 10:23 AM Gerald Kallas <[email protected]>
wrote:

> Hi everybody,
>
> I was digging into the examples and tried to get this one running with
> minio ..
>
> https://github.com/apache/camel-k-examples/tree/master/02-serverless-api
>
> Whilst deployment I'm getting an error
>
> 2020-11-16 09:10:01,876 INFO [org.apa.cam.k.Runtime] (main) Apache Camel K
> Runtime 1.5.0
> 2020-11-16 09:10:01,900 INFO [org.apa.cam.qua.cor.CamelBootstrapRecorder]
> (main) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
> 2020-11-16 09:10:01,990 INFO [org.apa.cam.k.lis.SourcesConfigurer] (main)
> Loading routes from: SourceDefinition{name='API', language='java',
> location='file:/etc/camel/sources/i-source-000/API.java', }
> 2020-11-16 09:10:02,888 INFO [org.apa.cam.k.lis.SourcesConfigurer] (main)
> Loading routes from: SourceDefinition{name='MinioCustomizer',
> language='java',
> location='file:/etc/camel/sources/i-source-001/MinioCustomizer.java', }
> 2020-11-16 09:10:03,135 ERROR [org.apa.cam.qua.mai.CamelMainRuntime]
> (main) Failed to start application: org.apache.camel.RuntimeCamelException:
> java.lang.ClassCastException: class test.MinioCustomizer cannot be cast to
> class org.apache.camel.RoutesBuilder (test.MinioCustomizer is in unnamed
> module of loader org.joor.Compile$ByteArrayClassLoader @5b9396d3;
> org.apache.camel.RoutesBuilder is in unnamed module of loader 'app')
> at
> org.apache.camel.RuntimeCamelException.wrapRuntimeCamelException(RuntimeCamelException.java:51)
> at org.apache.camel.k.support.SourcesSupport.load(SourcesSupport.java:112)
> at
> org.apache.camel.k.support.SourcesSupport.loadSources(SourcesSupport.java:85)
> at
> org.apache.camel.k.listener.SourcesConfigurer.accept(SourcesConfigurer.java:73)
> at
> org.apache.camel.k.listener.AbstractPhaseListener.accept(AbstractPhaseListener.java:32)
> at
> org.apache.camel.k.quarkus.Application$ListenerAdapter.invokeListeners(Application.java:141)
> at
> org.apache.camel.k.quarkus.Application$ListenerAdapter.beforeConfigure(Application.java:103)
> at
> org.apache.camel.main.BaseMainSupport.postProcessCamelContext(BaseMainSupport.java:651)
> at
> org.apache.camel.quarkus.main.CamelMain.initCamelContext(CamelMain.java:97)
> at org.apache.camel.quarkus.main.CamelMain.doInit(CamelMain.java:67)
> at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
> at org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:118)
> 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$boot-173480958.deploy_0(CamelBootstrapProcessor$boot-173480958.zig:101)
> at
> io.quarkus.deployment.steps.CamelBootstrapProcessor$boot-173480958.deploy(CamelBootstrapProcessor$boot-173480958.zig:40)
> at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:752)
> at io.quarkus.runtime.Application.start(Application.java:90)
> at
> io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:91)
> at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
> at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
> at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
> at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
> Caused by: java.lang.ClassCastException: class test.MinioCustomizer cannot
> be cast to class org.apache.camel.RoutesBuilder (test.MinioCustomizer is in
> unnamed module of loader org.joor.Compile$ByteArrayClassLoader @5b9396d3;
> org.apache.camel.RoutesBuilder is in unnamed module of loader 'app')
> at
> org.apache.camel.k.loader.java.JavaSourceLoader.load(JavaSourceLoader.java:51)
> at org.apache.camel.k.support.SourcesSupport.load(SourcesSupport.java:104)
> ... 21 more
>
> Any ideas what might be wrong here?
>
> P.S. I'm using OpenShift 4.5.15 with Kamel K Operator 1.2.0
>
> P.S. #2 With Kamel K Operator .. do I need to install Knative Apache Camel
> Operator as well?
>
> Best
> Gerald

Reply via email to