Multithreading 如何忽略Weblogic服务器中卡住的线程
我在Weblogic应用服务器10.3.2上有以下代码。在timerExpired上执行的长时间运行任务所花费的时间比服务器范围内的StuckThreadMaxTime(600秒)长。我不想修改这个值,只想忽略这个特定处理线程的阻塞线程超时 我可以从以下几点了解如何使用commonj WorkManager实现这一点: 然后将以下内容添加到weblogic.xml文件中的work manager标记中:Multithreading 如何忽略Weblogic服务器中卡住的线程,multithreading,weblogic,commonj,Multithreading,Weblogic,Commonj,我在Weblogic应用服务器10.3.2上有以下代码。在timerExpired上执行的长时间运行任务所花费的时间比服务器范围内的StuckThreadMaxTime(600秒)长。我不想修改这个值,只想忽略这个特定处理线程的阻塞线程超时 我可以从以下几点了解如何使用commonj WorkManager实现这一点: 然后将以下内容添加到weblogic.xml文件中的work manager标记中: true 但我究竟如何为计时器/计时器管理器做同样的事情呢 web.xml <res
true
但我究竟如何为计时器/计时器管理器做同样的事情呢
web.xml
<resource-ref>
<res-ref-name>tm/TestTimer</res-ref-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>wm/myworkmanager</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
我还没有尝试过这个,但是在weblogic.xml中添加这个条目应该可以
<work-manager>
<name>timer/TestTimer</name>
<ignore-stuck-threads>true</ignore-stuck-threads>
</work-manager>
定时器/测试定时器
真的
name
与web.xml中的res-ref-name
匹配
我的服务器是用计时器启动的好吧,我还没有测试你的客户端,看是否忽略了卡住的线程消息我还没有尝试过这个,但是在weblogic.xml中添加这个条目应该可以
<work-manager>
<name>timer/TestTimer</name>
<ignore-stuck-threads>true</ignore-stuck-threads>
</work-manager>
定时器/测试定时器
真的
name
与web.xml中的res-ref-name
匹配
我的服务器是用计时器启动的好吧,我还没有测试你的客户端,看是否会忽略卡住的线程消息我采取了简单的方法(时间压力),在计时器过期时,在工作管理器安排的工作中进行处理
public MyClass implements TimerListener, Work
@Override
public void timerExpired(Timer timer) throws Exception {
WorkManager workManager = initContext.lookup("wm/myworkmanager");
workManager.schedule(this);
}
@Override
public void run() {
doWork();
}
}
web.xml
<resource-ref>
<res-ref-name>tm/TestTimer</res-ref-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>wm/myworkmanager</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
wm/myworkmanager
公共工作经理
容器
不可分享的
weblogic.xml
<wls:work-manager>
<wls:name>wm/myworkmanager</wls:name>
<wls:ignore-stuck-threads>true</wls:ignore-stuck-threads>
</wls:work-manager>
wm/myworkmanager
真的
我采取了简单的方法(时间压力),在计时器过期时,在工作经理安排的工作中进行处理
public MyClass implements TimerListener, Work
@Override
public void timerExpired(Timer timer) throws Exception {
WorkManager workManager = initContext.lookup("wm/myworkmanager");
workManager.schedule(this);
}
@Override
public void run() {
doWork();
}
}
web.xml
<resource-ref>
<res-ref-name>tm/TestTimer</res-ref-name>
<res-type>commonj.timers.TimerManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
<resource-ref>
<res-ref-name>wm/myworkmanager</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
wm/myworkmanager
公共工作经理
容器
不可分享的
weblogic.xml
<wls:work-manager>
<wls:name>wm/myworkmanager</wls:name>
<wls:ignore-stuck-threads>true</wls:ignore-stuck-threads>
</wls:work-manager>
wm/myworkmanager
真的
Hi。我尝试了这个,但似乎不起作用,所以我现在正在安排WorkManager在计时器过期时的工作,并将WorkManager配置设置为ignore stack threads.Hi。我尝试了这个,但似乎不起作用,所以我现在正在安排WorkManager在计时器过期时的工作,并将WorkManager配置设置为忽略卡住的线程。