gpt4 book ai didi

java - 如果 servlet 上下文初始化失败,则跳过部署或停止 Web 应用程序

转载 作者:行者123 更新时间:2023-12-04 23:08:12 24 4
gpt4 key购买 nike

在我们的项目中,我们有几个基于 Spring 的模块,它们作为 Web 应用程序部署在 WAS 上。如果 Spring 上下文初始化失败(即 ContextLoaderListener#contextInitializedDispatcherServlet#init 抛出异常),我们需要跳过部署或停止模块。现在,如果发生这种情况,应用程序已部署并启动,但会为任何请求返回 HTTP 500。

网络空间 8.5.5

相关问题:https://stackoverflow.com/a/272747/3459206

最佳答案

这个 APAR 似乎是相关的:

https://www-01.ibm.com/support/docview.wss?uid=swg1PI58875

来自 APAR 文本:

Listener exceptions typically should not stop the application
from starting up for service. However, some applications depend
on their listeners to do the necessary setup before the
application is started for service. Such applications prefer to
stop the application from starting up when there is any
exception in their listeners.

问题总结

The WebContainer Container code was modified to provide an
option to stop the application when there is any listener
exception during the application starting up process.

A new WebContainer custom property needs to be set to enable the
behavior provided by this APAR:

For Full Profiles

com.ibm.ws.webcontainer.stopappstartuponlistenerexception = true
(default is false)

For Liberty Profile

stopappstartuponlistenerexception=true

The fix for this APAR is currently targeted for inclusion in
WebSphere Application Server fix packs 8.5.5.11 and 9.0.0.2,
and Liberty 16.0.0.3

有关其他信息,请参阅 APAR 链接。

关于java - 如果 servlet 上下文初始化失败,则跳过部署或停止 Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53929047/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com