Download https://github.com/quarkusio/quarkus-quickstarts/tree/master/getting-started
run via
mvn compile quarkus:dev
throws
java.lang.NoClassDefFoundError: org/jboss/logging/Logger
on Windows10 with both Java8 and Java11:
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: D:\Development\Maven\bin..
Java version: 11.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.2
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
sames happens with the tutorial, which generates the same example
exception:
Listening for transport dt_socket at address: 5005
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger
at io.quarkus.dev.DevModeMain.
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 1 more
[INFO] ------------------------------------------------------------------------
also weird is that it seems quarkus starts without problems for the unittests
Duplicate of #541?
Maybe - but there is still no solution?!
Can you please explain how to integrate https://github.com/quarkusio/quarkus/pull/1391 or please fix the example itself.
You need to build Quarkus from source, or else wait for next week's release (we're doing them every two weeks for the time being).
did it - it's still >not< fixed
[INFO] --- quarkus-maven-plugin:999-SNAPSHOT:dev (default-cli) @ getting-started ---
[INFO] Using servlet resources C:\Users\tandraschko\Downloads\getting-started\src\main\resources\META-INF\resources
Listening for transport dt_socket at address: 5005
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Logger
at io.quarkus.dev.DevModeMain.(DevModeMain.java:39)
Caused by: java.lang.ClassNotFoundException: org.jboss.logging.Logger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
Do you have a reproducer?
Please check my description, i just used the samples in your repo or generated from your guide
Is there by any chance a space in the path you're building in? If so, could you see if building in a path with no spaces in it succeeds?
It's without spaces: C:\Users\tandraschko\Downloads\getting-started\
I can confirm the exact same problem, without spaces as well.
The fix for #1436 might solve this as well though, because it might be a general URI quoting problem. Have you both tried the latest upstream? Alternatively you could wait for the 0.12.0 release, due next week most likely.
I'm building right now the project from upstream but it might take a long time. Is there any easier technique to get the upstream jar?
The easiest trick is: mvn clean install -DskipTests -Dno-native - takes about 2 minutes :)
Thanks! I think the build was fine. All the jars were installed in my ~/.m2 folder in 999-SNAPSHOT version so that was taken care of!
I replaced the version in the line <quarkus.version>999-SNAPSHOT</quarkus.version> in the getting-started project pom.
However, when I'm building the project using mvn compile quarkus:dev I get the following error: Error: Could not find or load main class io.quarkus.dev.DevModeMain.
I'm pretty sure it has something to do with my install. I tracked down which jar contains the DevNodeMain class, it's the jar quarkus-development-mode, I checked and it was properly installed in my ~/m2. I don't know why it's not properly linked during the quarkus:dev goal though.
I'ld be happy to check if the fix is working for windows and report it here if I can fix this error! Any help appreciated.
I'm going to reopen this until we can get someone with a Windows system to reproduce the problem.
I'm willing to try again; no problem for me; i'm just missing something once I installed the sources from upstream.
We need more info about which JDK is installed, maven installed, etc. I am running this on a windows 10 machine and I don't see this error.
starksm@DESKTOP-D8936F6 MINGW64 ~/Protean/quarkus-quickstarts/getting-started (master)
$ mvn compile quarkus:dev
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.acme:quarkus-quickstart >---------------------
[INFO] Building quarkus-quickstart 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ quarkus-quickstart ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ quarkus-quickstart ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- quarkus-maven-plugin:0.11.0:dev (default-cli) @ quarkus-quickstart ---
[INFO] Using servlet resources C:\Users\starksm\Protean\quarkus-quickstarts\getting-started\src\main\resources\META-INF\resources
Listening for transport dt_socket at address: 5005
2019-03-18 15:53:39,032 INFO [io.qua.dep.QuarkusAugmentor] (main) Beginning quarkus augmentation
2019-03-18 15:53:39,657 INFO [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 625ms
2019-03-18 15:53:40,798 INFO [io.quarkus] (main) Quarkus 0.11.0 started in 1.923s. Listening on: http://127.0.0.1:8080
2019-03-18 15:53:40,798 INFO [io.quarkus] (main) Installed features: [cdi, resteasy]
C:\Users\starksm\Protean\quarkus-quickstarts>PATH
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Python27;C:\Users\starksm\.dnx\bin;%M2_HOME%\bin;C:\WINDOWS\System32\OpenSSH\;C:\Users\starksm\AppData\Local\Microsoft\WindowsApps;;C:\Users\starksm\apache-maven-3.6.0\bin
C:\Users\starksm\Protean\quarkus-quickstarts>mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T11:41:47-07:00)
Maven home: C:\Users\starksm\apache-maven-3.6.0\bin\..
Java version: 1.8.0_144, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_144\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
So,
I pulled the sources from upstream and installed them in the same 999-SNAPSHOT version.
I'm able to compile & run using mvn compile and mvn install.
Unfortunately I still get the same issue:
$ mvn compile quarkus:dev
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------< org.acme:quarkus-quickstart >---------------------
[INFO] Building quarkus-quickstart 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ quarkus-quickstart ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ quarkus-quickstart ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- quarkus-maven-plugin:999-SNAPSHOT:dev (default-cli) @ quarkus-quickstart ---
[INFO] Using javaTool: C:\Program Files\Java\jdk1.8.0_121\jre\bin\java.EXE
[INFO] Using servlet resources C:\project\quarkus-hello-world\quarkus-quickstarts\getting-started\src\main\resources\META-INF\resources
Listening for transport dt_socket at address: 5005
Error: Could not find or load main class io.quarkus.dev.DevModeMain
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.365 s
[INFO] Finished at: 2019-03-19T19:48:00+01:00
[INFO] ------------------------------------------------------------------------
My config is the following:
$ echo $PATH
/c/Users/Alexandre Fruchaud/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Alexandre Fruchaud/bin:/c/ProgramData/DockerDesktop/version-bin:/c/Program Files/Docker/Docker/Resources/bin:/c/Users/Alexandre Fruchaud/Documents/Tools/micronaut-1.0.4/bin:/c/SoftwareAG101/CommandCentral/client/bin:/cmd:/c/Users/Alexandre Fruchaud/AppData/Roaming/npm:/c/Users/Alexandre Fruchaud/Documents/Tools/atlassian-cli-8.0.0:/c/Users/Alexandre Fruchaud/scoop/apps/gradle/4.10.2/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Users/Alexandre Fruchaud/Documents/Tools/apache-ant-1.10.2/bin:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files (x86)/Intel/iCLS Client:/c/Users/Alexandre Fruchaud/groovy-2.4.13/bin:/c/Users/Alexandre Fruchaud/Documents/RandD/Clojure/lein:/c/Users/Alexandre Fruchaud/Documents/Tools/apache-maven-3.6.0/bin:/c/ProgramData/Oracle/Java/javapath:/c/Program Files/Intel/iCLS Client:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files/OpenVPN/bin:/c/Program Files (x86)/Microsoft SQL Server/110/Tools/Binn:/c/Program Files/Microsoft SQL Server/110/Tools/Binn:/c/Program Files/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/Client SDK/ODBC/130/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/140/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/140/Tools/Binn/ManagementStudio:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/130/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/DTS/Binn:/c/Program Files/MySQL/MySQL Utilities 1.6:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/c/Program Files/nodejs:/c/WINDOWS/System32/OpenSSH:/c/Program Files/Intel/WiFi/bin:/c/Program Files/Common Files/Intel/WirelessCommon:/c/Program Files/PuTTY:/c/Users/Alexandre Fruchaud/scoop/shims:/c/SoftwareAGCCE/CommandCentral/client/bin:/c/Users/Alexandre Fruchaud/AppData/Local/Google/Cloud SDK/google-cloud-sdk/bin:/c/Users/Alexandre Fruchaud/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/Alexandre Fruchaud/AppData/Local/hyper/app-2.1.2/resources/bin:/usr/bin/vendor_perl:/usr/bin/core_perl
$ mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: C:\Users\Alexandre Fruchaud\Documents\Tools\apache-maven-3.6.0
Java version: 1.8.0_121, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_121\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Quickstart project pom.xml:
<properties>
<quarkus.version>999-SNAPSHOT</quarkus.version>
<surefire-plugin.version>2.22.0</surefire-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Thanks, I'll look at reproducing this setup on my windows 10 box.
Thanks, @starksm64.
OK I did the exact same manipulation on Linux and I don't get the Error: Could not find or load main class io.quarkus.dev.DevModeMain. Everything is working as intended.
I ran mvn -X quarkus:dev > logs.txt for both the windows getting started project and the linux getting started project (results are here: (logs.txt) (windows),
logs_linux.txt (linux)) and I didn't find anything different that was noticeable besides the java version. I upped the windows java version to match my linux java version (1.8.0_191) but it didn't correct this problem.
I'm not too familiar with maven plugins and I'm not sure how to debug things further. Surely there's a logger I can turn to trace to see why quarkus-development-mode is not included in the classpath during the plugin execution.
Thanks for the log as it added more info on what your environment is. So the problem was not the jdk version or being in a path with spaces, nor maven being in a path with spaces, but the fact that the .m2/repository for the local artifacts was in a path with spaces is the problem as when I made that change to my environment I see the issuer:
[DEBUG] findJavaTool, selected JVM: C:\Program Files\Java\jdk1.8.0_121\jre\bin\java.EXE
[INFO] Using javaTool: C:\Program Files\Java\jdk1.8.0_121\jre\bin\java.EXE
[INFO] Using servlet resources C:\Users\starksm\Alexandre Fruchaud\quarkus-quickstarts\getting-started\src\main\resources\META-INF\resources
Listening for transport dt_socket at address: 5005
Error: Could not find or load main class io.quarkus.dev.DevModeMain
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.847 s
[INFO] Finished at: 2019-03-19T16:07:27-07:00
[INFO] ------------------------------------------------------------------------
starksm@DESKTOP-D8936F6 MINGW64 ~/Alexandre Fruchaud/quarkus-quickstarts/getting-started (master)
So we are not building the classpath correctly for windows in the DevMovo forked vm, and so the io.quarkus.dev.DevModeMain is not found.
A workaround is to move the .m2/repository contents to a location without spaces in the path. You can set the location that maven uses for its local repository using an ~/.m2/settings.xml like the following which is what I used to move my local repo to a path with spaces to test that:
$ cat ~/.m2/settings.xml
<settings>
<localRepository>C:/Users/starksm/Alexandre Fruchaud/.m2/repository</localRepository>
</settings>
The DevMovo plugin should be reporting more information about the forked vm command when in debug mode as well to help with troubleshooting so I'll add that when I fix the classpath issue.
Can confirm this happens in a Win10 environment, also that the settings.xml workaround fixes it for the moment.
The classpath error @starksm64 mentioned also turns out to crash the application if the project folder itself is placed under a path that contains spaces (which is a little bit more annoying, since Quarkus logger was eating up the error messages and showing a nice "build success" without starting anything..).
@mohr23 dev mode logging should now not be swallowed, see #1375. Further improvements are coming in #1393
Alright, I can confirm once I moved the repository to a spaceless path by configuring ~/.m2/settings.xml, everything is working as it should on Windows 10. I'll try again once this is fixed to confirm the fix.
Thanks again @starksm64 for your analysis.
Hey @johnaohara , thanks for the heads up, I'll keep an eye out for the fix.
I added a dev discussion on this here:
https://groups.google.com/forum/#!topic/quarkus-dev/R2SkJQ9WtZg
It does apply to all platforms, not just windows.
Most helpful comment
Thanks for the log as it added more info on what your environment is. So the problem was not the jdk version or being in a path with spaces, nor maven being in a path with spaces, but the fact that the .m2/repository for the local artifacts was in a path with spaces is the problem as when I made that change to my environment I see the issuer:
So we are not building the classpath correctly for windows in the DevMovo forked vm, and so the io.quarkus.dev.DevModeMain is not found.
A workaround is to move the .m2/repository contents to a location without spaces in the path. You can set the location that maven uses for its local repository using an ~/.m2/settings.xml like the following which is what I used to move my local repo to a path with spaces to test that:
The DevMovo plugin should be reporting more information about the forked vm command when in debug mode as well to help with troubleshooting so I'll add that when I fix the classpath issue.