内部错误(classFileParser.cpp:3174),pid = 7288,tid = 7476

时间:2010-06-24 14:38:29

标签: android

我是Android编程的新手。 我的要求是通过HttpClient调用HTTP请求。 以下是代码:

public class ClientWithResponseHandler {   public final static void main(String [] args)抛出异常{

     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();        
 }

}

将上述代码作为Java应用程序执行后,我在控制台中收到以下错误。


Java运行时环境检测到致命错误:

内部错误(classFileParser.cpp:3174),pid = 7288,tid = 7476

错误:ShouldNotReachHere()

JRE版本:6.0_20-b02

Java VM:Java HotSpot(TM)客户端VM(16.3-b01混合模式windows-x86)

包含更多信息的错误报告文件保存为:

C:\桑迪普\蚀\工作空间\ HelloWebService \ hs_err_pid7288.log

如果您想提交错误报告,请访问:

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


知道可能是什么问题

此致 和Sandeep

4 个答案:

答案 0 :(得分:2)

请参阅this question以及我对此的回答:

我遇到了同样的问题,但是有很多谷歌搜索我找到了答案! See this page

从链接引用:


# An unexpected error has been detected by Java Runtime Environment:
#
#  Internal Error (classFileParser.cpp:2924), pid=5364, tid=6644
#  Error: ShouldNotReachHere
  1. 那是因为我们正在使用Android的JUnit存根实现。转到运行 - &gt;运行方式 - &gt;再次运行配置,并在最近创建的JUnit配置中,Classpath的Bootstrap条目删除Android库
  2. 然后使用“高级...”按钮添加库,并添加JRE系统库和JUnit 3
  3. 申请并运行

  4. 试试这个,它对我有用。

答案 1 :(得分:1)

除Fredrik所说的内容外,请考虑在Android上使用AndroidHttpClient代替DefaultHttpClient

答案 2 :(得分:0)

我删除了运行配置并再次创建了一个新配置

答案 3 :(得分:0)

因为您使用Java类,Eclipse认为Project是Java而不是Android。因此,当您单击“运行”时,Eclipse将作为Java App运行。你应该小鸡运行as-&gt; Android应用程序。

相关问题