sszuev opened a new issue, #1556:
URL: https://github.com/apache/jena/issues/1556

   ### Version
   
   4.6.1
   
   ### What happened?
   
   ```
   java 11.0.15 2022-04-19 LTS
   Java(TM) SE Runtime Environment 18.9 (build 11.0.15+8-LTS-149)
   Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.15+8-LTS-149, mixed mode)
   ------------------------------------------------------------
   Gradle 7.4.2
   ------------------------------------------------------------
   
   Build time:   2022-03-31 15:25:29 UTC
   Revision:     540473b8118064efcc264694cbcaa4b677f61041
   
   Kotlin:       1.5.31
   Groovy:       3.0.9
   Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
   JVM:          11.0.15 (Oracle Corporation 11.0.15+8-LTS-149)
   OS:           Linux 5.10.16.3-microsoft-standard-WSL2 amd64
   ```
   Commands to build & run:
   ```bash
   $ gradle clean build
   $ java -jar build/libs/test-jena-init-1.0-SNAPSHOT.jar
   ```
   Test app:
   ```kotlin
   package com.gitlab.sszuev.investigation
   
   import org.apache.jena.query.QueryExecution
   
   object JenaInitInvestigation {
       init {
           org.apache.jena.sys.JenaSystem.init()
           //org.apache.jena.riot.RIOT.init()
           //org.apache.jena.query.ARQ.init()
       }
   
       @JvmStatic
       fun main(args: Array<String>) {
           println("Go")
           val endpoint = "http://xxx.example.com/sparql";
           val queryString = "CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }"
           val m = 
QueryExecution.service(endpoint).query(queryString).build().execConstruct()
           println(m.size())
       }
   }
   ```
   build.gradle
   ```gradle
   plugins {
       id "org.jetbrains.kotlin.jvm" version "1.7.10"
   }
   
   group 'com.gitlab.sszuev'
   version '1.0-SNAPSHOT'
   
   repositories {
       mavenCentral()
   }
   
   dependencies {
       implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', 
version: '1.7.10'
       implementation 'org.apache.jena:jena-arq:4.6.1'
   }
   
   jar {
       zip64 true
       manifest {
           attributes(
                   'Main-Class': 
'com.gitlab.sszuev.investigation.JenaInitInvestigation',
                   'Implementation-Title': 'JenaInitTesting',
                   'Implementation-Version': archiveVersion,
                   "Multi-Release": true,
                   "Manifest-Version": "1.0",
           )
       }
       duplicatesStrategy = 'include'
       from {
           configurations.runtimeClasspath.collect {
               it.isDirectory() ? it : zipTree(it)
           }
       }
   }
   ```
   workaround - uncomment following lines:
   ```kotlin
   org.apache.jena.riot.RIOT.init()
   org.apache.jena.query.ARQ.init()
   ```
   
   project: 
   
[test-jena-init.tar.gz](https://github.com/apache/jena/files/9656288/test-jena-init.tar.gz)
   
   
   
   ### Relevant output and stacktrace
   
   ```shell
   Exception in thread "main" java.lang.NullPointerException
           at org.apache.jena.query.ARQ.isTrue(ARQ.java:680)
           at 
org.apache.jena.sparql.lang.QueryParserBase.<init>(QueryParserBase.java:322)
           at 
org.apache.jena.sparql.lang.SPARQLParserBase.<init>(SPARQLParserBase.java:40)
           at 
org.apache.jena.sparql.lang.arq.ARQParserBase.<init>(ARQParserBase.java:35)
           at 
org.apache.jena.sparql.lang.arq.ARQParser.<init>(ARQParser.java:8071)
           at org.apache.jena.sparql.lang.ParserARQ.perform(ParserARQ.java:90)
           at org.apache.jena.sparql.lang.ParserARQ.parse$(ParserARQ.java:52)
           at 
org.apache.jena.sparql.lang.SPARQLParser.parse(SPARQLParser.java:33)
           at org.apache.jena.query.QueryFactory.parse(QueryFactory.java:144)
           at org.apache.jena.query.QueryFactory.create(QueryFactory.java:83)
           at org.apache.jena.query.QueryFactory.create(QueryFactory.java:56)
           at org.apache.jena.query.QueryFactory.create(QueryFactory.java:44)
           at 
org.apache.jena.http.sys.ExecHTTPBuilder.query(ExecHTTPBuilder.java:89)
           at 
com.gitlab.sszuev.investigation.JenaInitInvestigation.main(JenaInitInvestigation.kt:17)
   ```
   
   
   ### Are you interested in making a pull request?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to