Issues with getMethodsAnnotatedWith()
See original GitHub issueIf you create reflections with Reflections reflections = new Reflections("prefix here")
then you cant use reflections.getMethodsAnnotatedWith()
as it gives a ReflectionsException
.
org.reflections.ReflectionsException: Scanner MethodAnnotationsScanner was not configured
at org.reflections.Store.get(Store.java:39) ~[reflections-0.9.12.jar:?]
at org.reflections.Store.get(Store.java:61) ~[reflections-0.9.12.jar:?]
at org.reflections.Store.get(Store.java:46) ~[reflections-0.9.12.jar:?]
at org.reflections.Reflections.getMethodsAnnotatedWith(Reflections.java:478) ~[reflections-0.9.12.jar:?]
Currently my solution is as follows:
Reflections reflections = new Reflections(new ConfigurationBuilder()
.setUrls(ClasspathHelper.forPackage("prefix here"))
.setScanners(new MethodAnnotationsScanner()));
Is this intended behavior or is this a bug?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
getMethodsAnnotatedWith doesn't work in Production Context ...
Hi there, I have a problem with the ReflectionService (Flow 4.3.3). ... the annotation but only getMethodsAnnotatedWith() doesn't work!?
Read more >java - Is there a more efficient way to get an annotated method?
There's a Reflections#getMethodsAnnotatedWith() which suits your functional requirement. Here's an SSCCE, just copy'n'paste'n'run it.
Read more >ScanningStepsFactory.java - What is JBehave?
* An {@link InjectableStepsFactory} that scans for classes in the classpath. * The constructors allows the specification of the package names to scan...
Read more >Java – more efficient way to get an annotated method – iTecNote
There's a Reflections#getMethodsAnnotatedWith() which suits your functional requirement. Here's an SSCCE, just copy'n'paste'n'run it.
Read more >Bountysource
Issues with getMethodsAnnotatedWith () ... Posted by. See More. View in. SOLVE ISSUE. Overview; Backers (); Updates. Backers, Amount, Date. Updates.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
also @ljacqu thanks for your continuous contributions 🙏 feel free to reach out, your comments are valuable
fixed in 0.10