- # 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_25-b06
- # Java VM: Java HotSpot(TM) Client VM (20.0-b11 mixed mode windows-x86 )
- # If you would like to submit a bug report, please visit:
- # http://java.sun.com/webapps/bugreport/crash.jsp
- #
- --------------- T H R E A D ---------------
- Current thread (0x01213800): JavaThread "C1 CompilerThread0" daemon [_thread_in_native, id=4412, stack(0x179f0000,0x17a40000)]
- Stack: [0x179f0000,0x17a40000], sp=0x17a3f554, free space=317k
- Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
這個問題在google上搜了很多文章,終於找到一片來自iteye網友的文章,和我遇到的問題基本類似,非常感謝。傳送門:http://seanhe.iteye.com/blog/905997
問題的原因就在於 顯示JIT在做編譯優化的時候處理 某個方法時出錯。
本利的錯誤是這個方法
- org.hibernate.cfg.annotations.SimpleValueBinder.setType
解決辦法:讓jvm跳過該方法的編譯優化
在jvm啓動參數中添加啓動參數
- -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType
如果是eclipse下啓動服務,則在eclipse-preference-java-installed jres 裏面設置,
在 defalt vm arguments 填入上面的代碼就可以了。
如果是直接通過startup 啓動tomcat,則需要修改以下文件
Windows下,在文件/bin/catalina.bat,Unix下,在文件/bin/catalina.sh
找到
- set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
修改爲
- set JAVA_OPTS=%JAVA_OPTS% -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType %LOGGING_CONFIG%