title: Java HtmlUnit java.lang.NoClassDefFoundError: org/w3c/css/sac/ErrorHandler stack overflow
body: <p>Trying to do the tutorial examples on HtmlUnit so I can connect to web pages through Java. I am getting the following error when I try to run it:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/w3c/css/sac/ErrorHandler stack overflow
  </code></pre>
  
  <p>Here is my code: </p>
  
  <pre><code>package Http;
  
  
  import com.gargoylesoftware.htmlunit.BrowserVersion;
  import com.gargoylesoftware.htmlunit.WebClient;
  import com.gargoylesoftware.htmlunit.html.HtmlPage;
  import org.junit.Assert;
  import org.junit.Test;
  
  public class Facebook {
      @Test
      public void homePage() throws Exception {
          try (final WebClient webClient = new WebClient()) {
              final HtmlPage page = webClient.getPage("http://htmlunit.sourceforge.net");
              Assert.assertEquals("HtmlUnit - Welcome to HtmlUnit", page.getTitleText());
  
              final String pageAsXml = page.asXml();
              Assert.assertTrue(pageAsXml.contains("&lt;body class=\"composite\"&gt;"));
  
              final String pageAsText = page.asText();
              Assert.assertTrue(pageAsText.contains("Support for the HTTP and HTTPS protocols"));
          }
      }
  }
  </code></pre>
  
  <p>I have httpcore 4.4.1 httpclient 4.4.1 htmlunit.2.17 all imported </p>