title: java.lang.RuntimeException: java.net.SocketTimeoutException: Read timed out
body: <p>I am developing a project using Eclipse Java EE, Maven and Geotools. This is the part of the code that I am going to talk about:</p>
  
  <pre><code>Map connectionParameters = new HashMap();
  // Connection parameters
  connectionParameters.put(WFSDataStoreFactory.URL.key, getCapabilities );
  connectionParameters.put(WFSDataStoreFactory.PROTOCOL.key, false );
  connectionParameters.put(WFSDataStoreFactory.LENIENT.key, true );
  connectionParameters.put(WFSDataStoreFactory.MAXFEATURES.key, 30);
  connectionParameters.put(WFSDataStoreFactory.TIMEOUT.key, 600000);
  try { // The WFSDataStoreFactory dsf is already created before
      WFSDataStore dataStore = dsf.createDataStore(connectionParameters);
      // We get the source and then the features from it
      SimpleFeatureSource source = dataStore.getFeatureSource("gmgml_AREAOBRA");
      FeatureCollection&lt;SimpleFeatureType, SimpleFeature&gt; fc = source.getFeatures();
      // We try to go one by one and print to see if it really exists
      while(fc.features().hasNext()){
          SimpleFeature sf = fc.features().next();
          System.out.println(sf.getAttribute("IDOBRA")); } // It crashes
  </code></pre>
  
  <p>The thing is that I read every post about the next error that gives me after crashing:</p>
  
  <pre><code>&gt; SEVERE: Failed to execute request http://mapa20.ewise.es/WFS_EGIOS_SITUATIONROOM/
  service.svc/get?TYPENAME=gmgml%3AAREAOBRA&amp;REQUEST=GetFeature&amp;OUTPUTFORMAT=text%2
  Fxml%3B+subtype%3Dgml%2F3.1.1&amp;VERSION=1.1.0&amp;SERVICE=WFS
  java.lang.RuntimeException: java.net.SocketTimeoutException: Read timed out
      at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureColl
  ection.java:176)
      at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureColl
  ection.java:58)
      at com.sitep.imi.acefat.server.daemon.InsertarBBDDDaemon.dataAccess(InsertarBBD
  DDaemon.java:229)
      at com.sitep.imi.acefat.server.daemon.InsertarBBDDDaemon.insertData(InsertarBBD
  DDaemon.java:98)
      at com.sitep.imi.acefat.App.main(App.java:17)
  Caused by: java.net.SocketTimeoutException: Read timed out
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
      at java.net.SocketInputStream.read(SocketInputStream.java:170)
      at java.net.SocketInputStream.read(SocketInputStream.java:141)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
      at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
      at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
      at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnectio
  n.java:1535)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection
  .java:1440)
      at org.geotools.data.ows.SimpleHttpClient$SimpleHTTPResponse.&lt;init&gt;(SimpleHttpC
  lient.java:171)
      at org.geotools.data.ows.SimpleHttpClient.get(SimpleHttpClient.java:102)
      at org.geotools.data.ows.AbstractOpenWebService.internalIssueRequest(AbstractOp
  enWebService.java:426)
      at org.geotools.data.wfs.internal.WFSClient.internalIssueRequest(WFSClient.java
  :286)
      at org.geotools.data.wfs.internal.WFSClient.issueRequest(WFSClient.java:326)
      at org.geotools.data.wfs.WFSFeatureSource.getReaderInternal(WFSFeatureSource.ja
  va:256)
      at org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.
  java:634)
      at org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureColl
  ection.java:173)
  </code></pre>
  
  <p>But I cannot find a specific answer for my problem.</p>