quarkus: Potential NPE in QuarkusClassLoader
I am trying to run a Quarkus app in a local container and use remote development mode and I’m facing the same error:
backend | 2022-09-20 14:56:35,633 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (vert.x-worker-thread-1) Failed to start quarkus: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "io.quarkus.bootstrap.classloading.ClassPathResource.getUrl()" because "res" is null
backend | at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
backend | at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:265)
backend | at io.quarkus.runner.bootstrap.AugmentActionImpl.reloadExistingApplication(AugmentActionImpl.java:60)
backend | at io.quarkus.deployment.dev.IsolatedDevModeMain.restartApp(IsolatedDevModeMain.java:251)
backend | at io.quarkus.deployment.dev.IsolatedDevModeMain.restartCallback(IsolatedDevModeMain.java:234)
backend | at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:536)
backend | at io.quarkus.deployment.dev.RuntimeUpdatesProcessor.doScan(RuntimeUpdatesProcessor.java:436)
backend | at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$4.handle(VertxHttpHotReplacementSetup.java:152)
backend | at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$4.handle(VertxHttpHotReplacementSetup.java:139)
backend | at io.vertx.core.impl.ContextBase.lambda$null$0(ContextBase.java:137)
backend | at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
backend | at io.vertx.core.impl.ContextBase.lambda$executeBlocking$1(ContextBase.java:135)
backend | at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
backend | at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
backend | at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
backend | at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
backend | at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
backend | at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
backend | at java.base/java.lang.Thread.run(Thread.java:833)
backend | Caused by: java.lang.NullPointerException: Cannot invoke "io.quarkus.bootstrap.classloading.ClassPathResource.getUrl()" because "res" is null
backend | at io.quarkus.bootstrap.classloading.QuarkusClassLoader.getResources(QuarkusClassLoader.java:250)
backend | at io.quarkus.bootstrap.classloading.QuarkusClassLoader.getResources(QuarkusClassLoader.java:265)
backend | at io.quarkus.bootstrap.classloading.QuarkusClassLoader.getResources(QuarkusClassLoader.java:197)
backend | at io.smallrye.common.classloader.ClassPathUtils.consumeAsPaths(ClassPathUtils.java:84)
backend | at io.smallrye.config.AbstractLocationConfigSourceLoader.tryClassPath(AbstractLocationConfigSourceLoader.java:128)
backend | at io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:93)
backend | at io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:76)
backend | at io.quarkus.runtime.configuration.ApplicationPropertiesConfigSourceLoader$InClassPath.getConfigSources(ApplicationPropertiesConfigSourceLoader.java:30)
backend | at io.quarkus.runtime.configuration.ApplicationPropertiesConfigSourceLoader$InClassPath.getConfigSources(ApplicationPropertiesConfigSourceLoader.java:27)
backend | at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:439)
backend | at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:179)
backend | at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:105)
backend | at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:328)
backend | ... 18 more
I am not using any database migration tool. Could it be related?
_Originally posted by @y-luis in https://github.com/quarkusio/quarkus/issues/25256#issuecomment-1252562974_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (11 by maintainers)
Commits related to this issue
- Prevent potential NPEs in QuarkusClassLoader - Fixes #28098 — committed to gastaldi/quarkus by gastaldi 2 years ago
- Prevent potential NPEs in QuarkusClassLoader - Fixes #28098 — committed to gastaldi/quarkus by gastaldi 2 years ago
- Prevent potential NPEs in QuarkusClassLoader - Fixes #28098 — committed to gastaldi/quarkus by gastaldi 2 years ago
Excellent, here is the branch https://github.com/aloubyansky/quarkus/tree/remote-dev-delete-files-after-app-closed
git clone git@github.com:aloubyansky/quarkus.git quarkus-remote-dev-fixcd quarkus-remote-dev-fixgit checkout remote-dev-delete-files-after-app-closedmvn -Dquickly(this will install the999-SNAPSHOTversion of Quarkus into your local Maven repo)quarkus.versionorquarkus.platform.versionto999-SNAPSHOTand make sure the groupId of thequarkus-bomimported in your project isio.quarkusand notio.quarkus.platformThen build the app, the image and launch the remote-dev the way you were launching. Let us know whether it helped or changed the behavior in some way. Thanks a lot!