Skip to content

Upgrade classgraph #1424

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

Closed
FrelliBB opened this issue Jan 4, 2022 · 4 comments · Fixed by #1423
Closed

Upgrade classgraph #1424

FrelliBB opened this issue Jan 4, 2022 · 4 comments · Fixed by #1423
Labels
enhancement New feature or request

Comments

@FrelliBB
Copy link

FrelliBB commented Jan 4, 2022

Describe the bug

Additional context
I haven't been able to get clear reproduction steps in a standalone project, but within one of our company's microservices, when updating to springdoc-openapi-ui to 1.6.3 we started seeing weird reflection errors on startup of our Spring Boot service that can be traced back to this release.

@youming-lin
Copy link

youming-lin commented Jan 4, 2022

Same, I have issue with starting the Spring Boot app after updating to 1.6.3 with this error:

Caused by: io.github.toolfactory.jvm.Driver$InitializationException: Could not initiliaze DefaultDriver
	at io.github.toolfactory.jvm.DefaultDriver.throwException(DefaultDriver.java:324) ~[jvm-driver-4.0.0.jar:na]
	at io.github.toolfactory.jvm.DefaultDriver.<init>(DefaultDriver.java:121) ~[jvm-driver-4.0.0.jar:na]
	at nonapi.io.github.classgraph.utils.ReflectionUtils.<clinit>(ReflectionUtils.java:48) ~[classgraph-4.8.117.jar:4.8.117]
	... 36 common frames omitted
Caused by: io.github.toolfactory.jvm.ObjectProvider$BuildingException: Unable to build the related object of io.github.toolfactory.jvm.function.catalog.GetDeclaredFieldsMethodHandleSupplier
	at io.github.toolfactory.jvm.ObjectProvider.getOrBuildObject(ObjectProvider.java:57) ~[jvm-driver-4.0.0.jar:na]
	at io.github.toolfactory.jvm.DefaultDriver.initDeclaredFieldsRetriever(DefaultDriver.java:294) ~[jvm-driver-4.0.0.jar:na]
	at io.github.toolfactory.jvm.DefaultDriver.<init>(DefaultDriver.java:105) ~[jvm-driver-4.0.0.jar:na]
	... 37 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
	at io.github.toolfactory.jvm.ObjectProvider.getOrBuildObject(ObjectProvider.java:51) ~[jvm-driver-4.0.0.jar:na]
	... 39 common frames omitted
Caused by: java.lang.NoSuchMethodException: null
	at java.base/java.lang.invoke.PrimitiveHandle.finishMethodInitialization(PrimitiveHandle.java:198) ~[na:na]
	at java.base/java.lang.invoke.DirectHandle.<init>(DirectHandle.java:51) ~[na:na]
	at java.base/java.lang.invoke.DirectHandle.<init>(DirectHandle.java:43) ~[na:na]
	at java.base/java.lang.invoke.MethodHandles$Lookup.findSpecialImpl(MethodHandles.java:619) ~[na:na]
	at java.base/java.lang.invoke.MethodHandles$Lookup.findSpecial(MethodHandles.java:587) ~[na:na]
	at io.github.toolfactory.jvm.function.catalog.GetDeclaredFieldsMethodHandleSupplier$ForJava7.<init>(GetDeclaredFieldsMethodHandleSupplier.java:55) ~[jvm-driver-4.0.0.jar:na]
	... 44 common frames omitted
Caused by: java.lang.NoSuchMethodError: java/lang/Class.getDeclaredFields0(Z)[Ljava/lang/reflect/Field; (loaded from jrt:/java.base by <Bootstrap Loader>) called from class java.lang.Class (loaded from jrt:/java.base by <Bootstrap Loader>).
	at java.base/java.lang.invoke.PrimitiveHandle.lookupMethod(Native Method) ~[na:na]
	at java.base/java.lang.invoke.PrimitiveHandle.finishMethodInitialization(PrimitiveHandle.java:196) ~[na:na]
	... 49 common frames omitted

Based on my Googling there was a similar issue reported in classgraph: classgraph/classgraph#568

I manually overrode classgraph version to their latest, 4.8.138, and the app starts fine.

TL;DR
Can Springdoc update to a good classgraph version ASAP?

Edit:
I see there is a PR already: #1423

@bnasslahsen bnasslahsen changed the title Regression with classgraph-4.8.117 Upgrade classgraph Jan 4, 2022
@bnasslahsen bnasslahsen linked a pull request Jan 4, 2022 that will close this issue
@FrelliBB
Copy link
Author

FrelliBB commented Jan 6, 2022

Thanks for resolving this @bnasslahsen, do you have an indication of when the new version will be released?

@bnasslahsen
Copy link
Collaborator

@FrelliBB,

Today

@FrelliBB
Copy link
Author

FrelliBB commented Jan 6, 2022

Perfect, thank you!

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 9, 2022
@springdoc springdoc locked as resolved and limited conversation to collaborators Feb 5, 2023
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
mpleine pushed a commit to mpleine/springdoc-openapi that referenced this issue May 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants