Glassfish:HTTP 500内部服务器错误没有任何异常 [英] Glassfish: HTTP 500 Internal Server Error without any exception

查看:145
本文介绍了Glassfish:HTTP 500内部服务器错误没有任何异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个正在Glassfish服务器上部署的项目。出现异常时,我可以在Glassfish日志中轻松查看堆栈跟踪。但是,有时当与持久性相关的问题(例如关系注释或延迟加载)出现问题时,服务器的响应是HTTP 500内部服务器错误,在任何日志文件中都没有任何异常。修改错误,不知道实际错误是什么,需要花费大量的时间。有没有办法启用详细模式,以便我可以看到这个异常,或者这是Glassfish的技术限制?

我知道这个问题有点老,但我最近遇到了相同的问题,并会与我们分享我的发现。



对于我来说,以下两种方法可以帮助我们追踪我的问题。

注销SQL语句使用persistence.xml:

 < property name =hibernate.show_sqlvalue =true/> ; // hibernate 

< property name =eclipselink.logging.levelvalue =FINE/> // eclipse link

记录违规违规行为对以下问题的回答:

javax.validation.ConstraintViolationException


I'm currently working on a project that is being deployed on a Glassfish server. When there is an exception, I can easily see the stack trace on the Glassfish log. However, sometimes when there is an issue with something related to persistence such as relation annotations or lazy loading, the response from the server is HTTP 500 Internal Server Error without any exception in any log file. Tinkering around, brute-forcing the error without any clue on what is actually wrong takes a tremendous amount of time. Is there a way to enable a verbose mode so that I can see this exception or is this a technical limitation of Glassfish?

解决方案

I know the question is a little bit older but i recently run into the same issues and would share my findings with you guys.

For me the following two approaches helped to track down my problem.

Log out SQL statements with persistence.xml:

<property name = "hibernate.show_sql" value = "true" /> // hibernate

<property name="eclipselink.logging.level" value="FINE"/> //eclipse link

Log contraint violations as described in the answer to following question:

javax.validation.ConstraintViolationException

这篇关于Glassfish:HTTP 500内部服务器错误没有任何异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆