Exception thrown when configuring MicrometerPlugin
See original GitHub issueActual behavior (the bug)
An exception is thrown when using MicrometerPlugin
:
Exception in thread "main" kotlin.KotlinNullPointerException
at io.javalin.core.JavalinServer.server(JavalinServer.kt:32)
at io.javalin.plugin.metrics.MicrometerPlugin.apply(MicrometerPlugin.kt:16)
at io.javalin.core.JavalinConfig.lambda$applyUserConfig$5(JavalinConfig.java:192)
at java.util.HashMap$Values.forEach(HashMap.java:980)
at io.javalin.core.JavalinConfig.applyUserConfig(JavalinConfig.java:192)
at io.javalin.Javalin.create(Javalin.java:85)
at net.selfdotlearn.javalin.App.main(App.java:10)
Expected behavior No exception, Javalin to start successfully.
To Reproduce
public static void main(String[] args) {
Javalin app = Javalin.create(config -> {
config.registerPlugin(new MicrometerPlugin());
});
app.get("/", ctx -> ctx.result("Hello World"));
app.start(8080);
}
See the following for a full example exhibiting the behaviour: https://github.com/jon-ruckwood/javalin-micrometer-example
Additional context Dependencies:
io.javalin:javalin:3.0.0
org.slf4j:slf4j-simple:1.7.25
io.micrometer:micrometer-core:1.1.4
Java version:
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)
Let me know if you need anything else.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Exception thrown when configuring MicrometerPlugin #628
Actual behavior (the bug) An exception is thrown when using MicrometerPlugin : ; Expected behavior. No exception, Javalin to start successfully.
Read more >javalin-io/general - Gitter
If I understood correctly, I'm supposed to throw exceptions in my Handlers (before/wsBefore methods) to stop further execution of that request.
Read more >Archive - v3 documentation - Javalin - A lightweight Java and ...
All handlers (before, endpoint, after) can throw Exception (and any subclass of Exception ) The app.exception() method gives you a way of handling...
Read more >Monitor a Java application | Observability Guide [master] | Elastic
After restarting Filebeat and your Javalin app, trigger an exception, and you will see a long stack trace in the message field of...
Read more >java - Heeding exceptions thrown when setting Spring Boot ...
I noticed that my Spring Boot (1.3.2) application continues to execute when an essential configuration property cannot be parsed.
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 FreeTop 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
Top GitHub Comments
Sure, I was thinking it should be fixed in
server()
though:Thanks guys!