如何启用Jakartaee/Glassfish应用程序的堆栈跟踪输出?
简短版
制作玻璃鱼的选项是什么选择在其通用 500服务器错误中包含堆栈跟踪 page:
asp.net中的长版本
您可以通过在web.config
xml文件中设置一个值来包含堆栈跟踪:
web.config < /strong>:
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
这会导致页面显示错误的堆栈跟踪:
什么是等效的Jakartaee/Glassfish选项?
现在死亡的灰色屏幕没有显示堆栈跟踪:
情况
jakarta-ee中的机制是什么,以注册全球无人教的例外 处理程序,所以我可以自己显示堆栈跟踪?
在ASP.NET中,您进入您的 global.asax 文件,然后输入application_error
回调的代码:
global.asax :
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
// Get the exception object.
Exception exc = Server.GetLastError().GetBaseException();
WriteCustomYellowScreenOfDeath(Response, exc);
// Clear the error from the server
Server.ClearError();
}
什么是java/是什么Java-ee/jakarta-ee/Glassfish等效?
研究工作
- 如何启用glassey trace tracging in Glassey trace in Glassfish
- href =“ https://stackoverflow.com/questions/1167888/1167888/how-do-i-i-increase-the-number-of-displayed-lines-lines-lines-lines-lines-lines-of-a-java stack-stack-trace-trace-dump”>我如何增加Java堆栈跟踪转储的显示线的数量?
- glassfish:http 500内部服务器错误,没有任何
- 例外href =“ https://stackoverflow.com/questions/45757856/how-can-can-i-get-the-stack-stack-trace-trace-trace-trace-when-server-error-ror-happens-in-jersey>跟踪何时在泽西岛发生500个服务器错误?
- 如何用玻璃鱼打印完整的堆栈跟踪?
- Glassfish Fish Fish Fish Fine 未经处理的异常细节
Short Version
What's the option to make Glassfish include a stack trace in its generic 500 Server Error page:
Long Version
In ASP.net you can have the generic error page include a stack trace by setting a value in your web.config
xml file:
web.config:
<configuration>
<system.web>
<customErrors mode="Off" />
</system.web>
</configuration>
This causes the page to show the stack trace of the error:
What is the equivalent JakartaEE/Glassfish option?
Right now the gray screen of death doesn't show a stack trace:
Alternatively
What is the mechanism in Jakarta-EE to register a global uncaught exception handler, so i can display a stack trace myself?
In ASP.net you go into your global.asax file, and enter code for the Application_Error
callback:
Global.asax:
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
// Get the exception object.
Exception exc = Server.GetLastError().GetBaseException();
WriteCustomYellowScreenOfDeath(Response, exc);
// Clear the error from the server
Server.ClearError();
}
What's the Java/Java-EE/Jakarta-EE/Glassfish equivalent?
Research Effort
- How to enable jersey trace logging in glassfish
- How do I increase the number of displayed lines of a Java stack trace dump?
- Glassfish: HTTP 500 Internal Server Error without any exception
- How can I get the stack trace when 500 server error happens in Jersey?
- How can I print the full stack trace with GlassFish?
- Unhandled exception details in Glassfish
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您通过在
web.xml
中指定它来告诉网络服务器,您想向我们提供一个自定义错误页面:web.xml :
然后您创建一个新的new < em>死亡的黄色屏幕 jsp文件:
ysod.jsp
和鲍勃的叔叔 - a 有用错误页面:
First you tell the web-server that you want to us a custom error page by specifying it in your
web.xml
:web.xml:
And then you create a new Yellow Screen of Death JSP file:
ysod.jsp
And Bob's your uncle - a useful error page: