[ 
https://issues.apache.org/jira/browse/JENA-556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13787262#comment-13787262
 ] 

Andy Seaborne commented on JENA-556:
------------------------------------

I tried http://192.168.0.23:3030/ds/sparql it works for me.  192.168.0.23 being 
a different machine to the test client machine on my local network.

Using -Djava.net.preferIPv4Stack forces java to use a IPv4 stack - it is still 
affected by your machine setup which is external to java.

The processing of the URL is not done by Jena but by Apache HTTP Client.

What is your environment?  What is the result of looking up a name with 
{{nslookup}} or {{dig}}?


> serviceURI should allow sparql endpoints running on port other that 80
> ----------------------------------------------------------------------
>
>                 Key: JENA-556
>                 URL: https://issues.apache.org/jira/browse/JENA-556
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: TDB 1.0.0
>            Reporter: Atharva Patel
>            Assignee: Andy Seaborne
>
> While trying to do simple query operation like this:
> {code:java}
> String sparqlEndpoint = "http://192.168.1.100:8890/sparql";;
> String queryString ="...";
> QueryExecution queryExecution = new QueryEngineHTTP(sparqlEndpoint, 
> queryString);
> {code}
> It gives exception like this:
> Caused by: HttpException: -1
>       at 
> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:340)
>       at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:276)
>       at 
> com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:346)
> Caused by: java.net.UnknownHostException: 192.168.1.100:8890: nodename nor 
> servname provided, or not known
>       at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
>       at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866)
>       at 
> java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258)
>       at java.net.InetAddress.getAllByName0(InetAddress.java:1211)
>       at java.net.InetAddress.getAllByName(InetAddress.java:1127)
>       at java.net.InetAddress.getAllByName(InetAddress.java:1063)
>       at 
> org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
>       at 
> org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278)
>       at 
> org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
>       at 
> org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
>       at 
> org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:641)
>       at 
> org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
>       at 
> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
>       at 
> org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:130)
>       at 
> org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:116)
>       at org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:1011)
>       at org.apache.jena.riot.web.HttpOp.execHttpGet(HttpOp.java:291)
>       at org.apache.jena.riot.web.HttpOp.execHttpGet(HttpOp.java:353)
>       at 
> com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:326)
>       ... 20 more
> The issue seems to be the way Jena tries to parse the serviceURI internally 
> where there is likely to be a strong assumption that port number will never 
> be passed by the user of this API.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to