Fix QuarkusClassLoaderHandler on Quarkus 2.7.#642
Conversation
In Quarkus 2.7, the class loader stopped returning `JarClassPathElement` or `DirectoryClassPathElement` entries. Instead, some implementation of `ClassPathElement` is returned. This change tries to access it's `getRoot` method, returning a `java.nio.file.Path` pointing to the root of the element, as supported with class graph. The behaviour has been verified on Quarkus 2.6 and Quarkus 2.7.
|
Do you need anything more / help from me? |
| } else { | ||
| Object rootPath = ReflectionUtils.invokeMethod(false, element, "getRoot"); | ||
| if (rootPath instanceof Path) { | ||
| classpathOrder.addClasspathEntry(ReflectionUtils.invokeMethod(false, element, "getRoot"), |
There was a problem hiding this comment.
I'll merge this, but why did you invoke this method twice? Why not just use the value of rootPath?
There was a problem hiding this comment.
Ooops. That was an oversight. You fixed this, didn't you? Thank you for that!
No, sorry, I have just been traveling for the last 3 weeks, with very limited time... Merging this now -- thank you for the contribution! |
|
@michael-simons I had a bunch of other bugfixes I wanted to get in before the next release, but since I'm finding very little time while traveling, and since this seems like an urgent bug for your team, I will push a release out now. Should be fixed in 4.8.139. Thanks for the patch! |
In Quarkus 2.7, the class loader stopped returning
JarClassPathElementor
DirectoryClassPathElemententries. Instead, some implementation ofClassPathElementis returned. This change tries to access it'sgetRootmethod, returning ajava.nio.file.Pathpointing to the rootof the element, as supported with class graph.
The behaviour has been verified on Quarkus 2.6 and Quarkus 2.7.
This is a fix for #641, thanks @lukehutch in advance for considering this input. It would help Neo4j a lot.