title: Return JSONObject from servlet throws exception
body: <p>I have a servlet to which I am posting data from ajax(jquery) call. </p>
  
  <pre><code>$('form').submit(function() {
  var URL = "ProjectHandler"; 
  var dataString=$(this).serialize();
  $.ajax({
         type: "POST",
         url: URL,
         data: dataString, 
        // dataType: json,
         success: function(data)
         {
             alert(data.error);
  
         }
       });
      return false; 
  });
  </code></pre>
  
  <p>I have commented dataType beacause when I uncomment it, it doesnt make ajax call, rather, the form is submitted with default mode i.e. the servlet is loaded</p>
  
  <p>JAR's I have added to the project 1. json-lib-2.2.2-jdk15.jar 2. apache-commons-lang.jar 3. ezmorph-1.0.jar</p>
  
  <p>first it threw exception filenotfound which was part of apache-commons package so included apache commons, after that I got exception of filenotfound which was part of ezmorph-1.0.jar, so I added that also. Now I am getting </p>
  
  <pre><code>java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
  </code></pre>
  
  <p>Code in servlet doPost:</p>
  
  <pre><code>response.setContentType("application/json");
  PrintWriter out = response.getWriter();
  
  JSONObject json  = new JSONObject();
  json.put("error", true);
  json.put("errorDesc", "wrong title");
  out.print(json);
  </code></pre>
  
  <p>I hope I have cleared the scenario, any help would be appreciated.</p>
  
  <p>Thanks</p>