You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Rob Vesse (JIRA)" <ji...@apache.org> on 2018/03/28 10:44:00 UTC
[jira] [Commented] (JENA-1513) ResultSetLang.init() not called when
necessary
[ https://issues.apache.org/jira/browse/JENA-1513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16417151#comment-16417151 ]
Rob Vesse commented on JENA-1513:
---------------------------------
This has been fixed for a long time. If you are experiencing this with current versions then your application is blocking system initialisation somehow - https://jena.apache.org/documentation/notes/system-initialization.html
Are you repackaging the JARs somehow? In which case you need to ensure that {{ServiceLoader}} manifests are being appropriately combined e.g. by using [ServicesResourceTransformer|https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html#ServicesResourceTransformer] as Jena uses these to decide what to initialise
Or you can explicitly call {{JenaSystem.init()}} at the entry point for your application, however if the necessary manifests are missing you can still end up with broken initialisation since this internally relies upon service manifests
> ResultSetLang.init() not called when necessary
> ----------------------------------------------
>
> Key: JENA-1513
> URL: https://issues.apache.org/jira/browse/JENA-1513
> Project: Apache Jena
> Issue Type: Bug
> Components: ARQ
> Affects Versions: Jena 3.6.0
> Reporter: Elie Roux
> Priority: Major
>
> This seems to be similar to [1264|https://issues.apache.org/jira/browse/JENA-1264]:
> When I execute:
> {code:java}
> public void testInit() {
> String sparqljson = "{\n" +
> " \"head\" : {\n" +
> " \"vars\" : [ \"work\" ]\n" +
> " },\n" +
> " \"results\" : {\n" +
> " \"bindings\" : [ ]\n" +
> " }\n" +
> "}";
> InputStream stream = new ByteArrayInputStream(sparqljson.getBytes(StandardCharsets.UTF_8));
> //ResultSetLang.init();
> ResultSet res = ResultSetMgr.read(stream, ResultSetLang.SPARQLResultSetJSON);
> }{code}
> I'm getting
> {code:java}
> org.apache.jena.riot.RiotException: No parser registered for content type: application/sparql-results+json
> at org.apache.jena.riot.ResultSetMgr.process(ResultSetMgr.java:89)
> at org.apache.jena.riot.ResultSetMgr.read(ResultSetMgr.java:52){code}
> while when I uncomment
> {code:java}
> ResultSetLang.init();{code}
> the error disappears.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)