snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

It is not possible to start quarkus application using IDELauncer with quarkus-kubernetes dependency #231

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug I have the quarkus project with such dependency `

io.quarkus
    <artifactId>quarkus-kubernetes</artifactId>
    <version>1.10.3.Final</version>
    <scope>provided</scope>

`

It is started ok using maven cli - mvn compile quarkus:dev but it is failed when I try to run it via @QuarkusMain class with NullPointerException error

Expected behavior Application startup using Main class is successful

Actual behavior Application startup using Main class is failed with follow error `Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.kubernetes.deployment.KnativeProcessor#createDecorators threw an exception: java.lang.NullPointerException at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:76) at io.quarkus.kubernetes.deployment.KnativeProcessor.createDecorators(KnativeProcessor.java:112) 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 io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972) at io.quarkus.builder.BuildContext.run(BuildContext.java:277) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452) at java.base/java.lang.Thread.run(Thread.java:834) at org.jboss.threads.JBossThread.run(JBossThread.java:479)

[error]: Build step io.quarkus.kubernetes.deployment.OpenshiftProcessor#createDecorators threw an exception: java.lang.NullPointerException
at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:76)
at io.quarkus.kubernetes.deployment.OpenshiftProcessor.createDecorators(OpenshiftProcessor.java:129)
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 io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)

[error]: Build step io.quarkus.kubernetes.deployment.VanillaKubernetesProcessor#createDecorators threw an exception: java.lang.NullPointerException
at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:76)
at io.quarkus.kubernetes.deployment.VanillaKubernetesProcessor.createDecorators(VanillaKubernetesProcessor.java:102)
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 io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)

at io.quarkus.builder.Execution.run(Execution.java:116)
at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:148)
at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:252)
... 19 more
Suppressed: java.lang.NullPointerException
    at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:76)
    at io.quarkus.kubernetes.deployment.OpenshiftProcessor.createDecorators(OpenshiftProcessor.java:129)
    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 io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at org.jboss.threads.JBossThread.run(JBossThread.java:479)
Suppressed: java.lang.NullPointerException
    at io.quarkus.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:76)
    at io.quarkus.kubernetes.deployment.VanillaKubernetesProcessor.createDecorators(VanillaKubernetesProcessor.java:102)
    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 io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
    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.kubernetes.deployment.KubernetesCommonHelper.createProject(KubernetesCommonHelper.java:76) at io.quarkus.kubernetes.deployment.KnativeProcessor.createDecorators(KnativeProcessor.java:112) 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 io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972) at io.quarkus.builder.BuildContext.run(BuildContext.java:277) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452) at java.base/java.lang.Thread.run(Thread.java:834) at org.jboss.threads.JBossThread.run(JBossThread.java:479) `

To Reproduce

https://github.com/MDay13/quarkus-lab

Steps to reproduce the behavior:

  1. Clone https://github.com/MDay13/quarkus-lab
  2. Start an app using org.acme.getting.started.Main class
  3. Failed with NPE

Environment (please complete the following information):

Additional context I've done some invistigation about rootcause of this issue and found out that it is related with null value of targetDirectory in QuarkusBootsrap class but it is needed in:

io.quarkus.kubernetes.deployment.KubernetesCommonHelper#createProject(io.quarkus.deployment.builditem.ApplicationInfoBuildItem, java.nio.file.Path) public static Optional<Project> createProject(ApplicationInfoBuildItem app, OutputTargetBuildItem outputTarget, PackageConfig packageConfig) { return createProject(app, outputTarget.getOutputDirectory() .resolve(String.format(OUTPUT_ARTIFACT_FORMAT, outputTarget.getBaseName(), packageConfig.runnerSuffix))); }

Possible root cause might be that there there are no setters for targetDerictory while running using io.quarkus.bootstrap.IDELauncherImpl

I've tried to find any information about it as known issue but had no success.


https://github.com/quarkusio/quarkus/issues/13814


$upstream:13814$