title: Why am I receiving Response code: Non HTTP response code: java.net.SocketException?
body: <p>I am trying to send requests using JMeter to my application that is running on <em>localhost</em> but many of the requests get failed due to <em>java.net.SocketException</em>. I do not see any exceptions in console though.</p>
  
  <p>I read these <a href="https://stackoverflow.com/questions/62929/java-net-socketexception-connection-reset">question1</a> and <a href="https://stackoverflow.com/questions/585599/whats-causing-my-java-net-socketexception-connection-reset">question2</a> but did not help much.</p>
  
  <p>My code is as following:</p>
  
  <pre><code> try {
          return myService.findItems(group);
  
      } catch (NullPointerException n) {
          n.printStackTrace();
      } catch (HibernateException h) {
          h.printStackTrace();
      } catch (IOException i) {
          i.printStackTrace();
      }
      return null;
  </code></pre>
  
  <p><strong>Repository</strong></p>
  
  <pre><code>  public LinkedHashMap findItems(String group) throws NullPointerException, HibernateException, IOException {
          Session session = sessionFactory.getCurrentSession();
                   ..... //request is sent to database
  
          return items;
      }
  </code></pre>
  
  <p><strong>Screen shots of my JMeter configuration</strong></p>
  
  <p><img src="https://i.stack.imgur.com/ciKuZ.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/jidRt.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/qmHy4.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/3CXBw.png" alt="enter image description here"></p>