-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Webjars broken with Quarkus 3.16 due to an exception in Classgraph #891
Comments
You correctly diagnosed this. To figure out where to find the class path elements in the new classloader, you would have to set a breakpoint at the line that you indicated, and then use the debugger to look at the fields and methods of the classloader. You would then have to change the code in ClassGraph to work with both the old and the new classloader. I don't know anything about Quarkus, so I would appreciate it if you could please put together a pull request for this. Thank you! |
As I am not skilled in Quarkus either, I took the liberty of asking a question in their Discussions: Let's see where that goes. |
The breakage was my doing. This field was internal and not exposed and I needed a more practical way to handle normal priority elements and lesser priority elements, thus why you have two fields now. The I think we could probably expose something that ClassGraph could use, but I'm not entirely sure what we should expose. The notion of Anyway, I'm interested in having a discussion around this to see if we can come up with some sort of SPI that you could consume. |
Have you tried a general solution like: |
Required us to drop webjars-locator and do the extraction manually, on account of the root issue not being easily and quickly fixable: classgraph/classgraph#891
@dmlloyd that won't work in the general case. You would miss some classpath elements, when they don't include a manifest file (it's not required). But it may be helpful to add that as a fallback. Good suggestion. |
@gsmet thanks for the productive reply. Are the in-memory classpath entries openable via URL, Path, or similar? Even starting with the basic on-disk jars would be better than nothing. |
Required us to drop webjars-locator and do the extraction manually, on account of the root issue not being easily and quickly fixable: classgraph/classgraph#891
Other things that might work in different circumstances:
|
Neo4j-OGM falls over on this, too. We like to move forward, and I am gonna suggest a naive fix with #893 for the time being, which I tested with Neo4j-OGM both against Quarkus 3.15.x and 3.16.1 successfully. This would help me and our customers quite a lot. I know it's not a long time solution, but most likely good enough and not worse than before. |
That's right. Yeah, an API on it would be quite helpful, and I'd happily help using it, but cannot answer your question on what to expose with certainty. |
Well, not exactly but... they are generated bytecode and basically a The
So what @michael-simons did in https://github.com/classgraph/classgraph/pull/893/files as a workaround won't be worse than what you have atm. But... keep in mind that the elements we have in memory can be additional classes but can also be classes that override an existing class. Thus you will have a partial and incorrect view of the classpath. Would it be possible for you to also handle I wonder if some sort of |
They should actually be openable by |
@dmlloyd my understanding is that they want to list all the resources/classes available in this class loader, not get a specific one. |
Exactly!
Am 08.11.2024 um 16:08 schrieb Guillaume Smet ***@***.***>:
@dmlloyd <https://github.com/dmlloyd> my understanding is that they want to
list all the resources/classes available in this class loader, not get a
specific one.
—
Reply to this email directly, view it on GitHub
<#891 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEAQLYVBLMBVQMRQWLQWILZ7THWRAVCNFSM6AAAAABRDVFUIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRUHE4TGMRTHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Duly noted, and that will probably be the source of an obscure bug for somebody, far down the line, if in-memory class definitions are not supported by ClassGraph... Unfortunately we'll probably have to just move forward with a best current effort here. |
With the current ClassGraph API, there is always a There's another issue here though, which is that you are exposing individual classes with
So we would need a URL corresponding to an implementation of I don't think it would be hard to write that URL-handler, but I don't have the bandwidth to do it right now. |
I can provide the URL handler, and as it is that time pressing, add it to use any future API… |
This is a follow up on issue classgraph#891 and the preceding PR classgraph#893 and brings two changes: * The `QuarkusClassLoaderHandler` is a bit more explicit now about how the elements returned from the class loader are treated * The `FastPathResolver` can be simplified using only one pattern
This is a follow up on issue classgraph#891 and the preceding PR classgraph#893 and brings two changes: * The `QuarkusClassLoaderHandler` is a bit more explicit now about how the elements returned from the class loader are treated * The `FastPathResolver` can be simplified using only one pattern
@dmlloyd @triceo I am pushing out the updated ClassGraph 4.8.178 now with the fix (which simply includes jars from the two new fields). @michael-simons thank you for your work on the fix! |
In code that worked with Quarkus 3.15, I am now getting the following exception after upgrading to Quarkus 3.16:
The following code in Classgraph seems to trigger the exception:
I'm assuming some behavior of the Quarkus ClassLoader changed in 3.16? I do not know any details about this though.
I attempted manually forcing the latest version of Classgraph (4.8.177), but exception persists.
The text was updated successfully, but these errors were encountered: