dice-group / LIMES

Link Discovery Framework for Metric Spaces.
https://limes.demos.dice-research.org/
GNU Affero General Public License v3.0
129 stars 54 forks source link

Unsupported class file major version 59 #244

Closed KonradHoeffner closed 3 years ago

KonradHoeffner commented 3 years ago

Running mvn package on the newest master branch produces dozens of exceptions like the following. The most important part seems to be java.lang.IllegalArgumentException: Unsupported class file major version 59. I guess that there is some problem with newer Java versions. I'm using openjdk 15.0.2 2021-01-19.

java.lang.instrument.IllegalClassFormatException: Error while instrumenting javax/script/ScriptEngineManager$1.
    at org.jacoco.agent.rt.internal_035b120.CoverageTransformer.transform(CoverageTransformer.java:93)
    at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
    at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:563)
    at java.base/java.lang.ClassLoader.defineClass2(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1108)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:183)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:784)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(BuiltinClassLoader.java:705)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:630)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:604)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at java.scripting/javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:101)
    at java.scripting/javax.script.ScriptEngineManager.init(ScriptEngineManager.java:87)
    at java.scripting/javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:62)
    at org.apache.logging.log4j.core.script.ScriptManager.<init>(ScriptManager.java:49)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:201)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:231)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:491)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:561)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:577)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:212)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)
    at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
    at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
    at org.aksw.limes.core.io.config.reader.xml.XMLConfigurationReader.<clinit>(XMLConfigurationReader.java:40)
    at org.aksw.limes.core.execution.engine.partialrecallengine.refinement.RuntimeComparisonTest.sortPlans(RuntimeComparisonTest.java:48)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:365)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:273)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:159)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: java.io.IOException: Error while instrumenting javax/script/ScriptEngineManager$1.
    at org.jacoco.agent.rt.internal_035b120.core.instr.Instrumenter.instrumentError(Instrumenter.java:158)
    at org.jacoco.agent.rt.internal_035b120.core.instr.Instrumenter.instrument(Instrumenter.java:108)
    at org.jacoco.agent.rt.internal_035b120.CoverageTransformer.transform(CoverageTransformer.java:91)
    ... 57 more
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 59
    at org.jacoco.agent.rt.internal_035b120.asm.ClassReader.<init>(ClassReader.java:195)
    at org.jacoco.agent.rt.internal_035b120.asm.ClassReader.<init>(ClassReader.java:176)
    at org.jacoco.agent.rt.internal_035b120.asm.ClassReader.<init>(ClassReader.java:162)
    at org.jacoco.agent.rt.internal_035b120.core.internal.instr.InstrSupport.classReaderFor(InstrSupport.java:279)
    at org.jacoco.agent.rt.internal_035b120.core.instr.Instrumenter.instrument(Instrumenter.java:74)
    at org.jacoco.agent.rt.internal_035b120.core.instr.Instrumenter.instrument(Instrumenter.java:106)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.011 s - in org.aksw.limes.core.measures.measure.pointsets.sumofmin.NaiveSumOfMinTest
[INFO] Running org.aksw.limes.core.measures.measure.phoneticmeasure.PhoneticMeasureTest
[INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.077 s - in org.aksw.limes.core.measures.measure.phoneticmeasure.PhoneticMeasureTest
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   PartialRecallExecutionEngineTest.testAtomicLSLiger2:719 » QueryExceptionHTTP H...
[INFO] 
[ERROR] Tests run: 334, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for LIMES 1.7.5-SNAPSHOT:
[INFO] 
[INFO] LIMES .............................................. SUCCESS [  2.097 s]
[INFO] LIMES .............................................. FAILURE [04:13 min]
[INFO] limes-debian-cli ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:15 min
[INFO] Finished at: 2021-03-30T16:34:04+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project limes-core: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/konrad/opt/limes/limes-core/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :limes-core
kvndrsslr commented 3 years ago

I think this was the jacoco plugin. I removed it in the last bug fix release. Building works fine for me on adoptopenjdk16.

KonradHoeffner commented 3 years ago

Running mvn package of the newest commit 30c7484e215a8d24b56d8e1c47ee3969f0c4970b from May 11 still fails, but with a different error, so I guess that one is resolved and I will open a new one for the other error.

KonradHoeffner commented 3 years ago

Yes, that other error was just because JAVA_HOME was not set, mvn package works fine now.

kvndrsslr commented 3 years ago

javadoc, which relies on the correct JAVA_HOME env was previously disabled for reasons I do not remember. I enabled it for the last release, which is probably why you just encountered this error.

KonradHoeffner commented 3 years ago

This is unfortunate, because e.g. Arch Linux doesn't seem to set JAVA_HOME by default when installing Java using the package manager. Then java, javac and javadoc are on the path but still aren't found by maven-javadoc-plugin. However you can fix this by setting the javadocExecutable in pom.xml like so:

     <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
                <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
            </configuration>
        </plugin>

See https://stackoverflow.com/questions/13961615/unable-to-find-javadoc-command-maven.