eclipse / jnosql

Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.
Other
229 stars 72 forks source link

Project cannot run tests using Java higher than 11 version #333

Closed dearrudam closed 1 year ago

dearrudam commented 1 year ago

Cannot perform the tests by using Java 17. Some dependency doesn't work with Java 17. Here are the logs: build.log

dearrudam commented 1 year ago

More information about this issue:

It looks like the dependency on the jnosql-mapping/jnosql-mapping-graph module

        <dependency>
            <groupId>org.apache.tinkerpop</groupId>
            <artifactId>gremlin-groovy</artifactId>
            <version>${tinkerpop.version}</version>
            <scope>provided</scope>
        </dependency>

doesn't support Java 17 version.

In the StackTrace, we may found the following message:

Caused by: javax.script.ScriptException: java.util.concurrent.ExecutionException: BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 61

FYI here's the stacktrace that comes from one of the failure tests:

org.eclipse.jnosql.mapping.graph.GremlinQueryException: There is an error when executed the gremlin query: g.V().hasLabel('Person')

    at org.eclipse.jnosql.mapping.graph.GremlinExecutor.executeGremlin(GremlinExecutor.java:64)
    at org.eclipse.jnosql.mapping.graph.GremlinExecutor.executeGremlin(GremlinExecutor.java:43)
    at org.eclipse.jnosql.mapping.graph.AbstractGraphTemplate.query(AbstractGraphTemplate.java:308)
    at org.eclipse.jnosql.mapping.graph.AbstractGraphTemplate.singleResult(AbstractGraphTemplate.java:313)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)
    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:106)
    at org.jboss.weld.generated.proxies.nosql.Template$GraphTemplate$569679100$Proxy$_$$_WeldClientProxy.singleResult(Unknown Source)
    at org.eclipse.jnosql.mapping.graph.AbstractGraphTemplateTest.shouldReturnEmpty(AbstractGraphTemplateTest.java:427)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
    at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: javax.script.ScriptException: java.util.concurrent.ExecutionException: BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 61
    at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:382)
    at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:231)
    at org.eclipse.jnosql.mapping.graph.GremlinExecutor.executeGremlin(GremlinExecutor.java:52)
    ... 81 more
Caused by: java.util.concurrent.ExecutionException: BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 61
    at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
    at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.getScriptClass(GremlinGroovyScriptEngine.java:571)
    at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:378)
    ... 83 more
Caused by: BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' Unsupported class file major version 61
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:969)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:642)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:591)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401)
    at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
    at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341)
    at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338)
    at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:320)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:262)
    at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine$GroovyCacheLoader.lambda$load$0(GremlinGroovyScriptEngine.java:823)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
    at java.base/java.util.concurrent.CompletableFuture.asyncSupplyStage(CompletableFuture.java:1782)
    at java.base/java.util.concurrent.CompletableFuture.supplyAsync(CompletableFuture.java:2005)
    at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine$GroovyCacheLoader.load(GremlinGroovyScriptEngine.java:821)
    at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine$GroovyCacheLoader.load(GremlinGroovyScriptEngine.java:816)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalLoadingCache.lambda$new$0(BoundedLocalCache.java:3117)
    at com.github.benmanes.caffeine.cache.LocalCache.lambda$statsAware$0(LocalCache.java:144)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$16(BoundedLocalCache.java:1968)
    at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:1966)
    at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:1949)
    at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:113)
    at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:67)
    ... 85 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:177)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:163)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:284)
    at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
    at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
    at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
    at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
    at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:125)
    at org.codehaus.groovy.control.ResolveVisitor.resolveToOuter(ResolveVisitor.java:853)
    at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:467)
    at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1422)
    at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:230)
    at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:700)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:965)
    ... 109 more
otaviojava commented 1 year ago

Nice @dearrudam !

Did you open an issue on the Apache tinkerpop about it?

https://github.com/apache/tinkerpop

It would be best if you went on the e-mail to discuss this point.

dearrudam commented 1 year ago

@otaviojava I'm going to open an issue there ASAP... thanks for letting me know👍

And sorry about bring it here... I'll send an email to discuss this point as you've recommended!

Thanks

otaviojava commented 1 year ago

Nope, You did it right! We need to document the bug.

otaviojava commented 1 year ago

I checked, and they're using Groovy version 2.5.15:

https://github.com/apache/tinkerpop/blob/3c46c4ec582d71fa0858e988010aa140ed6f13d5/pom.xml#L167

If we request that they update that version, it would be great:

https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all

dearrudam commented 1 year ago

During my discovery of how to open an issue on the TinkerPop project, I figured out that they got a Discord Server (https://discord.gg/kfebyvDM9H), and there, I opened a question on their forum asking how they can support this issue then I got some information about this situation:

Stephen Mallette, a TinkerPop project committer, provided me with this explanation:

TinkerPop has had some problems upgrading Groovy given some performance issues that we've been having with newer versions. As a result we're not on a version that I believe runs nicely on jdk17. We're actively working on the problem now and have finally had some break-thru with the groovy community to solve the issue i believe the plan will be to have jdk17 support in 3.7.0. i'm not sure if we can easily backport the required changes to 3.5.x or 3.6.x you might be able to work around the problem though if you upgrade Groovy yourself and force the use of 3.x/4.x. the performance issue, as we've noted it, mostly pertains to the Gremlin Console so that has been an unfortunate blocker. If you were just using Gremlin Server/GremlinGroovyScriptEngine I dont think there's a problem. the other alternative would be to avoid groovy all together since you are using 3.6.x you could try GremlinLangScriptEngine in Gremlin Server it uses the gremlin-language module which uses the Gremlin ANTLR grammar for parsing it's been noted to be as much as 5x faster than groovy, but it is not a direct drop in replacement it only processes Gremlin. you can't have Groovy related code in your scripts at all anyway, that's for the adventurous as GremlinLangScriptEngine is fairly new and not fully recommended yet your easiest approach would be to downgrade to jdk11 - then i'd expect everything to work out of the box nicely for you

According to his information, I think that we could try to force our tests to use groovy 3.x/4x. Does someone have thoughts/recommendations about that?

otaviojava commented 1 year ago

@dearrudam I found two new issues where I create to tickets.