2010-06-24 39 views
4

我是Android編程新手。 我的要求是通過HttpClient調用HTTP請求。 下面是代碼:內部錯誤(classFileParser.cpp:3174),pid = 7288,tid = 7476

公共類ClientWithResponseHandler { 公共最終靜態無效的主要(字串[] 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虛擬機:Java的熱點(TM)客戶端VM(16.3-B01混合模式Windows-x86)的

更多信息的錯誤報告文件保存爲:

C:\桑迪普\日食\工作區\ HelloWebService \ hs_err_pid7288.log

如果您想提交錯誤報告,請訪問:

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


任何想法可能是什麼問題

問候 桑迪普

+0

有嘗試刪除bin和gen目錄(關閉eclipse後),並重建項目? – Nanis 2010-06-24 15:09:00

+0

http://stackoverflow.com/a/2172175/611007 – n611x007 2014-07-02 14:37:11

+0

http://stackoverflow.com/questions/2543106/fatal-error-by-java-runtime-environment?answertab=votes#tab-top – n611x007 2014-07-02 14:38:04

回答

2

this question,我的回答是:

我得到了同樣的問題,但與很多o通過Google搜索,我找到了答案!從鏈接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存根實現。轉到Run - > Run As - >再次運行配置並在最近創建的JUnit配置中刪除Android庫
  2. 然後添加庫,使用高級...按鈕,添加JRE系統庫和JUnit 3
  3. 應用和運行

試試這個,它爲我工作。

0

我刪除了運行配置,並再次

0

創建一個新的becase的您使用的Java類的Eclipse項目認爲是Java的不是Android系統。所以,當你點擊「run」時,Eclipse將作爲Java App運行。您應該小心運行 - > Android應用程序。

相關問題