marklogic / marklogic-jena

Adapter for using MarkLogic with the Jena RDF Framework
Other
5 stars 11 forks source link

[REGR]nullpointer in MarklogicQueryEngine.eval #36

Closed kkanthet closed 8 years ago

kkanthet commented 8 years ago

Regression in Jena SPARQLUpdate tests, seeing nullpointer in MarklogicQueryEngine.eval following tests failing com.marklogic.jena.functionaltests.JenaSPARQLUpdateTests.testPagination() com.marklogic.jena.functionaltests.JenaSPARQLUpdateTests.test001ConstructQuery_withbinding()

com.marklogic.semantics.jena.engine.MarkLogicQueryEngineTest > testDescribe FAILED java.lang.NullPointerException at MarkLogicQueryEngineTest.java:96

Note:: started happening since 03/02 nightly due to :: https://bugtrack.marklogic.com/bug/35433 Similar issue in sesame

java.lang.NullPointerException
    at java.io.Reader.<init>(Reader.java:78)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:129)
    at org.apache.jena.atlas.io.IO.asUTF8(IO.java:92)
    at org.apache.jena.atlas.io.PeekReader.makeUTF8(PeekReader.java:88)
    at org.apache.jena.atlas.json.io.parser.JSONParser.parse(JSONParser.java:38)
    at org.apache.jena.atlas.json.JSON._parse(JSON.java:140)
    at org.apache.jena.atlas.json.JSON.parse(JSON.java:37)
    at com.hp.hpl.jena.sparql.resultset.JSONInput.parse(JSONInput.java:125)
    at com.hp.hpl.jena.sparql.resultset.JSONInput.process(JSONInput.java:109)
    at com.hp.hpl.jena.sparql.resultset.JSONInput.fromJSON(JSONInput.java:66)
    at com.marklogic.semantics.jena.engine.MarkLogicQueryEngine.eval(MarkLogicQueryEngine.java:204)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.evaluate(QueryEngineBase.java:137)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:107)
    at com.hp.hpl.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:88)
    at com.marklogic.semantics.jena.engine.MarkLogicQueryEngine$MarkLogicQueryEngineFactory.create(MarkLogicQueryEngine.java:232)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:547)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:491)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:532)
    at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:183)
    at com.marklogic.jena.functionaltests.JenaSPARQLUpdateTests.testPagination(JenaSPARQLUpdateTests.java:881)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
grechaw commented 8 years ago

jena project should really work with either version of the server code to avoid backward incompat.

grechaw commented 8 years ago

I know why this bug happens. I think I need to special case empty sequence for n-triples. Either that or serialization from xdmp output method has to change. In either event, I'll make a new bug to cover this.

grechaw commented 8 years ago

Upon review of the specification for n-triples, RDF 1.1 was updated to not require the '.' for an empty set of triples. I'll look at other workarounds.

grechaw commented 8 years ago

In order to provide compatibility with jena 2 I think we'll just have to implement the '.' for empty n-triples serializations. It's not hard to do, and can be removed in the future.

grechaw commented 8 years ago

Now I'm going to propose a fix we can implement in marklogic-jena now, because the server is not really broken.

kkanthet commented 8 years ago

Verified the issue is fixed and nor longer get nullpointer