I've been working on this for a few days now and can't resolve an issue I'm having with an incoming Resource Adapter deployed on Weblogic 11g (10.3.2.0).
The RA creates a new Work (ie, thread) and performs a socket.accept() in the run() method of the work unit. This blocks indefinitely, which seems to result in Weblogic issuing BEA-000337 errors as follows:
<22-Apr-2010 09:45:52 o'clock BST> <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "698" seconds working on the request "weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl@55eea8ed", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
I'm not sure if it tries killing the offending thread or even the work manager - the documentation indicates that this should happen but I don't see any forced thread shutdowns in the logs and the RA continues accepting incoming connections.
I've tried creating a new Work Manager specifically for this RA with the "Ignore Stuck Threads" option specified. This gets rid of the BEA-000337 errors, however now when I try to perform a normal shutdown, the shutdown hangs indefinitely, presumably waiting for the 'stuck' work to complete.
The RA, on receiving the endpointDeactivation() or stop() callbacks will actually interrupt the socket.accept() call which is blocking the work, but these callbacks don't seem to get called by Weblogic until -after- the work has completed. So it appears to be a catch-22 situation.
If I 'force shutdown', the server ignores the 'stuck' work unit and calls the relevant callbacks on the RA which causes everything to shut down nicely from there on.
What would be the 'proper' way to deploy an incoming socket.accept() in a RA on WebLogic so that it doesn't cause stuck thread errors or block shutdowns? Obviosuly the WebLogic server handles this properly for its own listener sockets.
I'd prefer configuration settings to deal with this as the RA is running stable in other application servers, eg, GlassFish.
Forced shutdowns and recurring errors in the logs are not acceptable for production use.
Many thanks for any assistance,
I have a very similar problem, I think a thread executing java NIO selector.select() is reported to be in RUNNABLE state causing Weblogic to show this message even though it isn't really taking up 100% CPU. When setting the ingore-stuck-threads option it won't stop the inbound resource adapter, is there a workaround to this problem?
There is an annotation @LongRunning for this issue.