blazegraph / database

Blazegraph High Performance Graph Database
GNU General Public License v2.0
872 stars 170 forks source link

Problems with Java 11 ? #204

Open BorderCloud opened 3 years ago

BorderCloud commented 3 years ago

I tried to compile BLAZEGRAPH_2_1_6_RC with Java 11 on centos7.

mkdir -p /usr/share/maven /usr/share/maven/ref
curl -fsSL http://apache.osuosl.org/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz | tar -xzC /usr/share/maven --strip-components=1 
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
git clone  --depth 1 -b BLAZEGRAPH_2_1_6_RC  --single-branch https://github.com/blazegraph/database.git /opt/blazegraph
cd /opt/blazegraph
./scripts/mavenInstall.sh ==> ERROR [INFO] Blazegraph Core .................................... FAILURE 

For info :

mvn --version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /usr/share/maven
Java version: 11.0.11, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-1.el7_9.x86_64
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-1160.31.1.el7.x86_64", arch: "amd64", family: "unix"

Did I make a mistake?

berezovskyi commented 3 years ago

I would try to use JDK8 (e.g. https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/generic-linux-install.html#rpm-linux-install-instruct) or try Wikimedia's fork https://github.com/wikimedia/wikidata-query-blazegraph

Also, your output from mavenInstall.sh is too short, I don't think you can figure out the problem. I would also try to remove the "-DskipTests" option from the script to get a better picture at what's failing.

BorderCloud commented 3 years ago

@berezovskyi With JDK8 it works but I tried to simplify the configuration of my OS. With Blazegraph, I have to install java 11 and the 8.

donpellegrino commented 1 year ago

For Java 11, I found the following changes will get Blazegraph to compile:

diff --git a/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java b/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java
index ad6f16b4c..4c5238d80 100644
--- a/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java
+++ b/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/lexicon/LexiconRelation.java
@@ -53,7 +53,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicReference;

 import org.apache.log4j.Logger;
-import org.omg.CORBA.portable.ValueFactory;
 import org.openrdf.model.BNode;
 import org.openrdf.model.Literal;
 import org.openrdf.model.Statement;
diff --git a/pom.xml b/pom.xml
index 825a793aa..944eb2830 100644
--- a/pom.xml
+++ b/pom.xml
@@ -237,6 +237,18 @@ Copyright 2010 by TalkingTrends (Amsterdam, The Netherlands)
     <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
+  <dependencies>
+    <dependency>
+      <groupId>javax.xml.bind</groupId>
+      <artifactId>jaxb-api</artifactId>
+      <version>2.3.1</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.activation</groupId>
+      <artifactId>activation</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+  </dependencies>
   <profiles>
     <profile>
       <id>maven-central</id>

Investigating some tests revels some problems:

diff --git a/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingDequeTest.java b/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingDequeTest.java
index f80906bb0..3dc7f5bb1 100644
--- a/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingDequeTest.java
+++ b/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingDequeTest.java
@@ -1359,13 +1359,13 @@ public class LinkedBlockingDequeTest extends JSR166TestCase {
     /**
      * toArray(null) throws NullPointerException
      */
-    public void testToArray_NullArg() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
+    // public void testToArray_NullArg() {
+    //     LinkedBlockingDeque q = populatedDeque(SIZE);
+    //     try {
+    //         q.toArray(null);
+    //         shouldThrow();
+    //     } catch (NullPointerException success) {}
+    // }

     /**
      * toArray(incompatible array type) throws ArrayStoreException
diff --git a/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingQueueTest.java b/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingQueueTest.java
index 74c1a307d..b342904d9 100644
--- a/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingQueueTest.java
+++ b/bigdata-core-test/bigdata/src/test/com/bigdata/jsr166/LinkedBlockingQueueTest.java
@@ -661,13 +661,13 @@ public class LinkedBlockingQueueTest extends JSR166TestCase {
     /**
      * toArray(null) throws NullPointerException
      */
-    public void testToArray_NullArg() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
+    // public void testToArray_NullArg() {
+    //     LinkedBlockingQueue q = populatedQueue(SIZE);
+    //     try {
+    //         q.toArray(null);
+    //         shouldThrow();
+    //     } catch (NullPointerException success) {}
+    // }

     /**
      * toArray(incompatible array type) throws ArrayStoreException

These two test cases seem to be duplicates of each other, and both trigger Java's complaint about the ambiguity of which LinkedBlockingQueue.toArray() to call. I don't know what to make of that.