新博客地址:https://corebook.notion.site 歡迎收藏關注 ????
簡書不再更新!
大致出現(xiàn)的問題如下
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (c1_Optimizer.cpp:271), pid=1196, tid=4412
# guarantee(x_compare_res != Constant::not_comparable) failed: incomparable constants in IfOp
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) Client VM (20.45-b01 mixed mode windows-x86 )
# An error report file with more information is saved as:
# D:\Program Files\eclipse-jee-oxygen-R-win32\eclipse\hs_err_pid9188.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
原因是:JIT在做編譯優(yōu)化的時候處理 某個方法時出錯腊脱。
如何知道自己哪個方法編譯出錯?
錯誤輸出中會告訴你錯誤日志文件地址懈万,如上:D:\Program Files\eclipse-jee-oxygen-R-win32\eclipse\hs_err_pid9188.log
打開日志文件呀忧,THREAD
輸出下會有具體錯誤的Java類和方法辞友,本例中內(nèi)容為:
Current CompileTask:
C1: 20924 1686 org.hibernate.cfg.annotations.SimpleValueBinder.setType
(Lorg/hibernate/annotations/common/reflection/XProperty;Lorg/hibernate/annotations/common/reflection/XClass;)V (921 bytes)
問題就出在org.hibernate.cfg.annotations.SimpleValueBinder.setType
編譯出問題
解決辦法
讓jvm跳過該方法的編譯
jvm啟動添加如下參數(shù)
-XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder栅哀,setType
如果是tomcat直接啟動,在可以在/bin/catalina.bat
添加如下參數(shù)
set JAVA_OPTS=%JAVA_OPTS% -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType %LOGGING_CONFIG%