'mvn package' build CryptoModuleTest failure
JVD66 opened this issue · 13 comments
Description of the Problem
Good day -
I am attempting to build BaseX under Fedora Core 38 (FC-38) x86_64,
Java Version :
$ java -version
java version "17.0.6" 2023-01-17 LTS
Java(TM) SE Runtime Environment (build 17.0.6+9-LTS-190)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.6+9-LTS-190, mixed mode, sharing)
$ javac -version
javac 17.0.6
$ rpm -qf $(which java)
java-17-openjdk-headless-17.0.9.0.9-3.fc38.x86_64
Maven version:
$ mvn -version
Apache Maven 3.8.6 (Red Hat 3.8.6-4)
Maven home: /usr/share/maven
Java version: 17.0.9, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-17-openjdk-17.0.9.0.9-3.fc38.x86_64
Default locale: en_IE, platform encoding: UTF-8
OS name: "linux", version: "6.6.16-600.fc38.x86_64", arch: "amd64", family: "unix"
openssl{,-devel} version:
OpenSSL 3.0.9 30 May 2023 (Library: OpenSSL 3.0.9 30 May 2023)
I cloned the BaseX GitHub repository, and did:
$ git checkout 9.7.4
to build the latest stable "Release" version.
I am following instructions at: https://docs.basex.org/wiki/Maven -
$ mvn compile
... # succeeds!
$ mvn package
... # FAILS with test failure:
[INFO] Running org.basex.query.func.CryptoModuleTest
org.basex.query.QueryException: Signature exception.
at org.basex.query.QueryError.get(QueryError.java:1442)
at org.basex.query.func.crypto.DigitalSignature.validateSignature(DigitalSignature.java:287)
at org.basex.query.func.crypto.CryptoValidateSignature.item(CryptoValidateSignature.java:17)
at org.basex.query.expr.ParseExpr.value(ParseExpr.java:51)
at org.basex.query.scope.MainModule.value(MainModule.java:97)
at org.basex.query.QueryContext.value(QueryContext.java:336)
at org.basex.query.QueryProcessor.value(QueryProcessor.java:94)
at org.basex.core.Sandbox.eval(Sandbox.java:226)
at org.basex.core.Sandbox.query(Sandbox.java:84)
at org.basex.core.Sandbox.query(Sandbox.java:102)
at org.basex.query.func.CryptoModuleTest.validateSignature(CryptoModuleTest.java:97)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: javax.xml.crypto.MarshalException: It is forbidden to use algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 when secure validation is enabled
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMSignedInfo.(DOMSignedInfo.java:155)
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignature.(DOMXMLSignature.java:141)
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.unmarshal(DOMXMLSignatureFactory.java:193)
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.unmarshalXMLSignature(DOMXMLSignatureFactory.java:148)
at org.basex.query.func.crypto.DigitalSignature.validateSignature(DigitalSignature.java:280)
... 80 more
[ERROR] Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.149 s <<< FAILURE! - in org.basex.query.func.CryptoModuleTest
[ERROR] org.basex.query.func.CryptoModuleTest.validateSignature Time elapsed: 0.118 s <<< FAILURE!
java.lang.AssertionError:
Query failed:
crypto:validate-signature(crypto:generate-signature(, "", "", "", "", ""))
at org.basex.core.Sandbox.query(Sandbox.java:90)
at org.basex.core.Sandbox.query(Sandbox.java:102)
at org.basex.query.func.CryptoModuleTest.validateSignature(CryptoModuleTest.java:97)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:50)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148)
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385)
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162)
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495)
Caused by: org.basex.query.QueryException: Signature exception.
at org.basex.query.QueryError.get(QueryError.java:1442)
at org.basex.query.func.crypto.DigitalSignature.validateSignature(DigitalSignature.java:287)
at org.basex.query.func.crypto.CryptoValidateSignature.item(CryptoValidateSignature.java:17)
at org.basex.query.expr.ParseExpr.value(ParseExpr.java:51)
at org.basex.query.scope.MainModule.value(MainModule.java:97)
at org.basex.query.QueryContext.value(QueryContext.java:336)
at org.basex.query.QueryProcessor.value(QueryProcessor.java:94)
at org.basex.core.Sandbox.eval(Sandbox.java:226)
at org.basex.core.Sandbox.query(Sandbox.java:84)
... 73 more
Caused by: javax.xml.crypto.MarshalException: It is forbidden to use algorithm http://www.w3.org/2000/09/xmldsig#rsa-sha1 when secure validation is enabled
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMSignedInfo.(DOMSignedInfo.java:155)
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignature.(DOMXMLSignature.java:141)
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.unmarshal(DOMXMLSignatureFactory.java:193)
at java.xml.crypto/org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.unmarshalXMLSignature(DOMXMLSignatureFactory.java:148)
at org.basex.query.func.crypto.DigitalSignature.validateSignature(DigitalSignature.java:280)
... 80 more
Before I start digging into the code to determine exactly what is
going on here, I thought I'd ask the list if anyone else has seen
this issue / if anyone could suggest a way to fix it ?
Full logs / further info available on request.
Any suggestions gratefully received.
Best Regards,
Jason Vas Dias (a software developer in Ireland) - Telegram: @JBVD66
Expected Behavior
Build should succeed.
Steps to Reproduce the Behavior
See above
Do you have an idea how to solve the issue?
No response
What is your configuration?
Fedora 38 Linux, x86-64
It seems that a particular cryptographic algorithm is not supported in your setup. You can disable testing as follows:
mvn package -DskipTests
Thanks Christian - but I'd prefer not to have to disable ALL tests -
Is there any way I could disable just the 'CryptoModuleTest' ?
And if the Test is genuinely not available / disabled by FC-38's crypto policy,
then the CryptoModuleTest should be detecting this and not running the test
for that crypto algorithm , or , if it cannot do this, then it should fail with a
'Test Skipped on this Platform' status .
Best Regards,
Jason
Is there any way I could disable just the 'CryptoModuleTest' ?
I'm not sure. Would you be interested in checking out what Maven offers in this regard?
And if the Test is genuinely not available / disabled by FC-38's crypto policy, then the CryptoModuleTest should be detecting this and not running the test for that crypto algorithm
Same here: I’d appreciate a proposal for this, as it’s difficult for us to reproduce your setup.
Thanks
Christian
Thanks, Christian -
OK, I will investigate exactly why the CryptoModule test is failing -
probably to do with default FIPS compliance mode of :
$ rpm -qa '*crypto-pol*' crypto-policies-20230301-1.gita12f7b2.fc38.noarch crypto-policies-scripts-20230301-1.gita12f7b2.fc38.noarch
But, running with that test disabled , and another test failure (GeoModule) disabled -
though I do have geoip installed :
$ rpm -qa '*Geo*' GeoIP-GeoLite-data-2018.06-11.fc38.noarch GeoIP-1.6.12-13.fc38.x86_64
:
$ mvn -Dtest='!org.basex.query.func.CryptoModuleTest,!org.basex.query.func.GeoModuleTest' package 2>&1 | tee mvn.package.2.log
I get a whole host of XQJ errors, as shown below. Downloading and installing :
'http://xqj.net/basex/basex-xqj-1.4.0.zip'
,
and running 'mvn package' with CLASSPATH:
$ export CLASSPATH="${PWD}/basex-core/target/classes:${PWD}/basex-api/target/classes:${PWD}/basex-xqj/lib/basex-xqj-1.4.0.jar:${PWD}/basex-xqj/lib/xqj-api-1.0.jar:${PWD}/basex-xqj/lib/xqj2-0.2.0.jar"
,
using Java :
$ rpm -qf $(which javac) jdk-17-17.0.6-9.x86_64 $ echo $JAVA_HOME /usr/lib/jvm/jdk-17-oracle-x64
did not help - I still get these XQJ errors :
`
[INFO] Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.074 s - in org.basex.query.func.RequestModuleTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] XQJTest.basicTest:51 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQJTest.entityTest:74 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] InsertTest.setUp:27 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] InsertTest.setUp:27 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] InsertTest.setUp:27 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] InsertTest.setUp:27 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testAnyURI:28->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testAttribute:422 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testAttributeURI:449 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testBase64Binary:36->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testBoolean:44->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testByte:52->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testComment:373->nodeTest:492 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDate:60->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDateTime:68->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDayTimeDuration:345->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDecimal:79->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDocumentElement:389->nodeTest:492 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDocumentNode:414->nodeTest:492 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testDouble:87->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testENTITY:95->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testElement:381->nodeTest:492 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testFloat:103->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testGDay:111->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testGMonth:119->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testGMonthDay:127->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testGYear:135->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testGYearMonth:143->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testHexBinary:151->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testID:159->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testIDREF:167->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testInt:175->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testInteger:183->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testLanguage:191->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testLong:199->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testNCName:215->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testNMTOKEN:231->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testName:207->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testNegativeInteger:223->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testNonNegativeInteger:239->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testNonPositiveInteger:248->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testNormalizedString:257->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testPositiveInteger:265->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testProcessingInstruction:397->nodeTest:492 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testQName:273->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testQNameURI:441->uriTest:506 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testShort:281->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testString:289->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testText:406->nodeTest:492 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testTime:297->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testToken:305->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testUnsignedByte:313->atomicTest:474 ? ExceptionInInitializer
[ERROR] XQItemAccessorTest.testUnsignedInt:321->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testUnsignedLong:329->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testUnsignedShort:337->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testUntypedAtomic:353->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQItemAccessorTest.testYearMonthDuration:361->atomicTest:474 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQJConcurrencyTest.testConcurrentInsert:58 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[ERROR] XQJConcurrencyTest.testConcurrentXQuery1to1024 ? NoClassDefFound Could not initialize class net.xqj.basex.bin.u
[INFO]
[ERROR] Tests run: 259, Failures: 0, Errors: 59, Skipped: 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for BaseX 9.7.4:
[INFO]
[INFO] BaseX .............................................. SUCCESS [ 0.003 s]
[INFO] BaseX Core ......................................... SUCCESS [ 39.854 s]
[INFO] BaseX API .......................................... FAILURE [ 5.109 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.151 s
[INFO] Finished at: 2024-03-19T14:51:55Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0:test (default-test) on project basex-api:
`
So, maybe the Crypto and Geo module test failures are due to the same problem -
Oracle Java 17 is default /usr/bin/java Alternative under FC38 - should I be using
a different Java ?
Any other suggestions to try ?
I am trying to investigate performance / pros/cons of using libxml2 XPath
vs. using BaseX XQuery+XPath, in 2 large XML querying projects, currently using either
newer Common Lisp libxml2 or older PERL libxml2 wrappers , which must query potentially
about 1GB of locally cached Web-Resident XML Files, (DOT TransXChange, NAPTAN
and Siri/VM feeds for UK transport stops, vehicles and terminii and schedules), and are currently quite slow
and cumbersome to use - I am investigating converting to using BaseX + XQuery +
writing a PicoLisp Java BaseX API wrapper (my favorite scripting language, which has
a Java FFI helper module), or Common Lisp, for Server API BaseX wrapper code,
and a NodeJS / (possibly Common Lisp cljs generated) browser JS querying library using this
server library code via XMLHttpRequest() invocations for Client web-page querying & display code in
HTML5 GUI pages.
But getting started with BaseX is proving to be quite problematic due to these missing dependencies /
linux distro incompatibilities. Your advice on how to resolve above would be much appreciated,
then I can pin down exactly why the CryptoModule Test is failing once I can get a version that at
least builds & passes its test suite.
Thanks for your feedback.
Support for older versions of BaseX (including 9.x) is currently limited to commercial customers. Have you already tried BaseX 10 or the latest 11 snapshot?
If you are mostly interested in comparing BaseX with other libraries, and if you don’t need the libraries that cause the problems you reported, I still believe the easiest option will be to disable testing.
What Java version would you recommend building with ?
Is there a GIT repo for basex-xqj ?
What Java version would you recommend building with ?
JDK 11 (
Lines 27 to 36 in a1304da
Is there a GIT repo for basex-xqj ?
I don’t think so; it’s closed source (http://xqj.net).
One of my rules is not to write or use software that can't pass a basic test suite.
However, it does not look too difficult - somehow the binary objects in the XQJ Jars
are not being JIT compiled properly for my Linux version and will not load.
I think I just need to re-build XQJ ?
I am using 'main' branch now, just updated now, to BaseX 11.0-SNAPSHOT .
There is a whole host of other errors now - see attached 'mvn.package.3.log' .
mvn.package.3.log
Mainly :
Running org.basex.query.up.UpdateTest org.basex.query.QueryException: Database 'DBTransform' was not found.
org.opentest4j.AssertionFailedError: Query failed: for $voc in 1 to 2 let $xml := db:get("DBTransform")return $xml update { for $i in 1 to 2 return insert node $xml/instance/data/vocable[@hits = '1'] into ./instance}
Running org.basex.query.ft.FTIndexQueryTest org.basex.query.QueryException: .: Context value is undefined.
[ERROR] org.basex.query.ft.FTIndexQueryTest.test -- Time elapsed: 0.132 s <<< FAILURE! org.opentest4j.AssertionFailedError: 160 Errors. [E] = expected, [F] = found:
But no XQJ errors - I guess it bombed out before running them ?
OK, I am now using Oracle Java 11 JDK SE, and have checkout out v10.7 -
only 2 errors now, but I think this is because it bombed out again before attempting the XQJ tests ?
Error 1:
[INFO] Running org.basex.query.up.UpdateTest org.basex.query.QueryException: Database 'DBTransform' was not found.
Error 2:
`[ERROR] Failures:
[ERROR] FTIndexQueryTest>QueryTest.test:65 160 Errors. [E] = expected, [F] = found:
`
Am I meant to create some 'DBTransform' database somehow before building ?
I hope the problems have been resolved. If not, feel free to reopen the issue.