title: Run time error in java servlet
body: <p>The build of the project is succesfull, but when I go the the url I get the following error report:</p>
  
  <pre><code>HTTP Status 500 -
  
  type Exception report
  
  message
  
  description The server encountered an internal error () that prevented it from fulfilling this request.
  
  exception
  
  javax.servlet.ServletException: Error instantiating servlet class example.servlet.ScrapingServlet
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:619)
  
  root cause
  
  java.lang.NoClassDefFoundError: org/apache/http/impl/client/DefaultHttpClient
   java.lang.Class.getDeclaredConstructors0(Native Method)
   java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   java.lang.Class.getConstructor0(Class.java:2699)
   java.lang.Class.newInstance0(Class.java:326)
   java.lang.Class.newInstance(Class.java:308)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:619)
  
  root cause
  
  java.lang.ClassNotFoundException: org.apache.http.impl.client.DefaultHttpClient
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   java.lang.Class.getDeclaredConstructors0(Native Method)
   java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   java.lang.Class.getConstructor0(Class.java:2699)
   java.lang.Class.newInstance0(Class.java:326)
   java.lang.Class.newInstance(Class.java:308)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:619)
  
  &gt;note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
  Apache Tomcat/6.0.14
  </code></pre>
  
  <p>And that is because I added this simple line to the code:
  DefaultHttpClient httpclient = new DefaultHttpClient();</p>
  
  <p>What am I doing wrong?</p>