-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Skipping invalid classpath element jar:file:path/to/example.jar!/ #625
Comments
details on project's issue page classgraph/classgraph#625
@edeso Thanks for the report. Can you please try again with the latest version of ClassGraph in git? I need to see what the underlying exception is that is triggering this |
here you go. you can probably debug/simulate it easily utilizing something like
|
I didn't try to reproduce this previously because you said it only happens with your custom classloader, not with I just checked in an additional layer of exception logging. Can you please generate the log one more time with the latest version? |
And/or can you please upload a minimal reproducer project? |
I just committed a possible fix, but I have no way to test this without being able to reproduce the issue, so this is all guesswork... |
actually stripping isn't a proper solution, as the url might contain a path/file entry within the jar e.g.
from https://docs.oracle.com/javase/8/docs/api/java/net/JarURLConnection.html here's a quick test that verbosely shows the issue against one of your test jars
|
also i seem to recall the proper way to parse jar:file: urls is to actually open a connection and work with the resulting JarUrlConnection, something like this |
Sorry for the delay, I have been traveling with very little downtime. ClassGraph doesn't use JarUrlConnection or anything similar to that, because the underlying Java I will try to run your testcase in the next few days once I can make more time -- thanks for providing that! |
yeah, the mentioning of
reading as the zip root of yetanother.jar, which is located in baz.jar under '/COM/foo/', which in turn is located on 'http://www.foo.com/bar/' . aren't Jar-Urls fun ;) |
Hi, I checked the example code you linked (thank you for providing this). The call However, this call also fails for an input URL of I fixed this by trying Fixed and released in 4.8.141. Thank you for this bug report, and for your patience! |
hmm, little brute force for my taste, but your project, your style. also, be aware. you actually the whole archive (root dir) to the index, but the url might be as well thanks! |
we are using a custom classloader based on UrlClassLoader and for some reason in the past we needed to add jar urls in the format of
this works fine with UrlClassLoader, but ClassGraph stumbles over it with an error (see below). but actually there is no reason, as the notation is fine and simply adds 'file root inside of jar X' to the classpath. also Classgraph has no issue to filter the ClassPathElement but then refuses to scan the same later.
ClassGraph().verbose().scan() log shortened
The text was updated successfully, but these errors were encountered: