Hi Andy!
I've tried a few more builds today.
On my main Ubuntu 24.04 machine (same as before) where the 5.4.0 build
always fails, I collected complete maven logs of the failed build. I
will send them to you separately. I also looked for the first exception
traceback (there are many) and it's included at the bottom of this message.
I also tried installing maven 3.9.9 and using that for the build, but
the result was the same as with 3.8.7: the ARQ tests failed with
NoClassDefFoundError.
Then on another machine (VirtualBox VM with Ubuntu 24.04), I installed
the exact same Java and Maven versions as on my main machine. The build
succeeded!
I always remove my maven repository (rm -rf ~/.m2) before each build.
So it's not the specific Maven or Java version that causes the problem,
but something else that I can't yet pinpoint.
-Osma
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.jena.rdf12.basic.TS_RDFStar_Basic
[INFO] Running org.apache.jena.rdf12.basic.TestNQuadsStarParse
[ERROR] Tests run: 9, Failures: 0, Errors: 9, Skipped: 0, Time elapsed:
0.028 s <<< FAILURE! -- in org.apache.jena.rdf12.basic.TestNQuadsStarParse
[ERROR] org.apache.jena.rdf12.basic.TestNQuadsStarParse.parse_nq_bad_1
-- Time elapsed: 0.009 s <<< ERROR!
java.lang.Exception: Unexpected exception,
expected<org.apache.jena.riot.RiotException> but
was<java.lang.NoClassDefFoundError>
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
org.apache.jena.riot.RDFParserRegistry
at org.apache.jena.riot.RDFParser.createReader(RDFParser.java:514)
at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:436)
at org.apache.jena.riot.RDFParser.parse(RDFParser.java:380)
at
org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:552)
at
org.apache.jena.rdf12.basic.TestNQuadsStarParse.parse(TestNQuadsStarParse.java:61)
at
org.apache.jena.rdf12.basic.TestNQuadsStarParse.parse_nq_bad_1(TestNQuadsStarParse.java:49)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
Caused by: java.lang.ExceptionInInitializerError: Exception
java.lang.ExceptionInInitializerError [in thread "main"]
at
org.apache.jena.riot.RDFParserRegistry.initStandard(RDFParserRegistry.java:74)
at
org.apache.jena.riot.RDFParserRegistry.init(RDFParserRegistry.java:57)
at
org.apache.jena.riot.RDFParserRegistry.<clinit>(RDFParserRegistry.java:52)
at org.apache.jena.riot.RIOT.init(RIOT.java:80)
at org.apache.jena.riot.system.InitRIOT.start(InitRIOT.java:29)
at
org.apache.jena.base.module.Subsystem.lambda$initialize$1(Subsystem.java:117)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at
org.apache.jena.base.module.Subsystem.forEach(Subsystem.java:193)
at
org.apache.jena.base.module.Subsystem.forEach(Subsystem.java:169)
at
org.apache.jena.base.module.Subsystem.initialize(Subsystem.java:115)
at
org.apache.jena.sys.JenaSystem$LazyInitializer.jenaSystemInitialization(JenaSystem.java:103)
at
org.apache.jena.sys.JenaSystem$LazyInitializer.<clinit>(JenaSystem.java:96)
at org.apache.jena.sys.JenaSystem.init(JenaSystem.java:88)
at org.apache.jena.sys.JenaSystem.init(JenaSystem.java:72)
at org.apache.jena.graph.NodeFactory.<clinit>(NodeFactory.java:39)
at
org.apache.jena.rdf.model.impl.ResourceImpl.fresh(ResourceImpl.java:150)
at
org.apache.jena.rdf.model.impl.ResourceImpl.<init>(ResourceImpl.java:86)
at
org.apache.jena.rdf.model.ResourceFactory$Impl.createResource(ResourceFactory.java:308)
at
org.apache.jena.rdf.model.ResourceFactory.createResource(ResourceFactory.java:94)
at org.apache.jena.vocabulary.RDF.resource(RDF.java:54)
at org.apache.jena.vocabulary.RDF.<clinit>(RDF.java:61)
at
org.apache.jena.sparql.resultset.TestResultSetFormat1.<clinit>(TestResultSetFormat1.java:82)
at
java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
at
java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
at
java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:726)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at
java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1685)
at
java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
at
java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at
java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
On 19/04/2025 11:06, Andy Seaborne wrote:
Hi Osma,
Strange!
Because the NoClassDefFound relates to classes within the current maven
module, it can't be "not found" as far as I know; the "Could not
>>> initialize" points to problems in class initizialation code with
an error thrown deep in in the initialization execution.
But when I try to simulate that, I get a stack trace.
Is there a stack trace in the logs? (Do you have the complete maven logs
you could send to me?)
The build won't have touched jena-ontapi, nor have it on the class path
when running ARQ tests.
When build and testing the release (I did build clean from source) I use
a complete clean maven repository to make sure the there are clean
copies of all dependencies.
Andy
On 18/04/2025 09:05, Osma Suominen wrote:
Hi Andy!
Thanks for checking.
Re last build - on this machine, basically never, except I did test
the timeout fixes a few weeks ago, but I skipped the tests then to
save time. I believe the problem is with running the tests, not the
compiling of classes.
I downloaded all the previous 5.*.0 source releases as zips and tried
building them using "mvn clean install -Pdev". Results:
5.0.0: success
5.1.0: failure
5.2.0: failure
5.3.0: failure
So whatever the problem is, it's not a regression against the previous
5.3.0 release but it happened earlier. I checked the Jena 5.1.0
release notes, but the only possibly relevant thing I can see there is
the addition of jena-ontapi.
I will be on holiday until Tuesday, but when I get back, I can try to
test the build on some other machines to see if I can pinpoint the
cause. At the moment it's obviously hard since this only happens on
one particular system.
Anyway, I wouldn't consider this a release blocker if nobody else has
encountered it so far. It's probably some unfortunate combination of
changes in Jena and specifics of my own setup (which should be fairly
vanilla, as I don't do much Java development on this machine).
-Osma
On 17/04/2025 23:13, Andy Seaborne wrote:
Hi Osma,
I checked with maven 3.8.1 / java 21 with no problems (I used 3.9.9 /
java17 to do the release).
NoClassDefFound Could not initialize class
together with the fact the class not found is in jena-arq as is the
as the place throwing the error suggests it is a class initialization
issue. i.e. JenaSystem.init
When did you last build Jena from source?
Andy
On 17/04/2025 15:10, Osma Suominen wrote:
Hi,
it's been a while. I tried building the release candidate, since I'm
interested in the timeout fixes included.
But I couldn't make the tests pass. There are tons of
NoClassDefFound exceptions in the ARQ tests, causing the build to
break. See output snippets at the end of the message. This is
probably some simple mistake on my end, though I can't figure it
out. I'm reporting it because it could be a problem with the release
candidate, not just my environment.
I have cloned the repo and am using the release commit
1af1a75db645cf745ee418225b99651a60b2434a. git status shows "working
tree clean".
I have Ubuntu 24.04 with OpenJDK 21 JDK and Maven 3.8.7 installed
from Ubuntu packages.
$ java -version
openjdk version "21.0.6" 2025-01-21
OpenJDK Runtime Environment (build 21.0.6+7-Ubuntu-124.04.1)
OpenJDK 64-Bit Server VM (build 21.0.6+7-Ubuntu-124.04.1, mixed
mode, sharing)
$ mvn -version
Apache Maven 3.8.7
Maven home: /usr/share/maven
Java version: 21.0.6, vendor: Ubuntu, runtime: /usr/lib/jvm/java-21-
openjdk-amd64
Default locale: en_GB, platform encoding: UTF-8
OS name: "linux", version: "6.11.0-21-generic", arch: "amd64",
family: "unix"
I'm building from the command line, no IDE involved. I tried both of
these build commands (one from BUILD.md, another from the GitHub
Actions workflow), with essentially the same result:
mvn clean install -Pdev
mvn -B --file pom.xml -Dmaven.javadoc.skip=true install
Overview:
[ERROR] Tests run: 7901, Failures: 117, Errors: 6452, Skipped: 0
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary for Apache Jena 5.4.0:
[INFO]
[INFO] Apache Jena ........................................ SUCCESS
[ 22.565 s]
[INFO] Apache Jena - IRI .................................. SUCCESS
[ 2.805 s]
[INFO] Apache Jena - IRI3986 .............................. SUCCESS
[ 2.843 s]
[INFO] Apache Jena - Language tags ........................ SUCCESS
[ 1.565 s]
[INFO] Apache Jena - Base ................................. SUCCESS
[ 2.688 s]
[INFO] Apache Jena - Core ................................. SUCCESS
[ 50.171 s]
[INFO] Apache Jena - ARQ .................................. FAILURE
[ 19.121 s]
[INFO] Apache Jena - ONTAPI ............................... SKIPPED
[INFO] Apache Jena - SHACL ................................ SKIPPED
[INFO] Apache Jena - ShEx ................................. SKIPPED
Examples of failures in ARQ tests (there are many more):
[ERROR]
TestNormalization>AbstractTestNormalization.normalize_float_19:108-
>AbstractTestNormalization.normalize:142 » NoClassDefFound Could
not initialize class org.apache.jena.sparql.util.NodeFactoryExtra
[ERROR]
TestNormalization>AbstractTestNormalization.normalize_float_20:109-
>AbstractTestNormalization.normalize:142 » NoClassDefFound Could
not initialize class org.apache.jena.sparql.util.NodeFactoryExtra
[ERROR]
TestNormalization>AbstractTestNormalization.normalize_float_21:110-
>AbstractTestNormalization.normalize:142 » NoClassDefFound Could
not initialize class org.apache.jena.sparql.util.NodeFactoryExtra
...
[ERROR] TestSSE_Builder.testBuildInt_01:73 NoClassDefFound Could
not initialize class org.apache.jena.sparql.sse.SSE
[ERROR] TestSSE_Builder.testBuildInt_02:80 NoClassDefFound Could
not initialize class org.apache.jena.sparql.sse.SSE
[ERROR] TestSSE_Builder.testBuildInt_03:87 NoClassDefFound Could
not initialize class org.apache.jena.sparql.sse.SSE
...
[ERROR] TestRDFStarTranslation.rdfx_01 » NoClassDefFound Could not
initialize class org.apache.jena.system.TestRDFStarTranslation
[ERROR] TestRDFStarTranslation.rdfx_02 » NoClassDefFound Could not
initialize class org.apache.jena.system.TestRDFStarTranslation
[ERROR] TestRDFStarTranslation.rdfx_03 » NoClassDefFound Could not
initialize class org.apache.jena.system.TestRDFStarTranslation
[ERROR] TestRDFStarTranslation.rdfx_04 » NoClassDefFound Could not
initialize class org.apache.jena.system.TestRDFStarTranslation
[ERROR] TestRDFStarTranslation.rdfx_05 » NoClassDefFound Could not
initialize class org.apache.jena.system.TestRDFStarTranslation
Thanks, and sorry for the noise.
--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 15 (Unioninkatu 36)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.suomi...@helsinki.fi
http://www.nationallibrary.fi