gpt4 book ai didi

websphere-7 - 线程 "WebContainer : 0"(00000029)已经活跃了647279毫秒,可能挂了

转载 作者:行者123 更新时间:2023-12-05 08:17:34 25 4
gpt4 key购买 nike

我在尝试使用 jasper 生成 excel 报告时在 WebSphere 中遇到以下异常。

 ThreadMonitor W   WSVR0605W: Thread "WebContainer : 0" (00000029) has been active for 647279 milliseconds and may be hung.  There is/are 1 thread(s) in total in the server that may be hung.

尝试将默认线程池大小从 20 增加到 50 并将 WebContainer 池大小从 50 增加到 150。没有用。

对此的任何解决方案。

最佳答案

您的错误消息表明,名为“WebContainer:0”的线程已经执行了 647 秒或 10.7 分钟的操作,并且 JVM 中有 1 个线程处于事件状态,我也挂起了(事件时间超过阈值时间)。

挂起线程是 Java EE 应用程序中的线程,它被调用阻塞或正在等待监视器释放锁定的对象,以便线程可以使用它。挂起的线程可能是由简单的软件缺陷(例如无限循环)或更复杂的原因(例如资源死锁)引起的。如果线程数量增加,该服务器的 Java 进程的 CPU 使用率可能会变得很高并且无响应。

有一些方法可以增加挂起时间(默认 10 分钟),但不推荐。您优化或限制了 Excel 报告生成过程。我认为,您正在提取的报告非常大,或者为了生成而更多地访问数据库,基本上可能是由于代码错误。增加线程池的数量与您的问题无关。

在 sysout.log 中:发布的警告消息的下面几行,应该给出一些关于导致此问题的 Java EE 类的想法。 FFDC 也帮助解决了这个问题。

默认情况下,挂起检测选项处于打开状态。您可以配置它以适应环境,以便报告潜在的挂起。当检测到挂起的线程时,WAS 会通知您,以便您解决问题。

使用挂起检测策略,您可以指定一个工作单元完成时间过长的时间。线程监视器检查所有托管线程,包括 Web 容器线程。

  1. 在管理控制台中,单击“服务器”>“应用程序服务器”>“server_name”
  2. 在“服务器基础结构”下,单击“管理”>“自定义属性”并单击“新建”。
  3. 添加以下属性:

Name: com.ibm.websphere.threadmonitor.interval
Value: The frequency (in seconds) at which managed threads in the selected application server will be interrogated.
Default: 180 seconds (three minutes).

Name: com.ibm.websphere.threadmonitor.dump.java
Value: Set to true to execute the dumpThreads function when a hung thread is detected and a WSVR0605W message is printed. The threads section of the javacore dump can be analyzed to determine what the reported thread
Default: false (0).

Name: com.ibm.websphere.threadmonitor.threshold
Value: The length of time (in seconds) in which a thread can be active before it is considered hung. Any thread that is detected as active for longer than this length of time is reported as hung.
Default: The default value is 600 seconds (ten minutes).

Name: com.ibm.websphere.threadmonitor.false.alarm.threshold
Value: The number of times (T) that false alarms can occur before automatically increasing the threshold. It is possible that a thread that is reported as hung eventually completes its work, resulting in a false alarm. A large number of these events indicates that the threshhold value is too small. The hang detection facility can automatically respond to this situation: For every T false alarms, the threshold T is increased by a factor of 1.5. Set the value to zero (or less) to disable the automatic adjustment. (Link to Detecting hung threads in J2EE applications for information on false alarms)
Default: 100

要禁用挂起检测选项,请将 com.ibm.websphere.threadmonitor.interval 属性设置为小于或等于零。

  1. 保存并重启 WAS 实例 enter image description here

关于websphere-7 - 线程 "WebContainer : 0"(00000029)已经活跃了647279毫秒,可能挂了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27042528/

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