You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by June <zh...@gmail.com> on 2012/01/14 02:58:27 UTC

SocketException in querying endpoint

Dear list,

I got an exception (HttpException: java.net.SocketException: Connection 
reset) when I try to query through dbpedia endpoint.
I already set the timeout parameter, and I can access and query in 
"http://dbpedia.org/sparql" through browser. What might be the problem?
------------------Code-----------------------------------------
         com.hp.hpl.jena.query.Query query = QueryFactory.create(ask);
         QueryExecution qexec = QueryExecutionFactory.sparqlService(
                 "http://dbpedia.org/sparql", query);

         ((QueryEngineHTTP)qexec).addParam("timeout", "60000") ;
         boolean rs = qexec.execAsk();

-------------------Exception------------------------------------
Exception in thread "AWT-EventQueue-0" HttpException: 
java.net.SocketException: Connection reset: java.net.SocketException: 
Connection reset
     at 
com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:333)
     at 
com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:189)
     at 
com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:144)
     at 
com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk(QueryEngineHTTP.java:169)


best regards,

June

----------------
Zhu Man, (+86)13851764837
School of Computer Science&  Engineering
Southeast University, Nanjing


Re: SocketException in querying endpoint

Posted by June <zh...@gmail.com>.
On 01/14/2012 09:13 PM, Andy Seaborne wrote:
> On 14/01/12 12:09, Dave Reynolds wrote:
>> On 14/01/12 01:58, June wrote:
>>> Dear list,
>>>
>>> I got an exception (HttpException: java.net.SocketException: Connection
>>> reset) when I try to query through dbpedia endpoint.
>>> I already set the timeout parameter, and I can access and query in
>>> "http://dbpedia.org/sparql" through browser. What might be the problem?
>>> ------------------Code-----------------------------------------
>>> com.hp.hpl.jena.query.Query query = QueryFactory.create(ask);
>>> QueryExecution qexec = QueryExecutionFactory.sparqlService(
>>> "http://dbpedia.org/sparql", query);
>>>
>>> ((QueryEngineHTTP)qexec).addParam("timeout", "60000") ;
>>> boolean rs = qexec.execAsk();
>>>
>>> -------------------Exception------------------------------------
>>> Exception in thread "AWT-EventQueue-0" HttpException:
>>> java.net.SocketException: Connection reset: java.net.SocketException:
>>> Connection reset
>>> at
>>> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:333) 
>>>
>>>
>>> at
>>> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:189) 
>>>
>>> at 
>>> com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:144)
>>> at
>>> com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk(QueryEngineHTTP.java:169) 
>>>
>>>
>>
>> Might it be a timeout at the dbpedia end?
>> Try with a very simple, narrow query.
>>
>> Dave
>
> This is quite likely - whatever it is "Connection reset" means the 
> other end has killed the connection for the query abnormally.
>
> http://stackoverflow.com/questions/62929/java-net-socketexception-connection-reset 
>
>
> If the query is wrong (e.g. syntax error) the other end should 
> returned 400 (and ARQ checks the syntax first anyway although dbpedia 
> isn't SPARQL 1.1).
>
> As Dave said, start simple, and work upwards including with a SELECT 
> query.
>
> Also, it may depend on the time of day if it's the timeout.
>
>     Andy
Thanks Dave and Andy, I tried a simple SELECT query through the 
endpoint, it successfully return the results, but soon it failed again. 
I don't think the service is very stable..

Best regards,

June

-- 


Re: SocketException in querying endpoint

Posted by Andy Seaborne <an...@apache.org>.
On 14/01/12 12:09, Dave Reynolds wrote:
> On 14/01/12 01:58, June wrote:
>> Dear list,
>>
>> I got an exception (HttpException: java.net.SocketException: Connection
>> reset) when I try to query through dbpedia endpoint.
>> I already set the timeout parameter, and I can access and query in
>> "http://dbpedia.org/sparql" through browser. What might be the problem?
>> ------------------Code-----------------------------------------
>> com.hp.hpl.jena.query.Query query = QueryFactory.create(ask);
>> QueryExecution qexec = QueryExecutionFactory.sparqlService(
>> "http://dbpedia.org/sparql", query);
>>
>> ((QueryEngineHTTP)qexec).addParam("timeout", "60000") ;
>> boolean rs = qexec.execAsk();
>>
>> -------------------Exception------------------------------------
>> Exception in thread "AWT-EventQueue-0" HttpException:
>> java.net.SocketException: Connection reset: java.net.SocketException:
>> Connection reset
>> at
>> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:333)
>>
>> at
>> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:189)
>> at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:144)
>> at
>> com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk(QueryEngineHTTP.java:169)
>>
>
> Might it be a timeout at the dbpedia end?
> Try with a very simple, narrow query.
>
> Dave

This is quite likely - whatever it is "Connection reset" means the other 
end has killed the connection for the query abnormally.

http://stackoverflow.com/questions/62929/java-net-socketexception-connection-reset

If the query is wrong (e.g. syntax error) the other end should returned 
400 (and ARQ checks the syntax first anyway although dbpedia isn't 
SPARQL 1.1).

As Dave said, start simple, and work upwards including with a SELECT query.

Also, it may depend on the time of day if it's the timeout.

	Andy

Re: SocketException in querying endpoint

Posted by Dave Reynolds <da...@gmail.com>.
On 14/01/12 01:58, June wrote:
> Dear list,
>
> I got an exception (HttpException: java.net.SocketException: Connection
> reset) when I try to query through dbpedia endpoint.
> I already set the timeout parameter, and I can access and query in
> "http://dbpedia.org/sparql" through browser. What might be the problem?
> ------------------Code-----------------------------------------
> com.hp.hpl.jena.query.Query query = QueryFactory.create(ask);
> QueryExecution qexec = QueryExecutionFactory.sparqlService(
> "http://dbpedia.org/sparql", query);
>
> ((QueryEngineHTTP)qexec).addParam("timeout", "60000") ;
> boolean rs = qexec.execAsk();
>
> -------------------Exception------------------------------------
> Exception in thread "AWT-EventQueue-0" HttpException:
> java.net.SocketException: Connection reset: java.net.SocketException:
> Connection reset
> at
> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:333)
> at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:189)
> at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:144)
> at
> com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execAsk(QueryEngineHTTP.java:169)

Might it be a timeout at the dbpedia end?
Try with a very simple, narrow query.

Dave