A fatal error has been detected by the Java Runtime Environment__jvm

來源:互聯網
上載者:User
        Tomcat啟動:A fatal error has been detected by the Java Runtime Environment(JVM Crash分析及相關資料)                分類:            伺服器 2013-01-10 14:19 1255人閱讀 評論(2) 收藏 舉報 binding crash jvm JVM tomcat Tomcat 伺服器

iLife's 部落格http://blog.csdn.net/fei1502816


2013年1月10號註:

今天更新代碼之後,突然出現一個問題:Tomcat啟動時,總是會出現jvm fatal error錯誤導致tomcat無法正常啟動,以下是錯誤資訊:

[plain] view plain copy print ? #  # A fatal error has been detected by the Java Runtime Environment:  #  #  Internal Error (c1_Optimizer.cpp:271), pid=6048, tid=5404  #  guarantee(x_compare_res != Constant::not_comparable) failed: incomparable constants in IfOp  #  # JRE version: 6.0_29-b11  # Java VM: Java HotSpot(TM) Client VM (20.4-b02 mixed mode windows-x86 )  2013-01-10 13:47:34,671 INFO  hibernate.cfg.AnnotationBinder:419  -> Binding entity from annotated class: com.estone.www.spis.model.po.zd.sys.DPossession  2013-01-10 13:47:34,671 INFO  cfg.annotations.EntityBinder:422  -> Bind entity com.estone.www.spis.model.po.zd.sys.DPossession on table d_possession  2013-01-10 13:47:34,671 INFO  hibernate.cfg.AnnotationBinder:419  -> Binding entity from annotated class: com.estone.www.spis.model.po.zd.writ.DWritTemplate  2013-01-10 13:47:34,671 INFO  cfg.annotations.EntityBinder:422  -> Bind entity com.estone.www.spis.model.po.zd.writ.DWritTemplate on table d_writ_template  2013-01-10 13:47:34,671 INFO  hibernate.cfg.AnnotationBinder:419  -> Binding entity from annotated class: com.estone.www.spis.model.po.zd.writ.DWritType  2013-01-10 13:47:34,671 INFO  cfg.annotations.EntityBinder:422  -> Bind entity com.estone.www.spis.model.po.zd.writ.DWritType on table d_writ_type  # An error report file with more information is saved as:  # D:\Program Files\apache-tomcat-6.0.20\bin\hs_err_pid6048.log  #  # If you would like to submit a bug report, please visit:  #   http://java.sun.com/webapps/bugreport/crash.jsp  # 

## A fatal error has been detected by the Java Runtime Environment:##  Internal Error (c1_Optimizer.cpp:271), pid=6048, tid=5404#  guarantee(x_compare_res != Constant::not_comparable) failed: incomparable constants in IfOp## JRE version: 6.0_29-b11# Java VM: Java HotSpot(TM) Client VM (20.4-b02 mixed mode windows-x86 )2013-01-10 13:47:34,671 INFO  hibernate.cfg.AnnotationBinder:419  -> Binding entity from annotated class: com.estone.www.spis.model.po.zd.sys.DPossession2013-01-10 13:47:34,671 INFO  cfg.annotations.EntityBinder:422  -> Bind entity com.estone.www.spis.model.po.zd.sys.DPossession on table d_possession2013-01-10 13:47:34,671 INFO  hibernate.cfg.AnnotationBinder:419  -> Binding entity from annotated class: com.estone.www.spis.model.po.zd.writ.DWritTemplate2013-01-10 13:47:34,671 INFO  cfg.annotations.EntityBinder:422  -> Bind entity com.estone.www.spis.model.po.zd.writ.DWritTemplate on table d_writ_template2013-01-10 13:47:34,671 INFO  hibernate.cfg.AnnotationBinder:419  -> Binding entity from annotated class: com.estone.www.spis.model.po.zd.writ.DWritType2013-01-10 13:47:34,671 INFO  cfg.annotations.EntityBinder:422  -> Bind entity com.estone.www.spis.model.po.zd.writ.DWritType on table d_writ_type# An error report file with more information is saved as:# D:\Program Files\apache-tomcat-6.0.20\bin\hs_err_pid6048.log## If you would like to submit a bug report, please visit:#   http://java.sun.com/webapps/bugreport/crash.jsp#

在網上搜尋好久,終於找到了類似錯誤,網上解釋歸結於:JIT在做編譯最佳化的時候處理時出錯,可能是觸發了JVM的編譯器的BUG導致的。幸好SUN(Oracle)提供了相關的文檔說明,得以讓我們解決了這個問題。
文檔地址:http://www.oracle.com/technetwork/java/javase/crashes-137240.html#gbyzu

在這裡,導致本次錯誤的是這個方法:

[java] view plain copy print ? org.hibernate.cfg.annotations.SimpleValueBinder.setType 

org.hibernate.cfg.annotations.SimpleValueBinder.setType

解決辦法:讓jvm跳過該方法的編譯最佳化

1.如果是eclipse下啟動服務,則在myeclipse-preference-java-installed jres 裡面設定, 在 defalt vm arguments 填入下邊的代碼就可以了。如圖:

代碼:

[plain] view plain copy print ? -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType 

-XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType

選擇使用的JRE,,點擊編輯edit

將上邊代碼粘貼到此處,OK


2.如果是直接通過startup 啟動tomcat,則需要修改以下檔案 Windows下,在檔案/bin/catalina.bat,Unix下,在檔案/bin/catalina.sh找到

[plain] view plain copy print ? set JAVA_OPTS=%JAVA_OPTS%  %LOGGING_CONFIG%   

set JAVA_OPTS=%JAVA_OPTS%  %LOGGING_CONFIG%  
修改為以下內容即可:

[plain] view plain copy print ? set JAVA_OPTS=%JAVA_OPTS% -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType %LOGGING_CONFIG% 

set JAVA_OPTS=%JAVA_OPTS% -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType %LOGGING_CONFIG%
如圖:


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.