jvm bug A fatal error has been detected by the Java Runtime Environment:

本文解决了一起在配置修改后,启动Tomcat时出现的Java运行时环境内部错误的问题。通过参考Oracle文档,发现是Hibernate的注解处理导致的JIT编译优化出错。解决方案是在Eclipse中调整默认JVM参数,排除特定方法的编译优化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 今天在配置了修改了一下,启动tomcat的时候,出现了如下错误。

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


解决方案如下:


网上解释归结于:JIT在做编译优化的时候处理时出错,可能是触发了JVM的编译器的BUG导致的。幸好SUN(Oracle)提供了相关的文档说明,得以让我们解决了这个问题。 
文档地址:http://www.oracle.com/technetwork/java/javase/crashes-137240.html#gbyzu 
在这里,导致本次错误的是这个方法:
	
  
  1. 解决办法:让jvm跳过该方法的编译优化 
1.如果是eclipse下启动服务,则在myeclipse-preference-java-installed jres 里面设置, 在 defalt vm arguments 填入下边的代码就可以了!如图: 代码:


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


选择使用的JRE,,点击编辑edit,上边代码粘贴到 Default vm Argument就行了




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值