I am using commonJ work managers running in web logic environment.
My setup is as follows:
My spring application context
<bean id="workManagerTaskExecutor" class="org.springframework.scheduling.commonj.WorkManagerTaskExecutor"> <property name="workManagerName" value="java:comp/env/wm/UVWorkManager" /> </bean>
My web.xml file in WEB-INF
<resource-ref> <res-ref-name>wm/UVWorkManager</res-ref-name> <res-type>commonj.work.WorkManager</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
and my weblogic.xml file in WEB-INF
<work-manager>
<name>wm/UVWorkManager</name>
<min-threads-constraint>
<name>min threads</name>
<count>30</count>
</min-threads-constraint>
<max-threads-constraint>
<name>max threads</name>
<count>200</count>
</max-threads-constraint>
<capacity>
<name>max capacity</name>
<count>20</count>
</capacity>
<work-manager-shutdown-trigger>
<max-stuck-thread-time>600</max-stuck-thread-time>
<stuck-thread-count>100</stuck-thread-count>
</work-manager-shutdown-trigger>
</work-manager>
After a while calling the service from SOAP-UI. I am getting the following error
commonj.work.WorkException: commonj.work.WorkRejectedException: [WorkManager:002912]OverloadManager max capacity rejected request as current length 20 exceeds max capacity of 20
I know as the maximum is set to it will be rejected but why doesn't it reclaim those threads? Even if I wait 15 minutes I cannot submit a new request. I have to reboot the service.
The capacity includes all requests, queued or executing, from the constrained work set. To verify the status of the threads, do a thread dump of the JVM.
You should set the JVM flag -Dweblogic.StuckThreadHandling=true to append WorkManager's name in log files when the theard dump is generated.