Opened 5 years ago

Closed 5 years ago

#2142 closed defect (fixed)

make / maven problems with Java (version?)

Reported by: Peter Baumann Owned by: Bang Pham Huu
Priority: major Milestone: 10.0
Component: java Version: 9.8
Keywords: Cc: apercov, Dimitar Misev
Complexity: Medium

Description

when trying to compile I get

[ 40%] building rasj
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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/PluginResolutionException
java/CMakeFiles/rasj.dir/build.make:64: recipe for target 'java/CMakeFiles/rasj' failed
make[2]: *** [java/CMakeFiles/rasj] Error 1
CMakeFiles/Makefile2:2881: recipe for target 'java/CMakeFiles/rasj.dir/all' failed
make[1]: *** [java/CMakeFiles/rasj.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

I have Java 8 + 11 on my Ubuntu 18.04 machine, kernel x86_64 4.15.0-55-generic. Originally set to v11 I switched java + javac to use v8, but the error message remains the same.

Change History (13)

comment:1 by Bang Pham Huu, 5 years ago

I tested in a VM Ubuntu 18.04 (with openJDK 11 for java and JDK 1.8 for javac, but it doesn't have the same problem, rasj can be built in the end.

osboxes@osboxes:/opt/rasdaman_manual/source/build/java$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)


osboxes@osboxes:/opt/rasdaman_manual/source/build/java$ javac -version
javac 1.8.0_212


osboxes@osboxes:/opt/rasdaman_manual/source/build/java$ mvn -version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.3, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.18.0-15-generic", arch: "amd64", family: "unix"


osboxes@osboxes:/opt/rasdaman_manual/source/build/java$ make
[  0%] Built target rasj_generate_errtxts_message
[  0%] Built target google-protobuf
[ 33%] Built target google-grpc
Scanning dependencies of target protoc-gen-grpc-java
[ 33%] Built target protoc-gen-grpc-java
[ 33%] building rasj
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
...... 12s to build custom target in java: /usr/bin/mvn -q -B package -Prasnet -Dversion=9.8.0 -DbuildDir=/opt/rasdaman_manual/source/build/java/target -Dpackaging=jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[100%] Built target rasj

comment:2 by Dimitar Misev, 5 years ago

Could you test with only openjdk 11 (remove openjdk 8)?

If all works fine with openjdk 11 we can remove 8 as a dependency for this OS.

comment:3 by Bang Pham Huu, 5 years ago

I installed openjdk11 as well and rebuilt rasdaman

osboxes@osboxes:/opt/rasdaman_manual/source/build$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

osboxes@osboxes:/opt/rasdaman_manual/source/build$ javac -version
javac 11.0.3

[ 97%] Building CXX object server/CMakeFiles/rasserver.dir/rasserver_config.cc.o
[ 98%] Building CXX object server/CMakeFiles/rasserver.dir/createinitmdd.cc.o
...... 4s to compile createinitmdd.cc to createinitmdd.cc.o
[ 98%] Building CXX object server/CMakeFiles/rasserver.dir/rasserver_entry.cc.o
...... 4s to compile rasserver_config.cc to rasserver_config.cc.o
[ 98%] Building CXX object server/CMakeFiles/rasserver.dir/rasserver_main.cc.o
...... 4s to compile rasserver_entry.cc to rasserver_entry.cc.o
[ 98%] Building CXX object server/CMakeFiles/rasserver.dir/rasserver_error.cc.o
[ 98%] Building CXX object server/CMakeFiles/rasserver.dir/rasserver_rasdl.cc.o
[100%] Building CXX object server/CMakeFiles/rasserver.dir/__/mymalloc/mymalloc_svc.cc.o
...... 28s to compile rasserver_main.cc to rasserver_main.cc.o
[100%] Linking CXX executable rasserver
/usr/bin/ld: warning: libcrypto.so.1.1, needed by //usr/lib/x86_64-linux-gnu/libpq.so.5, may conflict with libcrypto.so.1.0.0
[100%] Built target rasserver

comment:4 by Dimitar Misev, 5 years ago

And does it run fine, systemtest passes?

comment:5 by Dimitar Misev, 5 years ago

I think we cannot remove jre 8 because tomcat depends on it, and rasdaman depends on tomcat.

But it would be good to know if petascope runs fine with jre 11.

in reply to:  4 comment:6 by Bang Pham Huu, 5 years ago

Replying to dmisev:

And does it run fine, systemtest passes?

Petascope can start and import some data with wcst_import, but it has a non-related problem with rasdaman while importing some data (I dropped RASBASE and created a new one and restarted rasdaman).

[ERROR] - 2019-07-26 04:30:37,152, reladminif/sqlitewrapper.cc:355: 
SQL query failed "PRAGMA journal_mode=WAL; PRAGMA busy_timeout=600000", database error 5: database is locked

comment:7 by Peter Baumann, 5 years ago

is there any way to pass debug options down? I just call "make", but the problem sits somewhere deep in the stack. I'd provide more information if I can.

comment:8 by Dimitar Misev, 5 years ago

There seems to be a lot of hits when searching online for this:

java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

comment:9 by Peter Baumann, 5 years ago

managed to drill into it a little: problematic call is when doing "cd java: make" and then here:

cd /home/rasdaman/rasdaman/java && /home/rasdaman/rasdaman/cmake/report_custom_time.sh  /usr/bin/mvn -q -B package -Prasnet -Dversion=9.8.0 -DbuildDir=/home/rasdaman/rasdaman/build/java/target -Dpackaging=jar

and this can be trimmed to

/usr/bin/mvn -q -B package -Prasnet -Dversion=9.8.0 -DbuildDir=/home/rasdaman/rasdaman/build/java/target -Dpackaging=jar

Next, I run this (removing -q):

/usr/bin/mvn  -B package -Prasnet -Dversion=9.8.0 -DbuildDir=/home/rasdaman/rasdaman/build/java/target -Dpackaging=jar

and get some more output, before the known issue appears:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.rasdaman:rasj:jar:9.8.0
[WARNING] 'version' contains an expression but should be a constant. @ org.rasdaman:rasj:${version}, /home/rasdaman/rasdaman/java/pom.xml, line 7, column 14
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] -------------------------< org.rasdaman:rasj >--------------------------
[INFO] Building rasj 9.8.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.446 s
[INFO] Finished at: 2019-07-26T11:11:17+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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/PluginResolutionException

}}}

comment:10 by Peter Baumann, 5 years ago

$ grep version /home/rasdaman/rasdaman/java/pom.xml
    <version>${version}</version>
        <version>9.8.0</version>
            <!-- plugin used to specify the java version-->
                <version>2.1</version>
                <version>2.4</version>
                        <version>2.9.1</version>             
        <!-- NOTE: This is important as one of dependencies in rasj uses old jackson-core version 
            <version>2.8.7</version>
            <version>1.11.0</version>
            <version>3.5.1</version>
            <version>4.12</version>
            <version>1.3.1</version>
                        <version>2.1</version>
                        <version>2.1</version>
                        <version>1.6.2</version>
                        <version>2.2.1</version>
                        <version>1.5</version>

in reply to:  8 comment:11 by Peter Baumann, 5 years ago

Replying to dmisev:

There seems to be a lot of hits when searching online for this:

java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

good hint, that confirms we should have a check for this or, if not possible, a note in the installation guide - it is very non-obvious and can block.

comment:12 by Peter Baumann, 5 years ago

[solved]

the following helped:

sudo rm /etc/ssl/certs/java/cacerts  # actually, I kept a backup copy, of course
sudo update-ca-certificates -f

now make succeeds. Caveat: I could not check if any other application is affected by this change of cacerts.

We may want to have this directly in the documentation or in the FAQ (with pointers to FAQ in the install documentation).

comment:13 by Peter Baumann, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.