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

chore(jolokia): upgrade to Jolokia 1.7.1 #2665

Merged
merged 3 commits into from
Oct 15, 2021

Conversation

tadayosi
Copy link
Member

@tadayosi tadayosi commented Oct 1, 2021

Release Note

Jolokia is upgraded to 1.7.1

Copy link
Member

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad we can remove that hack :)

@astefanutti
Copy link
Member

@tadayosi it seems there is an exception thrown for some reasons during the Jolokia trait e2e test execution:

Exception in thread "jolokia-0" java.lang.NoSuchMethodError: 'org.jolokia.shaded.org.json.simple.JSONObject org.jolokia.http.HttpRequestHandler.handleThrowable(java.lang.Throwable)'
 	at org.jolokia.jvmagent.handler.JolokiaHttpHandler.doHandle(JolokiaHttpHandler.java:245)
	at org.jolokia.jvmagent.handler.JolokiaHttpHandler.handle(JolokiaHttpHandler.java:180)
	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:717)
 	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:77)
 	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:689)
	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:829)

@tadayosi
Copy link
Member Author

tadayosi commented Oct 1, 2021

Yes, I'm looking into it.

@tadayosi
Copy link
Member Author

tadayosi commented Oct 6, 2021

Does anyone have any ideas about the exception? Currently I find it hard to detect where it comes from.

Exception in thread "jolokia-0" java.lang.NoSuchMethodError: 'org.jolokia.shaded.org.json.simple.JSONObject org.jolokia.http.HttpRequestHandler.handleThrowable(java.lang.Throwable)'

This exception doesn't occur when you attach the jolokia agent to a Java app locally, and it doesn't even in a container image with adoptopenjdk/openjdk11:slim. So it appears to be related to the way Camel K assembles the classpath for an integration app.

@tadayosi
Copy link
Member Author

tadayosi commented Oct 6, 2021

And indeed if I copy the entire app & dependencies from a deployed pod on k8s and run it locally, it reproduces the exception.

@astefanutti
Copy link
Member

Would you be aware of any changes introduced between Jolokia 1.7.0 and 1.7.1 that could relate to that exception?

@tadayosi
Copy link
Member Author

tadayosi commented Oct 6, 2021

@astefanutti The main changes in 1.7.1 is this simple commit:
jolokia/jolokia@bde11f8
but this seems to have introduced some unsolicited dependencies (i.e. com.googlecode.json-simple:json-simple) to its pom:
https://repo1.maven.org/maven2/org/jolokia/jolokia-jvm/1.7.1/jolokia-jvm-1.7.1.pom
I'll compare it with the dependencies set from the working Jolokia 1.7.0 deployment.

@astefanutti
Copy link
Member

@tadayosi right, it's possible having the duplicated classes from the shading and the POM, causes the issue.

@tadayosi
Copy link
Member Author

tadayosi commented Oct 7, 2021

Indeed Jolokia 1.7.1 pom brings com.googlecode.json-simple:json-simple and org.jolokia:jolokia-core to the classpath of the pod. Removing them manually makes it run fine locally. Let's see what's the best way to exclude them.

@tadayosi
Copy link
Member Author

tadayosi commented Oct 7, 2021

Created PR apache/camel-k-runtime#742 to include jolokia-jvm to camel-catalog so that the issue is fixed.

We need to wait for a new camel-k-runtime release to merge this one.

@tadayosi tadayosi merged commit f9dfc67 into apache:main Oct 15, 2021
@nicolaferraro nicolaferraro mentioned this pull request Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants