Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make camel-management a camel-quarkus extension. #1564

Closed
Jeansen opened this issue Aug 21, 2020 · 18 comments · Fixed by #1744
Closed

make camel-management a camel-quarkus extension. #1564

Jeansen opened this issue Aug 21, 2020 · 18 comments · Fixed by #1744
Assignees
Milestone

Comments

@Jeansen
Copy link
Contributor

Jeansen commented Aug 21, 2020

In a plain and simple Maven/Camel 3 project, I can - with a dependency of camel-management - easily use hawtio and jolokai to monitor or debug Camel routes. I've tried the same with a simple Quarkus project, but there is no extension for camel-management, yet.

If there are no other ways to access/monitor Camel routs via jolokai and hawtio (that I do not know of, yet), then I'd be happy to see camel-management as an extension, too.

@jamesnetherton
Copy link
Contributor

I gave an answer to a similar request here:

hawtio/hawtio#2643 (comment)

Not sure if we want to have a dedicated camel-management extension as the JMX bits can only work in the normal JVM mode and not natively. @lburgazzoli WDYT?

@Jeansen
Copy link
Contributor Author

Jeansen commented Aug 24, 2020

Well, even if it is only a solution for the JVM mode, I think during development it is quite helpful to have something like hawtio be accessible. Later on, in native mode, I do not think it is that relevant. But even if we could get the routs visualizations to work in native mode, it would - IMHO - be better, than nothing.

@davsclaus
Copy link
Contributor

I think its a good idea, we should add in its documentation that native mode is not supported as JMX itself is not supported there. So some extensions would be JVM mode only (there is also camel-jmx etc).

We do have today a way in the catalog to mark the extension as JVM only.

@lburgazzoli
Copy link
Contributor

I don't think having an extension for camel-management would be a huge issue however I'd like to know more about the use case especially as it seems the main use case here seems to be relate to dev experience.

In general I don't think traditional monitoring solution based on jmx are the right thing for camel-quarkus as the target is the cloud and containerized workload and exposing jmx is IMHO not the best.

In my spare time I'm working with a colleague to see if we can have a standardized (under MicroProfile or SmallRye) way of exposing a similar experience but via plain REST endpoints (similar to the spring-boot actuators) so you can easily control who has access to what using the same technology you'd use to protect any REST endpoint.

jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Sep 8, 2020
jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Sep 8, 2020
jamesnetherton added a commit to jamesnetherton/camel-quarkus that referenced this issue Sep 8, 2020
jamesnetherton added a commit that referenced this issue Sep 8, 2020
@jamesnetherton jamesnetherton added this to the 1.1.0 milestone Sep 9, 2020
@Jeansen
Copy link
Contributor Author

Jeansen commented Sep 16, 2020

@jamesnetherton Looks like there is a regeression, or I am doing something wrong.

I've created a simple Quarkus-Projekt in IntelliJ. Actually, IntelliJ creates this for you, so there is no special setup from my side. When creating the project, I also added the the 'camel-core' dependency. Then I tested the project without any problem. But as soon as I add the following maven dependency

        <dependency>
            <groupId>org.apache.camel.quarkus</groupId>
            <artifactId>camel-quarkus-management</artifactId>
            <version>1.1.0</version>
        </dependency>

I get hits on the next execution:

/home/marcel/.sdkman/candidates/java/12.0.2-open/bin/java -javaagent:/home/marcel/opt/ideaIU/lib/idea_rt.jar=41467:/home/marcel/opt/ideaIU/bin -Dfile.encoding=UTF-8 -classpath /tmp/demo2/target/classes:/home/marcel/.m2/repository/io/quarkus/quarkus-resteasy/1.7.3.Final/quarkus-resteasy-1.7.3.Final.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-vertx-http/1.7.3.Final/quarkus-vertx-http-1.7.3.Final.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-security-runtime-spi/1.7.3.Final/quarkus-security-runtime-spi-1.7.3.Final.jar:/home/marcel/.m2/repository/io/quarkus/security/quarkus-security/1.1.2.Final/quarkus-security-1.1.2.Final.jar:/home/marcel/.m2/repository/io/smallrye/reactive/mutiny/0.7.0/mutiny-0.7.0.jar:/home/marcel/.m2/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar:/home/marcel/.m2/repository/jakarta/enterprise/jakarta.enterprise.cdi-api/2.0.2/jakarta.enterprise.cdi-api-2.0.2.jar:/home/marcel/.m2/repository/jakarta/el/jakarta.el-api/3.0.3/jakarta.el-api-3.0.3.jar:/home/marcel/.m2/repository/jakarta/interceptor/jakarta.interceptor-api/1.2.5/jakarta.interceptor-api-1.2.5.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-vertx-core/1.7.3.Final/quarkus-vertx-core-1.7.3.Final.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-netty/1.7.3.Final/quarkus-netty-1.7.3.Final.jar:/home/marcel/.m2/repository/io/netty/netty-codec/4.1.49.Final/netty-codec-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-handler/4.1.49.Final/netty-handler-4.1.49.Final.jar:/home/marcel/.m2/repository/io/vertx/vertx-core/3.9.2/vertx-core-3.9.2.jar:/home/marcel/.m2/repository/io/netty/netty-common/4.1.49.Final/netty-common-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-buffer/4.1.49.Final/netty-buffer-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-transport/4.1.49.Final/netty-transport-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-handler-proxy/4.1.49.Final/netty-handler-proxy-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-codec-socks/4.1.49.Final/netty-codec-socks-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-codec-http/4.1.49.Final/netty-codec-http-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-codec-http2/4.1.49.Final/netty-codec-http2-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-resolver/4.1.49.Final/netty-resolver-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-resolver-dns/4.1.49.Final/netty-resolver-dns-4.1.49.Final.jar:/home/marcel/.m2/repository/io/netty/netty-codec-dns/4.1.49.Final/netty-codec-dns-4.1.49.Final.jar:/home/marcel/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.2/jackson-core-2.11.2.jar:/home/marcel/.m2/repository/io/vertx/vertx-web/3.9.2/vertx-web-3.9.2.jar:/home/marcel/.m2/repository/io/vertx/vertx-web-common/3.9.2/vertx-web-common-3.9.2.jar:/home/marcel/.m2/repository/io/vertx/vertx-auth-common/3.9.2/vertx-auth-common-3.9.2.jar:/home/marcel/.m2/repository/io/vertx/vertx-bridge-common/3.9.2/vertx-bridge-common-3.9.2.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-resteasy-server-common/1.7.3.Final/quarkus-resteasy-server-common-1.7.3.Final.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-resteasy-common/1.7.3.Final/quarkus-resteasy-common-1.7.3.Final.jar:/home/marcel/.m2/repository/org/jboss/resteasy/resteasy-core/4.5.6.Final/resteasy-core-4.5.6.Final.jar:/home/marcel/.m2/repository/org/jboss/spec/javax/ws/rs/jboss-jaxrs-api_2.1_spec/2.0.1.Final/jboss-jaxrs-api_2.1_spec-2.0.1.Final.jar:/home/marcel/.m2/repository/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec/2.0.0.Final/jboss-jaxb-api_2.3_spec-2.0.0.Final.jar:/home/marcel/.m2/repository/org/jboss/resteasy/resteasy-core-spi/4.5.6.Final/resteasy-core-spi-4.5.6.Final.jar:/home/marcel/.m2/repository/com/ibm/async/asyncutil/0.1.0/asyncutil-0.1.0.jar:/home/marcel/.m2/repository/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar:/home/marcel/.m2/repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-core/1.7.3.Final/quarkus-core-1.7.3.Final.jar:/home/marcel/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/home/marcel/.m2/repository/jakarta/inject/jakarta.inject-api/1.0/jakarta.inject-api-1.0.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-ide-launcher/1.7.3.Final/quarkus-ide-launcher-1.7.3.Final.jar:/home/marcel/.m2/repository/io/smallrye/config/smallrye-config/1.8.5/smallrye-config-1.8.5.jar:/home/marcel/.m2/repository/io/smallrye/common/smallrye-common-annotation/1.1.0/smallrye-common-annotation-1.1.0.jar:/home/marcel/.m2/repository/io/smallrye/config/smallrye-config-common/1.8.5/smallrye-config-common-1.8.5.jar:/home/marcel/.m2/repository/io/smallrye/common/smallrye-common-expression/1.1.0/smallrye-common-expression-1.1.0.jar:/home/marcel/.m2/repository/io/smallrye/common/smallrye-common-function/1.1.0/smallrye-common-function-1.1.0.jar:/home/marcel/.m2/repository/io/smallrye/common/smallrye-common-constraint/1.1.0/smallrye-common-constraint-1.1.0.jar:/home/marcel/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar:/home/marcel/.m2/repository/org/jboss/logmanager/jboss-logmanager-embedded/1.0.4/jboss-logmanager-embedded-1.0.4.jar:/home/marcel/.m2/repository/org/jboss/logging/jboss-logging-annotations/2.1.0.Final/jboss-logging-annotations-2.1.0.Final.jar:/home/marcel/.m2/repository/org/jboss/threads/jboss-threads/3.1.1.Final/jboss-threads-3.1.1.Final.jar:/home/marcel/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:/home/marcel/.m2/repository/org/jboss/slf4j/slf4j-jboss-logging/1.2.0.Final/slf4j-jboss-logging-1.2.0.Final.jar:/home/marcel/.m2/repository/org/graalvm/sdk/graal-sdk/20.1.0/graal-sdk-20.1.0.jar:/home/marcel/.m2/repository/org/wildfly/common/wildfly-common/1.5.4.Final-format-001/wildfly-common-1.5.4.Final-format-001.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-bootstrap-runner/1.7.3.Final/quarkus-bootstrap-runner-1.7.3.Final.jar:/home/marcel/.m2/repository/org/apache/camel/quarkus/camel-quarkus-core/1.0.0/camel-quarkus-core-1.0.0.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-arc/1.7.3.Final/quarkus-arc-1.7.3.Final.jar:/home/marcel/.m2/repository/io/quarkus/arc/arc/1.7.3.Final/arc-1.7.3.Final.jar:/home/marcel/.m2/repository/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar:/home/marcel/.m2/repository/org/eclipse/microprofile/context-propagation/microprofile-context-propagation-api/1.0.1/microprofile-context-propagation-api-1.0.1.jar:/home/marcel/.m2/repository/org/apache/camel/quarkus/camel-quarkus-support-common/1.0.0/camel-quarkus-support-common-1.0.0.jar:/home/marcel/.m2/repository/io/quarkus/quarkus-development-mode-spi/1.7.3.Final/quarkus-development-mode-spi-1.7.3.Final.jar:/home/marcel/.m2/repository/org/apache/camel/camel-core-engine/3.4.2/camel-core-engine-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-api/3.4.2/camel-api-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-management-api/3.4.2/camel-management-api-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-support/3.4.2/camel-support-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-util/3.4.2/camel-util-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-base/3.4.2/camel-base-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-core-languages/3.4.2/camel-core-languages-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-endpointdsl/3.4.2/camel-endpointdsl-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-componentdsl/3.4.2/camel-componentdsl-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-core-catalog/3.4.2/camel-core-catalog-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-tooling-model/3.4.2/camel-tooling-model-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-util-json/3.4.2/camel-util-json-3.4.2.jar:/home/marcel/.m2/repository/org/apache/camel/camel-microprofile-config/3.4.2/camel-microprofile-config-3.4.2.jar:/home/marcel/.m2/repository/org/eclipse/microprofile/config/microprofile-config-api/1.4/microprofile-config-api-1.4.jar com.example.Main
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2020-09-16 09:54:46,445 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (Quarkus Main Thread) bootstrap runtime: org.apache.camel.quarkus.core.CamelContextRuntime
2020-09-16 09:54:46,512 INFO  [org.apa.cam.man.JmxManagementStrategy] (Quarkus Main Thread) JMX is enabled
2020-09-16 09:54:46,554 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.2 (camel-1) is starting
2020-09-16 09:54:46,555 ERROR [io.qua.application] (Quarkus Main Thread) Failed to start application (with profile dev): java.lang.AbstractMethodError: Receiver class org.apache.camel.management.JmxManagementLifecycleStrategy does not define or inherit an implementation of the resolved method abstract onContextStart(Lorg/apache/camel/CamelContext;)V of interface org.apache.camel.spi.LifecycleStrategy.
	at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2728)
	at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2657)
	at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2620)
	at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
	at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2452)
	at org.apache.camel.quarkus.core.CamelContextRuntime.start(CamelContextRuntime.java:57)
	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:708)
	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 com.example.Main.main(Main.java:9)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at io.quarkus.runner.bootstrap.StartupActionImpl$3.run(StartupActionImpl.java:145)
	at java.base/java.lang.Thread.run(Thread.java:835)

2020-09-16 09:54:46,557 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.2 (camel-1) is shutting down
2020-09-16 09:54:46,562 WARN  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Error occurred while stopping lifecycle strategies. This exception will be ignored.: java.lang.AbstractMethodError: Receiver class org.apache.camel.management.JmxManagementLifecycleStrategy does not define or inherit an implementation of the resolved method abstract onContextStop(Lorg/apache/camel/CamelContext;)V of interface org.apache.camel.spi.LifecycleStrategy.
	at org.apache.camel.impl.engine.AbstractCamelContext.doStop(AbstractCamelContext.java:2909)
	at org.apache.camel.support.service.BaseService.stop(BaseService.java:155)
	at org.apache.camel.quarkus.core.CamelContextRuntime.stop(CamelContextRuntime.java:62)
	at org.apache.camel.quarkus.core.CamelBootstrapRecorder$1.run(CamelBootstrapRecorder.java:33)
	at io.quarkus.runtime.StartupContext.runAllInReverseOrder(StartupContext.java:83)
	at io.quarkus.runtime.StartupContext.close(StartupContext.java:72)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:786)
	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 com.example.Main.main(Main.java:9)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at io.quarkus.runner.bootstrap.StartupActionImpl$3.run(StartupActionImpl.java:145)
	at java.base/java.lang.Thread.run(Thread.java:835)

2020-09-16 09:54:46,570 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.2 (camel-1) uptime 0.015 seconds
2020-09-16 09:54:46,571 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (Quarkus Main Thread) Apache Camel 3.4.2 (camel-1) is shutdown in 0.014 seconds
Quarkus application exited with code 1
Press Enter to restart or Ctrl + C to quit
2020-09-16 09:54:46,870 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start hot replacement endpoint to recover from previous Quarkus startup failure


@davsclaus
Copy link
Contributor

You need Camel 3.5.0 for that latest release of camel-quarkus

@ppalaga
Copy link
Contributor

ppalaga commented Sep 16, 2020

        <dependency>
            <groupId>org.apache.camel.quarkus</groupId>
            <artifactId>camel-quarkus-management</artifactId>
            <version>1.1.0</version>
        </dependency>

I guess you are mixing camel-quarkus-management 1.1.0 with an older camel quarkus artifacts.

Not sure what exactly IJ generates for you, but since yesterday, you can import io.quarkus:quarkus-universe-bom:1.8.0.Final that manages also camel-quarkus-management so you can have the dep without version

        <dependency>
            <groupId>org.apache.camel.quarkus</groupId>
            <artifactId>camel-quarkus-management</artifactId>
        </dependency>

@Jeansen
Copy link
Contributor Author

Jeansen commented Sep 16, 2020

My bad. It was still set to quarkus 1.7.3. With 1.8.0 it now works. Side note: Even with explicit versions for the core and management dependencies, it does not work. But it looks fine now with the dummy project.

@Jeansen
Copy link
Contributor Author

Jeansen commented Sep 16, 2020

OK, great. I've had success in running Quarkus with jolokia in JVM mode and see the generated graph of a route with hawtio. Thank you @jamesnetherton

@Jeansen
Copy link
Contributor Author

Jeansen commented Jan 27, 2021

Hm..something changed. When I run my dummy project with camel-managment, it works fine. With quarkus (using camel-quarkus-managment), I can see a route, but hawtio does not allow me to open up the details. There is no route diagram, though the tab is visible in hawtio. When on the 'operations' tab and executing 'dumpRouteAsXML', I get:

java.lang.IllegalArgumentException: Type is not a ModelToXMLDumper implementation. Found: org.apache.camel.xml.jaxb.JaxbModelToXMLDumper
	at org.apache.camel.impl.engine.BaseServiceResolver.resolve(BaseServiceResolver.java:61)
	at org.apache.camel.impl.engine.SimpleCamelContext.createModelToXMLDumper(SimpleCamelContext.java:417)
	at org.apache.camel.impl.engine.AbstractCamelContext.getModelToXMLDumper(AbstractCamelContext.java:4194)
	at org.apache.camel.management.mbean.ManagedRoute.dumpRouteAsXml(ManagedRoute.java:359)
	at org.apache.camel.management.mbean.ManagedRoute.dumpRouteAsXml(ManagedRoute.java:345)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at jdk.internal.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at java.base/sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260)
	at java.management/javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1173)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.management/javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1167)
	at java.management/javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1014)
	at org.apache.camel.support.management.MixinRequiredModelMBean.invoke(MixinRequiredModelMBean.java:72)
	at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
	at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.jolokia.handler.ExecHandler.doHandleRequest(ExecHandler.java:98)
	at org.jolokia.handler.ExecHandler.doHandleRequest(ExecHandler.java:40)
	at org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:89)
	at org.jolokia.backend.MBeanServerExecutorLocal.handleRequest(MBeanServerExecutorLocal.java:109)
	at org.jolokia.backend.MBeanServerHandler.dispatchRequest(MBeanServerHandler.java:161)
	at org.jolokia.backend.LocalRequestDispatcher.dispatchRequest(LocalRequestDispatcher.java:99)
	at org.jolokia.backend.BackendManager.callRequestDispatcher(BackendManager.java:428)
	at org.jolokia.backend.BackendManager.handleRequest(BackendManager.java:158)
	at org.jolokia.http.HttpRequestHandler.executeRequest(HttpRequestHandler.java:197)
	at org.jolokia.http.HttpRequestHandler.handlePostRequest(HttpRequestHandler.java:137)
	at org.jolokia.jvmagent.handler.JolokiaHttpHandler.executePostRequest(JolokiaHttpHandler.java:290)
	at org.jolokia.jvmagent.handler.JolokiaHttpHandler.doHandle(JolokiaHttpHandler.java:236)
	at org.jolokia.jvmagent.handler.JolokiaHttpHandler.handle(JolokiaHttpHandler.java:178)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
	at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:80)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:692)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:664)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:835)

@jamesnetherton
Copy link
Contributor

Which camel-quarkus version is this?

Seems to be working ok for me if I invoke dumpRouteAsXml from JConsole.

@Jeansen
Copy link
Contributor Author

Jeansen commented Jan 27, 2021

I've uploaded the mini project here: https://github.com/Jeansen/quarkus-camel-dummy. I run it as follows: In IntelliJ with JVM arguments -javaagent:/home/marcel/projects/demo/lib/jolokia-jvm-1.6.2-agent.jar=host=0.0.0.0 and in Addition hawtio beforehand with java -jar hawtio-app-2.12.1.jar --port 8090

@jamesnetherton If you have time and would have a look, I'd very much appreciate it ;-)

@jamesnetherton
Copy link
Contributor

I've not tried to run your app yet. But I see from the pom.xml that you are mixing different Camel & Quarkus versions.

Set quarkus-plugin.version to 1.11.0.Final. Also remove the version override on the camel-management dependency.

That should clean up the classpath and hopefully make things work.

@Jeansen
Copy link
Contributor Author

Jeansen commented Jan 27, 2021

Yes, you are right but that should not harm because I run the code directly from within the IDE. I've removed the override and set the version uniformly to 1.11.Final. I've tried different versions, from 1.8 up. But the effect is the same.

@jamesnetherton
Copy link
Contributor

Works fine for me in IntelliJ and from the command line. I can only assume that the app classpath in your IDE needs updating.

Also, you don't really need class MainApp. In class Main you can simplify things and just do:

@QuarkusMain
public class Main {
    public static void main(String... args) {
        Quarkus.run(CamelMainApplication.class, args);
    }
}

Your RouteBuilder will be auto discovered.

@Jeansen
Copy link
Contributor Author

Jeansen commented Jan 27, 2021

Mhm...bummer. Running the compiled jar via cli works! No I've got to find out what the heck is broken in my IDE ... Thanks for your effort @jamesnetherton . And thank you for the hint above ;-)

@Jeansen
Copy link
Contributor Author

Jeansen commented Jan 27, 2021

@jamesnetherton may I ask how you run it from the IDE? I simply cannot get it to work from within the IDE. Building it and running it from the cli out of the target folder works. But running it as a Java Application always only works half (as described above). Running it as a quarkus application (with the quarkus plugin) does not work for me. Then I do not even see the camel routs at all in hawtio.

@jamesnetherton
Copy link
Contributor

I just run right click and select 'Run' on the Main class in the source tree. That generates the run configuration which I then edit to add the javaagent args for Hawtio. Then relaunch the application and add a connection in Hawtio for http://localhost:8778/jolokia.

If you're using IntelliJ, one thing to try is right click on the pom.xml and do: Maven -> Reload Project. That should ensure the dependency tree is up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants