title: Jena Sparql Error java.lang.Integer
body: <p>I have the following code:</p>
  
  <pre><code>    RestClient client = new RestClient("http://localhost:8080/scheduler.core/rest/services/discoverSensors");
  
      client.AddParam("userID", "keith@acrosslimits.com");
      client.AddParam("longitude", "4.3512725830078125");
      client.AddParam("latitude", "50.84761359783461");
      client.AddParam("radius", "15.0");
      client.AddHeader("accept", "application/xml");
  
      try {
          client.Execute(RestClient.RequestMethod.GET);
      } catch (Exception e) {
          e.printStackTrace();
      }
  
      String response = client.getResponse();
      //System.out.println(response);
  
      DocumentBuilder db = null;
      try {
          db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
      } catch (ParserConfigurationException e) {
          // TODO Auto-generated catch block
  
          System.out.println("error");
      }
  
      InputSource is = new InputSource();
      is.setCharacterStream(new StringReader(response));
  
      Document doc = db.parse(is);
      NodeList nodes = doc.getElementsByTagName("SensorType");
  
      // Getting the id of the sensor
      for(int x=0,size= nodes.getLength(); x&lt;size; x++) {
  
          String resourceID = nodes.item(x).getAttributes().getNamedItem("id").getNodeValue();
  
          String sparqlQueryString = "select ?sensor ?lat ?lng "+
                                     "from &lt;http://lsm.deri.ie/OpenIoT/demo/sensormeta#&gt; " +
                                     "where{?sensor &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://purl.oclc.org/NET/ssnx/ssn#Sensor&gt;."+
                                     "?sensor &lt;http://lsm.deri.ie/ont/lsm.owl#hasSensorType&gt; &lt;http://lsm.deri.ie/resource/8a8291b73215690e013215a4c0d00f17&gt;."+
                                     "?sensor &lt;http://www.loa-cnr.it/ontologies/DUL.owl#hasLocation&gt; ?location."+
                                     "?location &lt;http://www.w3.org/2003/01/geo/wgs84_pos#lat&gt; ?lat."+
                                     "?location &lt;http://www.w3.org/2003/01/geo/wgs84_pos#long&gt; ?lng."+
                                     "}limit 100";
  
          System.out.println(resourceID);
          System.out.println(sparqlQueryString);
  
          Query query = QueryFactory.create(sparqlQueryString);
          ARQ.getContext().setTrue(ARQ.useSAX);
  
          System.out.println("1");
          QueryExecution qexec = QueryExecutionFactory.sparqlService("http://lsm.deri.ie/sparql", query);
          System.out.println("2");
  
          //Retrieving the SPARQL Query results
          ResultSet results = qexec.execSelect();
          System.out.println("3");
  
          //Iterating over the SPARQL Query results
          while (results.hasNext()) {
               QuerySolution soln = results.nextSolution();
  
               System.out.println("4");
               String SensorID = soln.get("?sensor").toString();
               String lat = soln.get("?lat").toString();
               String lon = soln.get("?lng").toString();
  
               System.out.println(SensorID);
               System.out.println(lat);
               System.out.println(lon);
          }
  
          qexec.close();
      }
  }
  </code></pre>
  
  <p>The Problem I am facing is that when I am executing the query, an error is being displayed. The line where the program terminates is the line between 2 and 3. The error displayed is:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
      at org.apache.http.params.AbstractHttpParams.getIntParameter(AbstractHttpParams.java:70)
      at org.apache.http.client.params.HttpClientParamConfig.getRequestConfig(HttpClientParamConfig.java:54)
      at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:806)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
      at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:158)
      at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:139)
      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)
      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)
      at ExecuteRestClient.main(ExecuteRestClient.java:114)
  </code></pre>
  
  <p>Is this because the latitude and longitude variable? I am using jena 2.11.</p>