quarkus: NPE while live updating quarkus from 2.5.0 to 2.5.1 in RuntimeUpdatesProcessor

Describe the bug

I modified the version property from 2.5.0 to 2.5.1 in my POM while quarkus:dev was running, and to my amazement it started updating the server, only to fail at the end with a NPE:

[ERROR] Port 5005 in use, not starting in debug mode
Debugger failed to attach: handshake failed - connection prematurally closed

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.close()" because "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.INSTANCE" is null
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:151)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.close()" because "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.INSTANCE" is null
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:152)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:105)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:145)
	... 1 more
Caused by: java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.close()" because "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.INSTANCE" is null
	at io.quarkus.deployment.dev.IsolatedDevModeMain.close(IsolatedDevModeMain.java:340)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:477)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:67)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:149)
	... 3 more

Expected behavior

Obviously no NullPointerException and a working upgraded quarkus 2.5.1 😃

Actual behavior

[ERROR] Port 5005 in use, not starting in debug mode
Debugger failed to attach: handshake failed - connection prematurally closed

Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.close()" because "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.INSTANCE" is null
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:151)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.close()" because "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.INSTANCE" is null
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:152)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:105)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:145)
	... 1 more
Caused by: java.lang.NullPointerException: Cannot invoke "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.close()" because "io.quarkus.deployment.dev.RuntimeUpdatesProcessor.INSTANCE" is null
	at io.quarkus.deployment.dev.IsolatedDevModeMain.close(IsolatedDevModeMain.java:340)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:477)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:67)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:149)
	... 3 more

How to Reproduce?

  1. Start a 2.5.0 quick start project with mvn quarkus:dev
  2. Modify the POM to upgrade to 2.5.1
  3. Wait for it…
  4. 💥

Output of uname -a or ver

Linux fedora 5.15.6-100.fc34.x86_64 #1 SMP Wed Dec 1 13:41:51 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version “17.0.1” 2021-10-19 OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12) OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.0 and 2.5.1

Build tool (ie. output of mvnw --version or gradlew --version)

openjdk version “17.0.1” 2021-10-19 OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12) OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Maybe we can at least throw an ISE with a good error message instead of a NPE. I assume that’s what @aloubyansky meant in his comment above

No, we don’t guarantee it working across versions. Basically, if you upgrade, you should rebuild the app. I actually saw this NPE in a branch I am working on, so I’ll fix the NPE, at least.