You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Lewis John Mcgibbney <le...@gmail.com> on 2013/08/02 01:06:16 UTC

NPE when submitting query to Jena

Hi,
For an in house R&D project, I've recently been working with adding some
functionality to the Fuseki UI.

First I start the server

law@lawx:~/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT$
./fuseki-server --update --mem /susman
14:15:45 INFO  Server               :: Dataset: in-memory
14:15:45 INFO  Config               :: Home Directory:
/home/law/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT
14:15:45 INFO  Server               :: Dataset path = /susman
14:15:45 INFO  Server               :: Fuseki 0.2.8-SNAPSHOT
2013-08-01T14:15:02-0700
14:15:45 INFO  Server               :: Started 2013/08/01 14:15:45 PDT on
port 3030

Then I manually upload some triples from four different OWL files

14:16:27 INFO  Fuseki               :: [1] POST
http://localhost:3030/susman/upload
14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
AssemblyProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
AutomobileManufacturing.owl, Content-Type=text/xml, Charset=null => RDF/XML
14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
JoiningProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
MaterialHandlingEquipment.owl, Content-Type=text/xml, Charset=null =>
RDF/XML
14:16:27 INFO  Fuseki               :: [1] Upload: Graph: default (1148
triple(s))
14:16:27 INFO  Fuseki               :: [1] 200 OK (306 ms)

But I am experiencing a real nasty issue when I attempt to execute a query
via the "Get Results" button. My query is as follows

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX mheq: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
>
DESCRIBE ?individual
WHERE {
 ?individual rdf:type mheq:BeltConveyor.
}

I get the following

14:16:44 INFO  Fuseki               :: [2] GET
http://localhost:3030/sparql?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+mheq%3A+%3Chttp%3A%2F%2Feil.stanford.edu%3A443%2Fsvn%2Feil-repo%2FUsers%2FLewis%2Fontology%2FMaterialHandlingEquipment.owl%23%3E%0D%0ADESCRIBE+%3Findividual%0D%0AWHERE+%7B%0D%0A+%3Findividual+rdf%3Atype+mheq%3ABeltConveyor.++%0D%0A%7D++&default-graph-uri=&output=json&stylesheet=%2Fxml-to-html.xsl
14:16:44 WARN  Fuseki               :: [2] RC = 500 : null
java.lang.NullPointerException
    at
org.apache.jena.fuseki.servlets.SPARQL_ServletBase.mapRequestToService(SPARQL_ServletBase.java:311)
    at
org.apache.jena.fuseki.servlets.SPARQL_ServletBase.execCommonWorker(SPARQL_ServletBase.java:153)
    at
org.apache.jena.fuseki.servlets.SPARQL_ServletBase.doCommon(SPARQL_ServletBase.java:78)
    at
org.apache.jena.fuseki.servlets.SPARQL_Query.doGet(SPARQL_Query.java:64)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
    at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
    at
org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)
    at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:294)
    at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
    at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
    at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
    at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
    at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
    at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
    at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at
org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
    at
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
    at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at
org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
    at
org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:724)
14:16:44 INFO  Fuseki               :: [2] 500 Server Error (3 ms)

So line 311 of SPARQL_ServletBase.mapRequestToService(DatasetRef dsRef,
String uri, String serviceName) looks like this...

        if ( dsRef.name.length() >= uri.length() )

A confession here is that I've come to the list before I begin debugging
this in Eclipse... which is where I am working on the code.
Has anyone had problems with "Getting Results" within the Fuseki WebApp
before e.g. has anyone seen a NPE around SPARQL_ServletBase before?
A quick look through the archives did not bring anything up for me so I'm
sending it here in parallel with DEBUG'ing the code myself.

Thanks in advance

Best
Lewis


-- 
*Lewis*

Re: NPE when submitting query to Jena

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Quick follow up...
I moved my code to the .tpl file, selected the dataset I wished to use...
and it all works swimmingly (HA HA).
Seriously though, all seems to be good and I am getting much better results.
Thanks


On Sun, Aug 4, 2013 at 6:25 PM, Lewis John Mcgibbney <
lewis.mcgibbney@gmail.com> wrote:

> Hi Andy,
>
> On Fri, Aug 2, 2013 at 3:25 AM, Andy Seaborne <an...@apache.org> wrote:
>
>> https://issues.apache.org/**jira/browse/JENA-497<https://issues.apache.org/jira/browse/JENA-497>
>>
>
> You've hit the nail right on the head here.
>
>
>>
>> The issue is that you are using sparql.html -- "General SPARQL Service"
>> on the front page.
>>
>
> Yes, this is the form that I have amended to pull my front end together. I
> drag and drop queries... which is all working quite nicely.
>
>
>> It is a form to send a query to the server which is not associated with
>> any datasets.
>
>
> And this causes the NPE.
>
>
>> You have to use "Target graph URI" or put FROM NAMED? in query and the
>> server will load the data for that query only.
>>
>
> OK so using the *sparql.tpl* form I write the following query
>
>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX mheq: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
> >
> DESCRIBE ?individual
> FROM NAMED <MaterialHandlingEquipment.owl>
>
> WHERE {
>  ?individual rdf:type mheq:BeltConveyor.
> }
>
> Which works fine, I get my results.
>
> @prefix :      <http://www.owl-ontologies.com/Ontology1357168977.owl#> .
> @prefix protege: <http://protege.stanford.edu/plugins/owl/protege#> .
> @prefix RemoteI: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#RemoteI/>
> .
> @prefix xsp:   <http://www.owl-ontologies.com/2005/08/07/xsp.owl#> .
> @prefix LR_Mate_200iB-200iB: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#LR_Mate_200iB-200iB/3>
> .
> @prefix mheq:  <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
> .
> @prefix AssemblyProcess: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/AssemblyProcess.owl#>
> .
> @prefix I:     <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#I/>
> .
> @prefix MaterialHandlingEquipment: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
> .
> @prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix swrl:  <http://www.w3.org/2003/11/swrl#> .
> @prefix JoiningProcess: <
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/JoiningProcess.owl#>
> .
> @prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
> @prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
> @prefix owl:   <http://www.w3.org/2002/07/owl#> .
> @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>
> MaterialHandlingEquipment:ModelTA_Horizontal_Belt_Conveyor
>         a             owl:NamedIndividual ,
> MaterialHandlingEquipment:BeltConveyor ;
>         rdfs:comment  "The ModelTA_Horizontal_Belt_Conveyor individual is
> a representation of the product located a
> http://www.gilmorekramer.com/more_info/hytrol_ta_conveyor/hytrol_ta_conveyor.shtml.
> Data type propoerty associations are made in accordance with the power
> calculation methodology located in \"ENERGY MANAGEMENT\nSERIES 17, FOR
> INDUSTRY COMMERCE AND INSTITUTIONS, Materials Handling and On-Site
> Transportation Equipment, Canada."^^xsd:string ;
>         MaterialHandlingEquipment:hasCentreToCentreDistanceBetweenRollers
>                 "0.0"^^xsd:double ;
>         MaterialHandlingEquipment:hasCoefficientOfFriction
>                 "0.3"^^xsd:double ;
>         MaterialHandlingEquipment:hasConveyorAngleOfIncline
>                 "20.0"^^xsd:double ;
>         MaterialHandlingEquipment:hasConveyorLength
>                 "30.0"^^xsd:double ;
>         MaterialHandlingEquipment:hasConveyorProductLoading
>                 "36.0"^^xsd:double ;
>         MaterialHandlingEquipment:hasConveyorSpeed
>                 "0.508"^^xsd:double ;
>         MaterialHandlingEquipment:hasConveyorWidthBetweenFrames
>                 "0.84"^^xsd:double .
>
> I cannot achieve these results from the *sparql.html* form though even
> though I specify FROM NAMED in my query. I still get the NPE.
> The problem is that I do not know that syntax for the Target Graph URI
> e.g. http://localhost:3030/susman/data?graph=...
>
> *susman is the in memory dataset I used when I started the Fuseki server
> - ./fuseki-server --update --mem /susman
>
> I am nearly there with this one. Some last guidance would be really
> appreciated.
> Thank you so much.
> Lewis
>
>


-- 
*Lewis*

Re: NPE when submitting query to Jena

Posted by Lewis John Mcgibbney <le...@gmail.com>.
Hi Andy,

On Fri, Aug 2, 2013 at 3:25 AM, Andy Seaborne <an...@apache.org> wrote:

> https://issues.apache.org/**jira/browse/JENA-497<https://issues.apache.org/jira/browse/JENA-497>
>

You've hit the nail right on the head here.


>
> The issue is that you are using sparql.html -- "General SPARQL Service" on
> the front page.
>

Yes, this is the form that I have amended to pull my front end together. I
drag and drop queries... which is all working quite nicely.


> It is a form to send a query to the server which is not associated with
> any datasets.


And this causes the NPE.


> You have to use "Target graph URI" or put FROM NAMED? in query and the
> server will load the data for that query only.
>

OK so using the *sparql.tpl* form I write the following query

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX mheq: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
>
DESCRIBE ?individual
FROM NAMED <MaterialHandlingEquipment.owl>
WHERE {
 ?individual rdf:type mheq:BeltConveyor.
}

Which works fine, I get my results.

@prefix :      <http://www.owl-ontologies.com/Ontology1357168977.owl#> .
@prefix protege: <http://protege.stanford.edu/plugins/owl/protege#> .
@prefix RemoteI: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#RemoteI/>
.
@prefix xsp:   <http://www.owl-ontologies.com/2005/08/07/xsp.owl#> .
@prefix LR_Mate_200iB-200iB: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#LR_Mate_200iB-200iB/3>
.
@prefix mheq:  <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
.
@prefix AssemblyProcess: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/AssemblyProcess.owl#>
.
@prefix I:     <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#I/>
.
@prefix MaterialHandlingEquipment: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#>
.
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix swrl:  <http://www.w3.org/2003/11/swrl#> .
@prefix JoiningProcess: <
http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/JoiningProcess.owl#>
.
@prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

MaterialHandlingEquipment:ModelTA_Horizontal_Belt_Conveyor
        a             owl:NamedIndividual ,
MaterialHandlingEquipment:BeltConveyor ;
        rdfs:comment  "The ModelTA_Horizontal_Belt_Conveyor individual is a
representation of the product located a
http://www.gilmorekramer.com/more_info/hytrol_ta_conveyor/hytrol_ta_conveyor.shtml.
Data type propoerty associations are made in accordance with the power
calculation methodology located in \"ENERGY MANAGEMENT\nSERIES 17, FOR
INDUSTRY COMMERCE AND INSTITUTIONS, Materials Handling and On-Site
Transportation Equipment, Canada."^^xsd:string ;
        MaterialHandlingEquipment:hasCentreToCentreDistanceBetweenRollers
                "0.0"^^xsd:double ;
        MaterialHandlingEquipment:hasCoefficientOfFriction
                "0.3"^^xsd:double ;
        MaterialHandlingEquipment:hasConveyorAngleOfIncline
                "20.0"^^xsd:double ;
        MaterialHandlingEquipment:hasConveyorLength
                "30.0"^^xsd:double ;
        MaterialHandlingEquipment:hasConveyorProductLoading
                "36.0"^^xsd:double ;
        MaterialHandlingEquipment:hasConveyorSpeed
                "0.508"^^xsd:double ;
        MaterialHandlingEquipment:hasConveyorWidthBetweenFrames
                "0.84"^^xsd:double .

I cannot achieve these results from the *sparql.html* form though even
though I specify FROM NAMED in my query. I still get the NPE.
The problem is that I do not know that syntax for the Target Graph URI e.g.
http://localhost:3030/susman/data?graph=...

*susman is the in memory dataset I used when I started the Fuseki server  -
./fuseki-server --update --mem /susman

I am nearly there with this one. Some last guidance would be really
appreciated.
Thank you so much.
Lewis

Re: NPE when submitting query to Jena

Posted by Andy Seaborne <an...@apache.org>.
https://issues.apache.org/jira/browse/JENA-497

The issue is that you are using sparql.html -- "General SPARQL Service" 
on the front page.

It is a form to send a query to the server which is not associated with 
any datasets. You have to use "Target graph URI" or put FROM NAMED? in 
query and the server will load the data for that query only.

Or you are programmatically sending a query to 
http://locahost:3030/sparql -- no dataset name -- which is effectively 
what the form does.

The new dispatch code gets this all wrong. (It's not a commonly used 
path - especially from the form.)

Workaround : use "Control Panel" -> your dataset -> ....

	Andy

On 02/08/13 07:41, Claude Warren wrote:
> Lewis,
>
> I just responded to your later post so if you follow that look at where the
> dsRef is being constructed in the servlet configuration code.  I expect
> that for some reason the dataset name is missing.  Perhaps it is missing in
> your assembler file?
>
> Claude
>
>
> On Fri, Aug 2, 2013 at 12:06 AM, Lewis John Mcgibbney <
> lewis.mcgibbney@gmail.com> wrote:
>
>> Hi,
>> For an in house R&D project, I've recently been working with adding some
>> functionality to the Fuseki UI.
>>
>> First I start the server
>>
>> law@lawx
>> :~/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT$
>> ./fuseki-server --update --mem /susman
>> 14:15:45 INFO  Server               :: Dataset: in-memory
>> 14:15:45 INFO  Config               :: Home Directory:
>>
>> /home/law/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT
>> 14:15:45 INFO  Server               :: Dataset path = /susman
>> 14:15:45 INFO  Server               :: Fuseki 0.2.8-SNAPSHOT
>> 2013-08-01T14:15:02-0700
>> 14:15:45 INFO  Server               :: Started 2013/08/01 14:15:45 PDT on
>> port 3030
>>
>> Then I manually upload some triples from four different OWL files
>>
>> 14:16:27 INFO  Fuseki               :: [1] POST
>> http://localhost:3030/susman/upload
>> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
>> AssemblyProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
>> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
>> AutomobileManufacturing.owl, Content-Type=text/xml, Charset=null => RDF/XML
>> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
>> JoiningProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
>> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
>> MaterialHandlingEquipment.owl, Content-Type=text/xml, Charset=null =>
>> RDF/XML
>> 14:16:27 INFO  Fuseki               :: [1] Upload: Graph: default (1148
>> triple(s))
>> 14:16:27 INFO  Fuseki               :: [1] 200 OK (306 ms)
>>
>> But I am experiencing a real nasty issue when I attempt to execute a query
>> via the "Get Results" button. My query is as follows
>>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>> PREFIX mheq: <
>>
>> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
>>>
>> DESCRIBE ?individual
>> WHERE {
>>   ?individual rdf:type mheq:BeltConveyor.
>> }
>>
>> I get the following
>>
>> 14:16:44 INFO  Fuseki               :: [2] GET
>>
>> http://localhost:3030/sparql?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+mheq%3A+%3Chttp%3A%2F%2Feil.stanford.edu%3A443%2Fsvn%2Feil-repo%2FUsers%2FLewis%2Fontology%2FMaterialHandlingEquipment.owl%23%3E%0D%0ADESCRIBE+%3Findividual%0D%0AWHERE+%7B%0D%0A+%3Findividual+rdf%3Atype+mheq%3ABeltConveyor.++%0D%0A%7D++&default-graph-uri=&output=json&stylesheet=%2Fxml-to-html.xsl
>> 14:16:44 WARN  Fuseki               :: [2] RC = 500 : null
>> java.lang.NullPointerException
>>      at
>>
>> org.apache.jena.fuseki.servlets.SPARQL_ServletBase.mapRequestToService(SPARQL_ServletBase.java:311)
>>      at
>>
>> org.apache.jena.fuseki.servlets.SPARQL_ServletBase.execCommonWorker(SPARQL_ServletBase.java:153)
>>      at
>>
>> org.apache.jena.fuseki.servlets.SPARQL_ServletBase.doCommon(SPARQL_ServletBase.java:78)
>>      at
>> org.apache.jena.fuseki.servlets.SPARQL_Query.doGet(SPARQL_Query.java:64)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>>      at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
>>      at
>>
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
>>      at
>>
>> org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)
>>      at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:294)
>>      at
>>
>> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
>>      at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
>>      at
>>
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
>>      at
>>
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
>>      at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
>>      at
>>
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>>      at
>>
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
>>      at
>>
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>>      at
>>
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>>      at org.eclipse.jetty.server.Server.handle(Server.java:370)
>>      at
>>
>> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
>>      at
>>
>> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
>>      at
>>
>> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
>>      at
>>
>> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
>>      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
>>      at
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
>>      at
>>
>> org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
>>      at
>>
>> org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298)
>>      at
>>
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>>      at
>>
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>>      at java.lang.Thread.run(Thread.java:724)
>> 14:16:44 INFO  Fuseki               :: [2] 500 Server Error (3 ms)
>>
>> So line 311 of SPARQL_ServletBase.mapRequestToService(DatasetRef dsRef,
>> String uri, String serviceName) looks like this...
>>
>>          if ( dsRef.name.length() >= uri.length() )
>>
>> A confession here is that I've come to the list before I begin debugging
>> this in Eclipse... which is where I am working on the code.
>> Has anyone had problems with "Getting Results" within the Fuseki WebApp
>> before e.g. has anyone seen a NPE around SPARQL_ServletBase before?
>> A quick look through the archives did not bring anything up for me so I'm
>> sending it here in parallel with DEBUG'ing the code myself.
>>
>> Thanks in advance
>>
>> Best
>> Lewis
>>
>>
>> --
>> *Lewis*
>>
>
>
>


Re: NPE when submitting query to Jena

Posted by Claude Warren <cl...@xenei.com>.
Lewis,

I just responded to your later post so if you follow that look at where the
dsRef is being constructed in the servlet configuration code.  I expect
that for some reason the dataset name is missing.  Perhaps it is missing in
your assembler file?

Claude


On Fri, Aug 2, 2013 at 12:06 AM, Lewis John Mcgibbney <
lewis.mcgibbney@gmail.com> wrote:

> Hi,
> For an in house R&D project, I've recently been working with adding some
> functionality to the Fuseki UI.
>
> First I start the server
>
> law@lawx
> :~/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT$
> ./fuseki-server --update --mem /susman
> 14:15:45 INFO  Server               :: Dataset: in-memory
> 14:15:45 INFO  Config               :: Home Directory:
>
> /home/law/Downloads/Lewis/code/essem-fuseki/target/essem-fuseki-0.2.8-SNAPSHOT
> 14:15:45 INFO  Server               :: Dataset path = /susman
> 14:15:45 INFO  Server               :: Fuseki 0.2.8-SNAPSHOT
> 2013-08-01T14:15:02-0700
> 14:15:45 INFO  Server               :: Started 2013/08/01 14:15:45 PDT on
> port 3030
>
> Then I manually upload some triples from four different OWL files
>
> 14:16:27 INFO  Fuseki               :: [1] POST
> http://localhost:3030/susman/upload
> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
> AssemblyProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
> AutomobileManufacturing.owl, Content-Type=text/xml, Charset=null => RDF/XML
> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
> JoiningProcess.owl, Content-Type=text/xml, Charset=null => RDF/XML
> 14:16:27 INFO  Fuseki               :: [1] Upload: Filename:
> MaterialHandlingEquipment.owl, Content-Type=text/xml, Charset=null =>
> RDF/XML
> 14:16:27 INFO  Fuseki               :: [1] Upload: Graph: default (1148
> triple(s))
> 14:16:27 INFO  Fuseki               :: [1] 200 OK (306 ms)
>
> But I am experiencing a real nasty issue when I attempt to execute a query
> via the "Get Results" button. My query is as follows
>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX mheq: <
>
> http://eil.stanford.edu:443/svn/eil-repo/Users/Lewis/ontology/MaterialHandlingEquipment.owl#
> >
> DESCRIBE ?individual
> WHERE {
>  ?individual rdf:type mheq:BeltConveyor.
> }
>
> I get the following
>
> 14:16:44 INFO  Fuseki               :: [2] GET
>
> http://localhost:3030/sparql?query=PREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+mheq%3A+%3Chttp%3A%2F%2Feil.stanford.edu%3A443%2Fsvn%2Feil-repo%2FUsers%2FLewis%2Fontology%2FMaterialHandlingEquipment.owl%23%3E%0D%0ADESCRIBE+%3Findividual%0D%0AWHERE+%7B%0D%0A+%3Findividual+rdf%3Atype+mheq%3ABeltConveyor.++%0D%0A%7D++&default-graph-uri=&output=json&stylesheet=%2Fxml-to-html.xsl
> 14:16:44 WARN  Fuseki               :: [2] RC = 500 : null
> java.lang.NullPointerException
>     at
>
> org.apache.jena.fuseki.servlets.SPARQL_ServletBase.mapRequestToService(SPARQL_ServletBase.java:311)
>     at
>
> org.apache.jena.fuseki.servlets.SPARQL_ServletBase.execCommonWorker(SPARQL_ServletBase.java:153)
>     at
>
> org.apache.jena.fuseki.servlets.SPARQL_ServletBase.doCommon(SPARQL_ServletBase.java:78)
>     at
> org.apache.jena.fuseki.servlets.SPARQL_Query.doGet(SPARQL_Query.java:64)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>     at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
>     at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
>     at
>
> org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:82)
>     at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:294)
>     at
>
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
>     at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
>     at
>
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
>     at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
>     at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
>     at
>
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>     at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
>     at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>     at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>     at org.eclipse.jetty.server.Server.handle(Server.java:370)
>     at
>
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
>     at
>
> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
>     at
>
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
>     at
>
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
>     at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
>     at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
>     at
>
> org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
>     at
>
> org.eclipse.jetty.server.nio.BlockingChannelConnector$BlockingChannelEndPoint.run(BlockingChannelConnector.java:298)
>     at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>     at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>     at java.lang.Thread.run(Thread.java:724)
> 14:16:44 INFO  Fuseki               :: [2] 500 Server Error (3 ms)
>
> So line 311 of SPARQL_ServletBase.mapRequestToService(DatasetRef dsRef,
> String uri, String serviceName) looks like this...
>
>         if ( dsRef.name.length() >= uri.length() )
>
> A confession here is that I've come to the list before I begin debugging
> this in Eclipse... which is where I am working on the code.
> Has anyone had problems with "Getting Results" within the Fuseki WebApp
> before e.g. has anyone seen a NPE around SPARQL_ServletBase before?
> A quick look through the archives did not bring anything up for me so I'm
> sending it here in parallel with DEBUG'ing the code myself.
>
> Thanks in advance
>
> Best
> Lewis
>
>
> --
> *Lewis*
>



-- 
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
Identity: https://www.identify.nu/user.php?claude@xenei.com
LinkedIn: http://www.linkedin.com/in/claudewarren