• 今天更新代码之后,突然出现一个问题:Tomcat启动时,总是会出现jvm fatal error错误导致tomcat无法正常启动,以下是错误信息:


    今天更新代码之后,突然出现一个问题:Tomcat启动时,总是会出现jvm fatal error错误导致tomcat无法正常启动,以下是错误信息:

    1. #  
    2. # A fatal error has been detected by the Java Runtime Environment:  
    3. #  
    4. #  Internal Error (c1_Optimizer.cpp:271), pid=6048, tid=5404  
    5. #  guarantee(x_compare_res != Constant::not_comparable) failed: incomparable constants in IfOp  
    6. #  
    7. # JRE version: 6.0_29-b11  
    8. # Java VM: Java HotSpot(TM) Client VM (20.4-b02 mixed mode windows-x86 )  
    9. 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  
    10. 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  
    11. 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  
    12. 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  
    13. 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  
    14. 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  
    15. # An error report file with more information is saved as:  
    16. # D:Program Filesapache-tomcat-6.0.20inhs_err_pid6048.log  
    17. #  
    18. # If you would like to submit a bug report, please visit:  
    19. #   http://java.sun.com/webapps/bugreport/crash.jsp  
    20. #  


    在网上搜寻好久,终于找到了类似错误,网上解释归结于:JIT在做编译优化的时候处理时出错,可能是触发了JVM的编译器的BUG导致的。幸好SUN(Oracle)提供了相关的文档说明,得以让我们解决了这个问题。 
    文档地址:http://www.oracle.com/technetwork/java/javase/crashes-137240.html#gbyzu 

    在这里,导致本次错误的是这个方法:

    1. org.hibernate.cfg.annotations.SimpleValueBinder.setType  


    解决办法:让jvm跳过该方法的编译优化 

    1.如果是eclipse下启动服务,则在myeclipse-preference-java-installed jres 里面设置, 在 defalt vm arguments 填入下边的代码就可以了!如图:

    代码:

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

     

    选择使用的JRE,,点击编辑edit

    上边代码粘贴到此处,OK

     

    2.如果是直接通过startup 启动tomcat,则需要修改以下文件 Windows下,在文件/bin/catalina.bat,Unix下,在文件/bin/catalina.sh找到

    1. set JAVA_OPTS=%JAVA_OPTS%  %LOGGING_CONFIG%    

    修改为以下内容即可:

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

    如图:



    参考资料:感谢以下链接的朋友

    http://seanhe.iteye.com/blog/905997

    http://eric-flower.iteye.com/blog/1447080

    http://sind.iteye.com/blog/1132459

  • 相关阅读:
    CF809E Surprise me!
    2019-4-12-WPF-绑定的默认模式
    2019-4-12-WPF-绑定的默认模式
    2019-2-28-C#-16-进制字符串转-int-
    2019-2-28-C#-16-进制字符串转-int-
    2019-10-23-WPF-使用-SharpDx-异步渲染
    2019-10-23-WPF-使用-SharpDx-异步渲染
    2019-8-31-ASP.NET-Core-开启后台任务
    2019-8-31-ASP.NET-Core-开启后台任务
    2019-8-24-win10-uwp-读取文本GBK错误
  • 原文地址:https://www.cnblogs.com/tfy1332/p/3655785.html
Copyright © 2020-2023  润新知