title: java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager
body: <p>I'm currently working on Web Service in NetBean IDE.
  I'm using <code>Apache HttpClient</code> to send <code>GET</code> request to some RESTful API.
  The problem is, it works really well in junit test but when I compile it and delpoy to glassfish, it shows following error:</p>
  
  <pre><code>Info:   wsimport successful
  Severe:   sun/security/ssl/HandshakeStateManager
  java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager
      at sun.security.ssl.Handshaker.init(Handshaker.java:282)
      at sun.security.ssl.Handshaker.&lt;init&gt;(Handshaker.java:242)
      at sun.security.ssl.ClientHandshaker.&lt;init&gt;(ClientHandshaker.java:160)
      at sun.security.ssl.SSLSocketImpl.initHandshaker(SSLSocketImpl.java:1329)
      at sun.security.ssl.SSLSocketImpl.doneConnect(SSLSocketImpl.java:690)
      at sun.security.ssl.SSLSocketImpl.&lt;init&gt;(SSLSocketImpl.java:569)
      at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:110)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:393)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384)
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
  </code></pre>
  
  <p>Here is my code to send <code>GET</code> request. What is the problem?</p>
  
  <pre><code>protected String getResponse(String url) throws IOException, ProviderNotAvailableException{
          HttpGet request = new HttpGet(url);
  
          CloseableHttpResponse response = httpClient.execute(request);
  
          HttpEntity entity = response.getEntity();
  
          if (entity != null) {
              String result = EntityUtils.toString(entity);
              return result;
          } else {
              throw new ProviderNotAvailableException("Http entity is null.");
          }
  }
  </code></pre>
  
  <p>My jdk version is 1.8 and NetBean version is 11.0. Again, it works well in junit test.</p>