quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

ClassNotFoundException for VaultException and vault classes #11753

Closed galderz closed 1 month ago

galderz commented 4 years ago

We've been running Quarkus 1.7.0.Final native tests with Mandrel 20.2 and we've spotted this failure:

2020-08-20T14:00:49.4887817Z [INFO] Running io.quarkus.vault.AgroalVaultITCase
2020-08-20T14:00:49.6482033Z [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.045 s <<< FAILURE! - in io.quarkus.vault.AgroalVaultITCase
2020-08-20T14:00:49.6490303Z [ERROR] io.quarkus.vault.AgroalVaultITCase  Time elapsed: 0.045 s  <<< ERROR!
2020-08-20T14:00:49.6499501Z java.lang.RuntimeException: Unable to instantiate the test resource io.quarkus.vault.test.VaultTestLifecycleManager
2020-08-20T14:00:49.6506863Z    at io.quarkus.test.common.TestResourceManager.getTestResources(TestResourceManager.java:148)
2020-08-20T14:00:49.6513451Z    at io.quarkus.test.common.TestResourceManager.<init>(TestResourceManager.java:34)
2020-08-20T14:00:49.6520016Z    at io.quarkus.test.common.TestResourceManager.<init>(TestResourceManager.java:30)
2020-08-20T14:00:49.6525838Z    at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:333)
2020-08-20T14:00:49.6535703Z    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$7(ClassBasedTestDescriptor.java:359)
2020-08-20T14:00:49.6544745Z    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-20T14:00:49.6553171Z    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:359)
2020-08-20T14:00:49.6560439Z    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:189)
2020-08-20T14:00:49.6567708Z    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
2020-08-20T14:00:49.6575436Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:132)
2020-08-20T14:00:49.6582831Z    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-20T14:00:49.6591132Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-08-20T14:00:49.6596444Z    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-08-20T14:00:49.6604342Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-08-20T14:00:49.6611860Z    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-20T14:00:49.6619408Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-08-20T14:00:49.6625995Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-08-20T14:00:49.6630448Z    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
2020-08-20T14:00:49.6641793Z    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
2020-08-20T14:00:49.6648652Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
2020-08-20T14:00:49.6656323Z    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-20T14:00:49.6664392Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
2020-08-20T14:00:49.6669700Z    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
2020-08-20T14:00:49.6677581Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
2020-08-20T14:00:49.6684638Z    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
2020-08-20T14:00:49.6692041Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
2020-08-20T14:00:49.6698892Z    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
2020-08-20T14:00:49.6709302Z    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
2020-08-20T14:00:49.6718773Z    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
2020-08-20T14:00:49.6726684Z    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
2020-08-20T14:00:49.6732899Z    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
2020-08-20T14:00:49.6739858Z    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
2020-08-20T14:00:49.6747169Z    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
2020-08-20T14:00:49.6753029Z    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
2020-08-20T14:00:49.6759000Z    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
2020-08-20T14:00:49.6766379Z    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:188)
2020-08-20T14:00:49.6774148Z    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:154)
2020-08-20T14:00:49.6781455Z    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:128)
2020-08-20T14:00:49.6787996Z    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:428)
2020-08-20T14:00:49.6793617Z    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
2020-08-20T14:00:49.6799821Z    at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:562)
2020-08-20T14:00:49.6805173Z    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:548)
2020-08-20T14:00:49.6809051Z Caused by: java.lang.reflect.InvocationTargetException
2020-08-20T14:00:49.6815580Z    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2020-08-20T14:00:49.6823901Z    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2020-08-20T14:00:49.6832380Z    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2020-08-20T14:00:49.6837650Z    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
2020-08-20T14:00:49.6844324Z    at io.quarkus.test.common.TestResourceManager.getTestResources(TestResourceManager.java:145)
2020-08-20T14:00:49.6845013Z    ... 41 more
2020-08-20T14:00:49.6850408Z Caused by: java.lang.NoClassDefFoundError: io/quarkus/vault/VaultException
2020-08-20T14:00:49.6855050Z    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
2020-08-20T14:00:49.6859972Z    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
2020-08-20T14:00:49.6866100Z    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
2020-08-20T14:00:49.6872496Z    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
2020-08-20T14:00:49.6882053Z    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
2020-08-20T14:00:49.6888919Z    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
2020-08-20T14:00:49.6895629Z    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
2020-08-20T14:00:49.6902586Z    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
2020-08-20T14:00:49.6907311Z    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
2020-08-20T14:00:49.6914006Z    at io.quarkus.vault.test.VaultTestLifecycleManager.<init>(VaultTestLifecycleManager.java:16)
2020-08-20T14:00:49.6914767Z    ... 46 more
2020-08-20T14:00:49.6920316Z Caused by: java.lang.ClassNotFoundException: io.quarkus.vault.VaultException
2020-08-20T14:00:49.6926827Z    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
2020-08-20T14:00:49.6933439Z    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
2020-08-20T14:00:49.6938370Z    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
2020-08-20T14:00:50.2031560Z    ... 56 more

This failure is happening but no native image has been built. Is there some bug in the tooling/maven setup? (see longer output)

Issue has been spotted in this oracle/graal run and this Mandrel run.

The options used are:

  env:
    LANG: en_US.UTF-8
    DB_USER: hibernate_orm_test
    DB_PASSWORD: hibernate_orm_test
    DB_NAME: hibernate_orm_test
    NATIVE_TEST_MAVEN_OPTS: -B --settings .github/mvn-settings.xml --fail-at-end -Dquarkus.native.additional-build-args=-J-ea -Dtest-postgresql -Dtest-elasticsearch -Dtest-keycloak -Dtest-amazon-services -Dtest-db2 -Dtest-mysql -Dtest-mariadb -Dmariadb.base_url='jdbc:mariadb://localhost:3308' -Dmariadb.url='jdbc:mariadb://localhost:3308/hibernate_orm_test'  -Dtest-mssql -Dtest-vault -Dtest-neo4j -Dtest-kafka -Dtest-redis -Dnative-image.xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install
    MX_GIT_CACHE: refcache
    JAVA_HOME: /home/runner/work/mandrel/mandrel/openjdk
    MANDREL_REPO: /home/runner/work/mandrel/mandrel
    MANDREL_HOME: /home/runner/work/mandrel/mandrel/../mandrelvm
    MX_HOME: /home/runner/work/mandrel/mandrel/../mx
    TEST_MODULES: vault vault-app vault-agroal

    CATEGORY: Security3
sberyozkin commented 4 years ago

CC @stuartwdouglas

stuartwdouglas commented 4 years ago

This test is setup weird. It does not have any non-test scoped dependencies, so there should be basically nothing in the native image. They also only test native, so the tests are not run on the JVM.

How does this work at all?

sberyozkin commented 4 years ago

@vsevel Hi Vincent, can you clarify please ?

vsevel commented 4 years ago

hello all, AgroalVaultITCase does not carry native testing. all natives tests for vault are located into VaultInGraalITCase from module vault-app. I am confused. why would vault-agroal be considered during native testing. it does not have the native-image profile in pom.xml and does not mention the @NativeImageTest annotation. what am I missing?

geoand commented 2 months ago

Is this still an issue?

vsevel commented 2 months ago

Not aware

geoand commented 1 month ago

Closing for lack of feedback