tags:

views:

17

answers:

0

Hello, I'm new to Android programming. My requirement is to call an HTTP request via HttpClient. Below is the code :

public class ClientWithResponseHandler { public final static void main(String[] args) throws Exception {

     HttpClient httpclient = new DefaultHttpClient();
     HttpGet httpget = new HttpGet("http://www.google.com/"); 
     System.out.println("executing request " + httpget.getURI());
     // Create a response handler
     ResponseHandler<String> responseHandler = new BasicResponseHandler();
     String responseBody = httpclient.execute(httpget, responseHandler);
     System.out.println(responseBody);

     System.out.println("----------------------------------------");

     // When HttpClient instance is no longer needed, 
     // shut down the connection manager to ensure
     // immediate deallocation of all system resources
     httpclient.getConnectionManager().shutdown();        
 }

}

After executing the above code as a Java Application i get the below error in the console.


#

A fatal error has been detected by the Java Runtime Environment:

#

Internal Error (classFileParser.cpp:3174), pid=7288, tid=7476

Error: ShouldNotReachHere()

#

JRE version: 6.0_20-b02

Java VM: Java HotSpot(TM) Client VM (16.3-b01 mixed mode windows-x86 )

An error report file with more information is saved as:

C:\Sandeep\eclipse\workspace\HelloWebService\hs_err_pid7288.log

#

If you would like to submit a bug report, please visit:

http://java.sun.com/webapps/bugreport/crash.jsp

#


Any idea what could be the problem

Regards Sandeep