Search code examples
configurationweblogicworker

Weblogic / EjbGen: worker manager configuration


I want to declare a worker manager to perform some work in managed thread.

Weblogic documentation tells that we can
- declare a global worker manager using the admin console
- declare a local it in an ejb-jar.xml config file.

I want to use the second option. But my ejb-jar.xml is generated by the ejbgen tool.

There is no tag in ejbgen that would allow me to declare a worker manager.

So how should I create a local worker manager declaration ?

I have gathered some interesting answers, posted as an answer to my own question.


Solution

  • I have gotsome useful answers for this question:

    • use the default work manager
      WorkManager wm = (WorkManager) new InitialContext().lookup("java:comp/env/wm/default";

    • use the weblogic-application.xml to configure the work manager instead of configuring it in the ejb-jar.xml

    • use a shared library (weblogic 9+ feature) that will contains the worker manager declaration.