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

Launching Quarkus Kotlin Gradle App from IDE fails #10123

Closed
ojacquemart opened this issue Jun 19, 2020 · 9 comments
Closed

Launching Quarkus Kotlin Gradle App from IDE fails #10123

ojacquemart opened this issue Jun 19, 2020 · 9 comments
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working
Milestone

Comments

@ojacquemart
Copy link

Describe the bug
Create a fresh app from code.quarkus.io with the 1.5.2 version:

  • build tool: gradle
  • extension: kotlin

Create a main App like:

import io.quarkus.runtime.Quarkus
import io.quarkus.runtime.QuarkusApplication

object App {

    @JvmStatic
    fun main(args: Array<String>) {
        Quarkus.run(Main::class.java, *args)
    }

    class Main : QuarkusApplication {
        @Throws(Exception::class)
        override fun run(vararg args: String): Int {
            println("Do startup logic here")
            Quarkus.waitForExit()
            return 0
        }
    }

}

Expected behavior
The app starts

Actual behavior
The app does not start and gives the following exception:

Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at io.quarkus.launcher.QuarkusLauncher.launch(QuarkusLauncher.java:50)
	at io.quarkus.runtime.Quarkus.launchFromIDE(Quarkus.java:93)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:79)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
	at org.acme.App.main(App.kt:10)
Caused by: java.lang.reflect.InvocationTargetException
	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:564)
	at io.quarkus.launcher.QuarkusLauncher.launch(QuarkusLauncher.java:47)
	... 4 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
	at io.quarkus.bootstrap.IDELauncherImpl.launch(IDELauncherImpl.java:30)
	... 9 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:134)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:84)
	at io.quarkus.bootstrap.IDELauncherImpl.launch(IDELauncherImpl.java:28)
	... 9 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:325)
	at io.quarkus.deployment.dev.IDEDevModeMain.accept(IDEDevModeMain.java:39)
	at io.quarkus.deployment.dev.IDEDevModeMain.accept(IDEDevModeMain.java:15)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:131)
	... 11 more
Caused by: java.lang.NullPointerException
	at io.quarkus.deployment.dev.IsolatedDevModeMain.lambda$setupRuntimeCompilation$0(IsolatedDevModeMain.java:159)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.setupRuntimeCompilation(IsolatedDevModeMain.java:159)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:296)
	... 14 more

To Reproduce
Steps to reproduce the behavior:

  1. generate the app
  2. add a main file
  3. run the main

Environment (please complete the following information):

  • Output of uname -a or ver: windows 10
  • Output of java -version: 14.0.1
  • GraalVM version (if different from Java):
  • Quarkus version or git rev: 1.5.2.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): gradle
@ojacquemart ojacquemart added the kind/bug Something isn't working label Jun 19, 2020
@quarkusbot
Copy link

/cc @quarkusio/devtools

@geoand geoand changed the title Quarkus kotlin Main-App with gradle Launching Quarkus Kotlin Gradle App from IDE fails Jun 19, 2020
@geoand
Copy link
Contributor

geoand commented Jun 19, 2020

I can reproduce this on Gradle. The same application in Maven works

@aloubyansky
Copy link
Member

On master as well @geoand ?

@geoand
Copy link
Contributor

geoand commented Jun 19, 2020

I also tried Java Gradle project and that fails to, so I guess the IDE launcher doesn't work for Gradle?

@geoand
Copy link
Contributor

geoand commented Jun 19, 2020

On master as well @geoand ?

Good question! Let me check

@geoand
Copy link
Contributor

geoand commented Jun 19, 2020

Same thing for master - with a simple Gradle Java project it fails - but I am seeing a different error than OP, most likely because my IDE is trying to launch Gradle or something...

@aloubyansky
Copy link
Member

Ok, thanks, we need Gradle workspace discovery for that. @glefloch is looking into that.

@geoand
Copy link
Contributor

geoand commented Jun 19, 2020

Excellent 👌

@aloubyansky
Copy link
Member

Should be fixed with #10459

@aloubyansky aloubyansky added this to the 1.7.0 - master milestone Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants