coli-saar / utool

Utool is the Swiss Army Knife of Underspecification. It is a GUI and library written in Java for performing computations with dominance graphs and other formalisms, which are used to represent semantic ambiguities in natural language processing.
http://www.coli.uni-saarland.de/projects/chorus/utool/
3 stars 0 forks source link

error in the `mvn install` #5

Closed arademaker closed 1 year ago

arademaker commented 2 years ago

the compilation failed with

% mvn install assembly:single
...
Downloaded from central: https://jcenter.bintray.com/org/madlonkay/desktopsupport/0.3.0/desktopsupport-0.3.0.pom (414 B at 604 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  38.307 s
[INFO] Finished at: 2021-10-11T19:15:47-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project utool: Could not resolve dependencies for project de.saar.chorus:utool:jar:3.3.1-SNAPSHOT: Failed to collect dependencies at de.saar.chorus:lethal:jar:1.0: Failed to read artifact descriptor for de.saar.chorus:lethal:jar:1.0: Could not transfer artifact de.saar.chorus:lethal:pom:1.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [external (http://www.coli.uni-saarland.de/projects/ecl/maven2/external, default, releases+snapshots), ecl-releases (http://www.coli.uni-saarland.de/projects/ecl/maven2/releases, default, releases+snapshots)] -> [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/DependencyResolutionException
ar@tenis utool %
alexanderkoller commented 2 years ago

Yeah, at some point in the past ten years the directories where we hosted some of our external dependencies went away. I moved them to Github, see if it works now.

alexanderkoller commented 2 years ago

(You may have to recompile with mvn install -U to force Maven to reattempt downloading the dependencies.)

arademaker commented 2 years ago

It now finished the compilation, but some tests failed:

Tests run: 135, Failures: 2, Errors: 133, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:05 min
[INFO] Finished at: 2021-10-12T11:12:48-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test (default-test) on project utool: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/ar/hpsg/utool/target/surefire-reports for the individual test results.
[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
alexanderkoller commented 2 years ago

How odd, they work for me. Could you retry from a fresh clone of the repository?

What tests are failing? What Java version are you using?

arademaker commented 2 years ago

Most of the cases

    <error message="Could not initialize class groovy.lang.GroovySystem" type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError: Could not initialize class groovy.lang.GroovySystem
...

in the files like target/surefire-reports/TEST-de.saar.basic.UnionFindTest.xml

arademaker commented 2 years ago
% java -version
openjdk version "16.0.2" 2021-07-20
OpenJDK Runtime Environment Homebrew (build 16.0.2+0)
OpenJDK 64-Bit Server VM Homebrew (build 16.0.2+0, mixed mode, sharing)
arademaker commented 2 years ago

Yes, I made a git pull before.

arademaker commented 2 years ago

In de.saar.basic.UnionFindTest.txt

-------------------------------------------------------------------------------
Test set: de.saar.basic.UnionFindTest
-------------------------------------------------------------------------------
Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE!
test1(de.saar.basic.UnionFindTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class groovy.lang.GroovySystem
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:141)
        at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:160)
        at de.saar.basic.UnionFindTest.$getStaticMetaClass(UnionFindTest.groovy)
        at de.saar.basic.UnionFindTest.<init>(UnionFindTest.groovy)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
        at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:168)
        at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:213)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:210)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
        at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
alexanderkoller commented 2 years ago

Weird. Perhaps the version of Groovy I use in pom.xml isn't compatible with Java 16? I am using Zulu OpenJDK 15 here, and that compiles it fine.

Do you have time to look into whether Java 15 would fix your problem? Otherwise you could use the newly released Utool 3.4, and we could close this issue.

alexanderkoller commented 2 years ago

The problem is that the Groovy plugin for Maven (build/plugins/plugin/gmaven-plugin in pom.xml), which I need to compile and execute the tests, changed its syntax since 2012, and I don't have time right now to figure out how to fix it. If you have time to help debug this and perhaps submit a pull request, that would be fantastic. Otherwise it may have to wait until Utool becomes uncompilable for me too.

arademaker commented 2 years ago

the more I dig, the more I find:

[ERROR] Failed to execute goal org.codehaus.gmaven:gmaven-plugin:1.5:testCompile (default) on project utool: startup failed, /Users/ar/hpsg/utool/src/test/groovy/de/saar/chorus/domgraph/codec/CodecManagerTest.groovy: 8: unable to resolve class GroovyTestCase

For the first error, GroovyTestCase is now deprecated: https://docs.groovy-lang.org/latest/html/api/groovy/util/GroovyTestCase.html

and

[ERROR] /Users/ar/hpsg/utool/src/test/groovy/testsuite/rondane/RondaneTestsuite.groovy: 97: unable to resolve class XmlSlurper
[ERROR]  @ line 97, column 19.
[ERROR]         def testsuite = new XmlSlurper().parse(new GZIPInputStream(new FileInputStream(filename)));
[ERROR]                      ^
[ERROR]

So adding the new dependency (https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all/3.0.9) just expose more problems! I am not very comfortable in the Java World, but I will give it a try. Ultimately, I would like to understand the algorithm better to draft an implementation in Haskell or Lisp

alexanderkoller commented 2 years ago

I updated the Groovy unit test integration to a newer version. Could you check if that fixes things for you?

arademaker commented 2 years ago

I got

Tests run: 148, Failures: 0, Errors: 27, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.250 s
[INFO] Finished at: 2021-10-14T12:27:19-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test (default-test) on project utool: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/ar/hpsg/utool/target/surefire-reports for the individual test results.
[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

In one of the reports:

% cat de.saar.chorus.domgraph.codec.domcon.DomconOzInputCodecTest.txt
-------------------------------------------------------------------------------
Test set: de.saar.chorus.domgraph.codec.domcon.DomconOzInputCodecTest
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
(venv) ar@tenis surefire-reports % cat de.saar.chorus.domgraph.codec.holesem.HolesemCodecTest.txt
-------------------------------------------------------------------------------
Test set: de.saar.chorus.domgraph.codec.holesem.HolesemCodecTest
-------------------------------------------------------------------------------
Tests run: 5, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.042 sec <<< FAILURE!
testHolesem14nonHnc(de.saar.chorus.domgraph.codec.holesem.HolesemCodecTest)  Time elapsed: 0.005 sec  <<< ERROR!
groovy.lang.MissingMethodException: No signature of method: static de.saar.chorus.domgraph.codec.MalformedDomgraphException.isInstance() is applicable for argument types: (de.saar.chorus.domgraph.codec.MalformedDomgraphException) values: [The graph is not hypernormally connected]
    at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1503)
...
arademaker commented 2 years ago

attaching the errors ...

surefire-reports.tar.gz

alexanderkoller commented 2 years ago

If I remember correctly, I fixed this issue. Could you double-check again?

arademaker commented 1 year ago

not yet.

% mvn install assembly:single
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.632 s
[INFO] Finished at: 2022-12-01T14:47:21-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test (default-test) on project utool: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/ar/hpsg/utool/target/surefire-reports for the individual test results.
[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

ar@tenis utool % java -version
java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)

But @gflima was able to compile with openjdk 11.0.16.1 2022-08-12

arademaker commented 1 year ago

OK, the command mvn compile assembly:single works fine! The generated JAR is inside the target folder.