Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MDay13 opened this issue Dec 10, 2020 · 1 comment · Fixed by #13819
Assignees
Labels
area/kubernetes env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@MDay13
Copy link

MDay13 commented Dec 10, 2020

Describe the bug
I have the quarkus project with such dependency
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-kubernetes</artifactId> <version>1.10.3.Final</version> <scope>provided</scope> </dependency>

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):

  • Output of uname -a or ver: Microsoft Windows [Version 10.0.18363.1256]
  • Output of java -version: open-jdk-11.0.2
  • Quarkus version or git rev: 1.10.3.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Maven 3.6.3

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.

@MDay13 MDay13 added the kind/bug Something isn't working label Dec 10, 2020
@ghost ghost added area/kubernetes env/windows Impacts Windows machines labels Dec 10, 2020
@ghost
Copy link

ghost commented Dec 10, 2020

/cc @geoand

@geoand geoand self-assigned this Dec 10, 2020
geoand added a commit to geoand/quarkus that referenced this issue Dec 10, 2020
geoand added a commit to geoand/quarkus that referenced this issue Dec 11, 2020
geoand added a commit to geoand/quarkus that referenced this issue Dec 11, 2020
gastaldi added a commit that referenced this issue Dec 11, 2020
Set targetDirectory when launching from IDE
@ghost ghost added this to the 1.11 - master milestone Dec 11, 2020
@gsmet gsmet modified the milestones: 1.11 - master, 1.10.4.Final Dec 14, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue Dec 14, 2020
cemnura pushed a commit to cemnura/quarkus that referenced this issue Dec 22, 2020
renegrob pushed a commit to renegrob/quarkus that referenced this issue Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants