moditect / layrry

A Runner and API for Layered Java Applications
Apache License 2.0
335 stars 33 forks source link

org.moditect.layrry.example.links.test.LayrryLinksTest.canAddPluginToEmptyPluginsDirectory fails with ClassNotFoundException #80

Open karianna opened 3 years ago

karianna commented 3 years ago

[INFO] --- maven-surefire-plugin:3.0.0-M4:test (default-test) @ layrry-links-runner --- [INFO] [INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running org.moditect.layrry.example.links.test.LayrryLinksTest [ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 2.349 s <<< FAILURE! - in org.moditect.layrry.example.links.test.LayrryLinksTest [ERROR] org.moditect.layrry.example.links.test.LayrryLinksTest.canAddPluginToEmptyPluginsDirectory Time elapsed: 2.041 s <<< ERROR! java.lang.IllegalArgumentException: java.lang.reflect.InvocationTargetException at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddPluginToEmptyPluginsDirectory(LayrryLinksTest.java:113) Caused by: java.lang.reflect.InvocationTargetException at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddPluginToEmptyPluginsDirectory(LayrryLinksTest.java:113) Caused by: java.lang.NoClassDefFoundError: io/vertx/core/AbstractVerticle at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddPluginToEmptyPluginsDirectory(LayrryLinksTest.java:113) Caused by: java.lang.ClassNotFoundException: io.vertx.core.AbstractVerticle at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddPluginToEmptyPluginsDirectory(LayrryLinksTest.java:113)

[ERROR] org.moditect.layrry.example.links.test.LayrryLinksTest.canAddAndRemovePlugin Time elapsed: 0.25 s <<< ERROR! java.lang.IllegalArgumentException: java.lang.reflect.InvocationTargetException at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddAndRemovePlugin(LayrryLinksTest.java:72) Caused by: java.lang.reflect.InvocationTargetException at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddAndRemovePlugin(LayrryLinksTest.java:72) Caused by: java.lang.NoClassDefFoundError: io/vertx/core/AbstractVerticle at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddAndRemovePlugin(LayrryLinksTest.java:72) Caused by: java.lang.ClassNotFoundException: io.vertx.core.AbstractVerticle at org.moditect.layrry.example.links.test.LayrryLinksTest.canAddAndRemovePlugin(LayrryLinksTest.java:72)

aalmiray commented 3 years ago

Hi Martjin, could you add the output of mvn --version? Thanks! 😄

aalmiray commented 3 years ago

It may be related to https://github.com/moditect/layrry/issues/77

I've got the same compilation error when running a full build with JDK 11, however the build succeeds (locally) if JDK 15 is used. The build is currently broken on GitHub actions even if JDK 15 is used (due to a timing issue when running the vert.x test).

karianna commented 3 years ago

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec Java version: 11.0.10, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "10.15.7", arch: "x86_64", family: "mac"

aalmiray commented 3 years ago

Thanks @karianna. May I suggest you to try out the build with JDK 15+?

karianna commented 3 years ago

15 works :-)

gunnarmorling commented 3 years ago

Thanks for reporting back. So we should get to the grounds of this, I don't see any fundamental reason why 11 shouldn't work.

aalmiray commented 3 years ago

Indeed. Tests were working fine with Vert.x 3.x. Upgraded to Vert.x 4.x as soon as it was released. Have to check if there's a difference in behavior between the two versions. Also, Awaitility might need to be reviewed.

gunnarmorling commented 3 years ago

Oh, that's interesting. Classloading structure changed a fair bit between Vert.x 3 and 4, AFAIK.

aalmiray commented 3 years ago

I suppose we could switch back to 3.x for the sake of automated tests. Yet the cause of the breakage with 4.x would still have to be found.

aalmiray commented 3 years ago

Alright. Moved Vert.x back to 3.9.5 and gave a twirl. Test breaks with JDK11 (with the same reported exception) but succeeds with JDK15. This might not be related to the Vert.x version. Stumped.

aalmiray commented 3 years ago

Tried different distros of 11.0.10. All of them break with the same error

Java version: 11.0.10, vendor: Azul Systems, Inc., runtime: /Users/aalmiray/.sdkman/candidates/java/11.0.10-zulu/zulu-11.jdk/Contents/Home
Java version: 11.0.10, vendor: Amazon.com Inc., runtime: /Users/aalmiray/.sdkman/candidates/java/11.0.10.9.1-amzn
Java version: 11.0.10, vendor: BellSoft, runtime: /Users/aalmiray/.sdkman/candidates/java/11.0.10-librca
Java version: 11.0.10, vendor: AdoptOpenJDK, runtime: /Users/aalmiray/.sdkman/candidates/java/11.0.10.hs-adpt
Java version: 11.0.10, vendor: GraalVM Community, runtime: /Users/aalmiray/.sdkman/candidates/java/21.0.0.r11-grl

However JDK 12 (had to use SapMachine as that's the only version of 12 provided by SDKMAN!) works. Azul's 13 works as well.

Is there something weird going on with JDK 11?