question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Scanner FieldAnnotationsScanner was not configured

See original GitHub issue

Looks like in the new version of Kotless a bug has been introduced in relation with the reflection capabilities.

With a simple code like:

import io.kotless.dsl.lang.http.Get

@Get("/hello")
fun sayHello() = "Say Hello!"

When the endpoint is hit the following exception is thrown:

org.reflections.ReflectionsException: Scanner FieldAnnotationsScanner was not configured
        at org.reflections.Store.get(Store.java:39)
        at org.reflections.Store.get(Store.java:61)
        at org.reflections.Store.get(Store.java:46)
        at org.reflections.Reflections.getFieldsAnnotatedWith(Reflections.java:546)
        at io.kotless.dsl.reflection.ReflectionScanner.fieldsWithAnnotation(ReflectionScanner.kt:43)
        at io.kotless.local.handler.StaticHandler$fields$2.invoke(StaticHandler.kt:38)
        at io.kotless.local.handler.StaticHandler$fields$2.invoke(StaticHandler.kt:14)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at io.kotless.local.handler.StaticHandler.getFields(StaticHandler.kt)
        at io.kotless.local.handler.StaticHandler.handle(StaticHandler.kt:19)
        at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:501)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
        at java.base/java.lang.Thread.run(Thread.java:832)

Going back to version 0.1.3 solves the problem (using diverse versions of Kotlin: 1.3.61 and 1.3.72)

Note: The problem is reproducible in local

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
TanVDcommented, Jun 2, 2020

Fix released with version 0.1.5

0reactions
TanVDcommented, Jun 2, 2020

Yep, actual culprit is update to reflections:0.9.12 – https://github.com/ronmamo/reflections/issues/273 . For now I’ll revert this update, but will consider move to another library

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scanner TypeAnnotationsScanner was not configured, when ...
I have a class which uses org.reflections.Reflections to get annotations in classes in the class path. When i use it in the same...
Read more >
A Guide to the Reflections Library - Baeldung
In the event that no scanner is configured, the library uses TypeAnnotationsScanner and SubTypesScanner as the default ones.
Read more >
org.reflections.scanners.TypeAnnotationsScanner Java Exaples
This page shows Java code examples of org.reflections.scanners. ... assertNotNull("no resourceSearchPackage configured", resourceSearchPackages); ...
Read more >
Scanner SubTypesScanner was not configured - Google Groups
Is it a bug in Classpath.getReflections() or the way I invoked getTypesAnnotatedWith improperly? Thanks for your help. Guofeng.
Read more >
org.reflections.scanners.MethodAnnotationsScanner.<init ...
ReflectionScanStatic.getReflection(...) · new FieldAnnotationsScanner() · new MethodAnnotationsScanner() · new MethodParameterScanner()).setUrls(urlTotals));.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found