NPE seen during quarkus-smallrye-metrics-deployment build
See original GitHub issueDescribe the bug An NPE is seen during the build.
Expected behavior No NPE?
To Reproduce Steps to reproduce the behavior:
- Check out rev
ed9b0e9006dab1d1c11b1f17ecea928134cb4365
- Clean install
- View NPE in output
Output
[INFO] Running io.quarkus.smallrye.metrics.deployment.DevModeMetricsTest
2020-02-06 10:17:21,864 INFO [io.quarkus] (main) Quarkus 999-SNAPSHOT started in 5.021s. Listening on: http://0.0.0.0:8080
2020-02-06 10:17:21,870 INFO [io.quarkus] (main) Profile dev activated. Live Coding activated.
2020-02-06 10:17:21,871 INFO [io.quarkus] (main) Installed features: [cdi, resteasy, resteasy-jackson, smallrye-metrics]
2020-02-06 10:17:25,329 INFO [io.qua.dev] (vert.x-worker-thread-6) Changed source files detected, recompiling [/home/david/src/java/quarkus/extensions/smallrye-metrics/deployment/target/quarkus-dev-mode-test5445764335796190851/src/main/java/io/quarkus/smallrye/metrics/deployment/DevModeMetricsTest.java]
2020-02-06 10:17:27,528 INFO [io.quarkus] (vert.x-worker-thread-6) Quarkus stopped in 0.116s
2020-02-06 10:17:28,831 INFO [io.quarkus] (vert.x-worker-thread-6) Quarkus 999-SNAPSHOT started in 0.176s. Listening on: http://0.0.0.0:8080
2020-02-06 10:17:28,831 INFO [io.quarkus] (vert.x-worker-thread-6) Profile dev activated. Live Coding activated.
2020-02-06 10:17:28,832 INFO [io.quarkus] (vert.x-worker-thread-6) Installed features: [cdi, resteasy, resteasy-jackson, smallrye-metrics]
2020-02-06 10:17:28,832 INFO [io.qua.dev] (vert.x-worker-thread-6) Hot replace total time: 3.505s
2020-02-06 10:17:29,027 INFO [io.qua.dev] (vert.x-worker-thread-13) Changed source files detected, recompiling [/home/david/src/java/quarkus/extensions/smallrye-metrics/deployment/target/quarkus-dev-mode-test5445764335796190851/src/main/java/io/quarkus/smallrye/metrics/deployment/DevModeMetricsTest.java]
2020-02-06 10:17:29,936 INFO [io.quarkus] (vert.x-worker-thread-13) Quarkus stopped in 0.001s
2020-02-06 10:17:31,011 INFO [io.quarkus] (vert.x-worker-thread-13) Quarkus 999-SNAPSHOT started in 0.167s. Listening on: http://0.0.0.0:8080
2020-02-06 10:17:31,012 INFO [io.quarkus] (vert.x-worker-thread-13) Profile dev activated. Live Coding activated.
2020-02-06 10:17:31,012 INFO [io.quarkus] (vert.x-worker-thread-13) Installed features: [cdi, resteasy, resteasy-jackson, smallrye-metrics]
2020-02-06 10:17:31,013 INFO [io.qua.dev] (vert.x-worker-thread-13) Hot replace total time: 1.987s
2020-02-06 10:17:31,031 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-30) HTTP Request to /getvalue/mycounter2 failed, error id: 97821a10-5781-4249-97e0-acce22c9369d-1: org.jboss.resteasy.spi.UnhandledException: java.lang.NullPointerException
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:209)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:252)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:153)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:363)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:156)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:238)
at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:120)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.access$000(VertxRequestHandler.java:36)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:85)
at io.quarkus.runtime.CleanableExecutor$CleaningRunnable.run(CleanableExecutor.java:224)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2027)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1551)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1442)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Caused by: java.lang.NullPointerException
at io.quarkus.smallrye.metrics.deployment.DevModeMetricsTest$MetricsResource.getCounterValue(DevModeMetricsTest.java:43)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:151)
at org.jboss.resteasy.core.MethodInjectorImpl.lambda$invoke$3(MethodInjectorImpl.java:122)
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:143)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:122)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:594)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:468)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:421)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:363)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:423)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:391)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invoke$1(ResourceMethodInvoker.java:365)
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:143)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:365)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:477)
... 20 more
2020-02-06 10:17:31,089 INFO [io.quarkus] (main) Quarkus stopped in 0.001s
Environment (please complete the following information):
- Output of
uname -a
orver
:Linux 5.2.14-200.fc30.aarch64 #1 SMP Tue Sep 10 12:02:39 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
- Output of
java -version
:
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07)
OpenJDK 64-Bit Server VM GraalVM CE 19.3.1 (build 11.0.6+9-jvmci-19.3-b07, mixed mode)
- Quarkus version or git rev: master (
ed9b0e9006dab1d1c11b1f17ecea928134cb4365
)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Smallrye Metrics - Quarkus
SmallRye Metrics allows applications to gather metrics and statistics that provide insights into what is happening inside an application. The metrics can be ......
Read more >NPE Building with fast-jar · Issue #9788 · quarkusio/quarkus · GitHub
A project which builds fine without this option throws a NPE when using it: --- quarkus-maven-plugin:1.5.0.Final:build (default) @ jg-ukheshe-deployable ...
Read more >Collecting metrics in your Quarkus applications
Learn how to collect metrics in Quarkus using Micrometer and Prometheus. ... Log in to the Red Hat Customer Portal to download Red...
Read more >Quarkus can not load @ApplicationScope in common module
When I try to create a repository into the common module the other modules can not load them. I am getting: [error]: Build...
Read more >Quarkus - Browse /2.13.1.Final at SourceForge.net
Major changes. #28320 - Deprecate SmallRye OpenTracing and SmallRye Metrics. Complete changelog. #28382 - Incorporate quickstart changes in ...
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
Thanks for that one, it made my day 😃.
I don’t think it’s a bad idea to have a negative test, but an NPE is always a bug. There should probably be a “proper” check and an informative exception.