zoukankan      html  css  js  c++  java
  • A fatal error has been detected by the Java Runtime Environment(jdk 1.6的一个BUG)

    几天做项目,生成一堆注解的实体,当实体数超过86个时,jvm报错:

    # # A fatal error has been detected by the Java Runtime Environment: # #  Internal Error (c1_Optimizer.cpp:271), pid=5104, tid=6488 #  guarantee(x_compare_res != Constant::not_comparable) failed: incomparable constants in IfOp # # JRE version: 6.0_35-b10 # Java VM: Java HotSpot(TM) Client VM (20.10-b01 mixed mode, sharing windows-x86 ) # An error report file with more information is saved as: # D:开发工具eclipse_uphs_err_pid5104.log 20121130|13:44:09 [INFO ] [localhost-startStop-1] [AnnotationSessionFactoryBean:777] Building new Hibernate SessionFactory # # If you would like to submit a bug report, please visit: #   http://java.sun.com/webapps/bugreport/crash.jsp #

    查询得知是windows版jdk 1.6bug(经测试,linux下无此问题),问题的原因就在于,JIT在做编译优化的时候处理 某个方法时出错。 错误是这个方法 

    org.hibernate.cfg.annotations.SimpleValueBinder.setType  

    解决办法:让jvm跳过该方法的编译优化 
    在jvm启动参数中添加启动参数 

    加入jvm启动参数:-XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder.setType

    或:换成jdk1.5  jdk7

    如果是直接通过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%  

  • 相关阅读:
    pins-模块内的代码及资源隔离方案
    Android Gradle defaultConfig详解及实用技巧
    实用抓包工具:whistle
    Gradle中的闭包
    Android Gradle 依赖配置:implementation & api
    Android Studio Run项目出现Failure [INSTALL_FAILED_TEST_ONLY]
    Android 8.0对隐式广播的进一步限制
    cookie 详解
    一分钟内搭建全web的API接口神器json-server详解
    高性能前端 art-template 模板
  • 原文地址:https://www.cnblogs.com/jinzhiming/p/4941902.html
Copyright © 2011-2022 走看看