I have a simple html file. It access url1 and successfully parse the json response. 

CLIENT -> URL1 -> Response to client

I modified my code in html and invoked URL2 

CLIENT -> URL2 -> URL1 -> Response to URL2 -> Response to Client 

I commented url1 and invoked url2. url2 is a simple servlet which invokes url1 and gets the response. The servlets returns the same response back to the client but this time ajax/jquery returns **parse error**. When i alert (request.responseText), it exactly matches the response returned by URL1.

```
$.ajax({   
//url: "http://abc1.com", // Line 1  
  url: "http://abc2.com", // Line 2   
  data: {param1, param2},    
  dataType: "jsonp",            
  type: "GET",  
      async:false,  
    success: function(parsed_json) {  
            alert("Success");           
        },
        error: function (request, status, error) {  
            alert("Error" + error);
            alert(request.responseText);
        }

```

The Servlet is just a layer in between which copies the content of the input stream to the output stream. 

`InputStream input = new URL(url).openStream();  

resp.setContentType("application/json");
// Apache commons IOUtils to copy 
IOUtils.copy(input, resp.getOutputStream());  

resp.getOutputStream().flush();`

I manually verified the json-string-response and it appears to be the same. 
What could be the problem ?