reflections: After migrating to 0.9.12, Getting exception : org.reflections.RflectionException: Scanner SubTypeScanner was not configured , even after configuring the scanner.
I was using 0.9.11 and with scanners it was working fine. but by just changing the version to 0.9.12 , stared getting the exception for “org.reflections.RflectionException: Scanner SubTypeScanner was not configured”.
Reflections reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage("my.project.prefix"))
.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner()),
.filterInputsBy(new FilterBuilder().includePackage("my.project.prefix"))
);
reflections.getSubTypesOf(someClass); // here it throws exception
I noticed that, when I add a class which extend some class to the package, this error goes. Same with FieldAnnotationScanner , or any other scanner.
To try , please provide an invalid package for reflection creation, you will see all these errors coming even after configuring all scanners with reflection
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 48
- Comments: 25 (2 by maintainers)
Commits related to this issue
- KAFKA-9712: Catch and handle exception thrown by reflections scanner (#8289) This commit works around a bug in version v0.9.12 of the upstream `reflections` library by catching and handling the excep... — committed to apache/kafka by ncliang 4 years ago
- KAFKA-9712: Catch and handle exception thrown by reflections scanner (#8289) This commit works around a bug in version v0.9.12 of the upstream `reflections` library by catching and handling the excep... — committed to apache/kafka by ncliang 4 years ago
- [Issue #38] Revert reflections library to 0.9.11 due to critical bug -- https://github.com/ronmamo/reflections/issues/273 — committed to JetBrains/kotless by deleted user 4 years ago
- Reverted reflections library version to 0.9.11 because of https://github.com/ronmamo/reflections/issues/273 and https://github.com/ronmamo/reflections/issues/277 — committed to jpdigital/hibernate5-ddl-maven-plugin by deleted user 4 years ago
- Downgrade org.reflections to 0.9.11 due to a bug Apparently I'm able to invoke our codepropertygraph's console via a path that triggers https://github.com/ronmamo/reflections/issues/273. This is very... — committed to ShiftLeftSecurity/overflowdb by hubertp 4 years ago
- Downgrade org.reflections to 0.9.11 due to a bug Apparently I'm able to invoke our codepropertygraph's console via a path that triggers https://github.com/ronmamo/reflections/issues/273. This is very... — committed to ShiftLeftSecurity/overflowdb by hubertp 4 years ago
- Downgrade org.reflections to 0.9.11 due to a bug Apparently I'm able to invoke our codepropertygraph's console via a path that triggers https://github.com/ronmamo/reflections/issues/273. This is very... — committed to ShiftLeftSecurity/overflowdb by hubertp 4 years ago
- Replace reflection package with reflections8 Apparently I'm able to invoke our codepropertygraph's console via a path that triggers ronmamo/reflections#273. This is very unfortunate and due to the wa... — committed to ShiftLeftSecurity/overflowdb by hubertp 4 years ago
- Replace reflection package with reflections8 (#162) Apparently I'm able to invoke our codepropertygraph's console via a path that triggers ronmamo/reflections#273. This is very unfortunate and due ... — committed to ShiftLeftSecurity/overflowdb by hubertp 4 years ago
- Don't upgrade reflections https://github.com/ronmamo/reflections/issues/273 — committed to jhipster/jhipster-bom by mraible 3 years ago
- downgrade reflection due to https://github.com/ronmamo/reflections/issues/273 — committed to Tomahawkd/JLightConfig by Tomahawkd 3 years ago
- downgrade reflection due to https://github.com/ronmamo/reflections/issues/273 — committed to Tomahawkd/TLS-Tester by Tomahawkd 3 years ago
- KAFKA-9712: Catch and handle exception thrown by reflections scanner (#8289) This commit works around a bug in version v0.9.12 of the upstream `reflections` library by catching and handling the excep... — committed to andrewegel/kafka by ncliang 4 years ago
- KAFKA-9712: Catch and handle exception thrown by reflections scanner (#8289) This commit works around a bug in version v0.9.12 of the upstream `reflections` library by catching and handling the excep... — committed to confluentinc/kafka by ncliang 4 years ago
- KAFKA-9712: Catch and handle exception thrown by reflections scanner (#8289) This commit works around a bug in version v0.9.12 of the upstream `reflections` library by catching and handling the excep... — committed to confluentinc/kafka by ncliang 4 years ago
- Downgrade reflections due to https://github.com/ronmamo/reflections/issues/273 — committed to imonteroperez/plugin-compat-tester by imonteroperez 3 years ago
- Downgrade to 0.9.10 reflections due to: https://github.com/ronmamo/reflections/issues/273 — committed to imonteroperez/plugin-compat-tester by imonteroperez 3 years ago
- CB-16465 Lazy load safe toString() methods Increment reflections version, as DomainToStringTest was affected by this bug: https://github.com/ronmamo/reflections/issues/273 — committed to hortonworks/cloudbreak by Bajzathd 2 years ago
Guys please be aware that we are on an open source platform and this developer did some free work so you don’t have to do it yourself. I also wait for a fix, but we do not know the circumstances why the developer is currently not as responsive as in the past(maybe he currently does a world trip or has personal issues, how knows).
There are currently 569 forks of this project, maybe someone has already found a fix or you can fork it yourself and investigate it. Or you can try https://github.com/aschoerk/reflections8 as suggested above.
What’s the status here? This is a breaking issue that’s been open for 5-6 months now, and the pr to fix it got closed without an update?
apologize for this inconvenience !
scanner was not configured exception - this is a known issue in 0.9.12, a simple workaround is to check if the
getStore()contains index for the scanner before querying. next version 0.10 fixes this.This is a shame. A library that’s this widely used should at least be handed over to someone else who wants to maintain it
Same issue for
ResourcesScanner(e.g., example from https://github.com/ronmamo/reflections/blob/gh-pages/UseCases.md#find-resources-in-your-classpath)Or
Does not happen with 0.9.11.
fixed on 0.10
This has been broken for over nine months by now… @ronmamo can we get a bugfix release 0.9.13 or is this library considered abandoned?
Any updates? It is really strange that PR with fix of a problem was closed even without a comment.
+1
In 0.9.11, the constructor adds collection of all configured scanners to Store before does scan classes. By contrast, 0.9.12 create collection of all configured scanners only if it does scan something successfully. Personally, the error “was not configured” happening in 0.9.12 is a litter weird since the scanner is indeed “configured”.
Could we keep the behavior of 0.9.11 (pre-create collection for all configured scanners) to fix this issue ?
Seems like there is no maintainer active anymore, might be time to fork this repo and start merging the pull requests that started to pile up with release on maven central.
I ran into the same issue when migrating from JDK8 to JDK11. For me the issue didn’t occur anymore when I removed the configuration builder and just instantiated the Reflections class like below. This way works for me for JDK 8, 11 and 13 and with reflection version 0.9.12.
I’ve faced with the same bug. Migrated to reflections8