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

Ordering of manifest-only jars on classpath affects class scanning #673

Closed
jdeppe-pivotal opened this issue Apr 9, 2022 · 5 comments
Closed

Comments

@jdeppe-pivotal
Copy link

Hello! I've run into a strange issue related to the ordering of manifest-only jars and the ability to scan for certain packages. (I'm using the latest version of classgraph at this time - 4.8.143).

So, I have 2 manifest only jars. The first, geode-dependencies.jar, contains the following entry:

Class-Path: geode-server-all-1.15.0-build.0.jar

The second, geode-server-all-1.15.0-build.0.jar, contains this:

Class-Path: commons-digester-2.1.jar commons-validator-1.7.jar commons
 -codec-1.15.jar shiro-config-ogdl-1.9.0.jar jna-platform-5.11.0.jar c
 ommons-logging-1.2.jar geode-management-1.15.0-build.0.jar geode-core
 -1.15.0-build.0.jar javax.activation-api-1.2.0.jar javax.resource-api
 -1.7.1.jar LatencyUtils-2.0.3.jar jline-2.12.jar spring-web-5.3.18.ja
 r geode-cq-1.15.0-build.0.jar geode-old-client-support-1.15.0-build.0
 .jar javax.servlet-api-3.1.0.jar 
<snip... many more entries...>

I'm scanning for interfaces in org.springframework.shell. That's somewhat irrelevant, but the jar containing the necessary classes (spring-shell.jar) is referenced correctly in the class-path entry of geode-server-all-1.15.0-build.0.jar.

If either of these jars is on the classpath separately, then scanning works. If both jars are on the classpath and geode-server-all-1.15.0-build.0.jar is first then scanning works. However, if geode-dependencies.jar comes before geode-server-all-1.15.0-build.0.jar, then scanning does NOT work and classes are not found.

All of these jars are stored in the same directory.

I'm attaching 'good' and 'bad' log files. The 'good' one also includes the classes found at the end.

I haven't done any additional debugging, but any hints as to where I might start looking would be appreciated.

Thanks for your time!

scan-good.log
scan-bad.log

@lukehutch
Copy link
Member

Hey @jdeppe-pivotal,

Thanks for this bug report. This is a very useful report, because I think it also explains what was going on with #614.

I'll try to take a look at this in the next few days. I have a thought about what may be going on, but I will need to look more closely.

@lukehutch
Copy link
Member

Fixed in 4.8.144. Thank you for the bug report!

@lukehutch
Copy link
Member

Sorry, actually this is fixed in 4.8.145 (4.8.144 broke Windows compatibility).

@jdeppe-pivotal
Copy link
Author

Thanks again for your super-fast attention to this Luke! I can confirm that it fixes the issue.

@lukehutch
Copy link
Member

Awesome, thank you for confirming! This one was a bit of a doozie to fix, I had to rework a lot of stuff, but it led to significant code improvements.

And you're welcome, I wish the whole open source world would try harder to fix bugs quickly, so I do what I can to be fast, time allowing, at least with the significant bugs...

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

No branches or pull requests

2 participants