This discussion is archived
2 Replies Latest reply: Aug 4, 2010 12:49 AM by 652803 RSS

Incoming RA - stuck threads on socket.accept()?

768453 Newbie
Currently Being Moderated

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 (

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 "$WorkAdapterImpl@55eea8ed", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace: Method)$

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,
- Micha.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points