Revision history [back]

click to hide/show revision 1
initial version

answered 2017-10-05 11:41:20 +0800

cor3000 gravatar image cor3000

you can use an alternative API method to retrieve an application scoped event queue by passing in a WebApp instance instead of a String: EventQueues#lookup(String, WebApp, boolean)

EventQueue myQueue = EventQueues.lookup("MY_QUEUE", WebApps.getCurrent(), true);

This might still fail depending on your class loader setup ... please give it a try and let me know if the problem persists.


I'll suggest to allow this also in the String based method.

you can use an alternative API method to retrieve an application scoped event queue by passing in a WebApp instance instead of a String: String (as of the documentation this method also allows to be called outside an active execution): EventQueues#lookup(String, WebApp, boolean)

EventQueue myQueue = EventQueues.lookup("MY_QUEUE", WebApps.getCurrent(), true);

This might still fail depending on your class loader setup ... please give it a try and let me know if the problem persists.


I'll suggest to allow this also in the String based method.

Here the related javadoc:

This method can be called only in an activated execution, i.e., Executions.getCurrent() not null. If you want to use it without an execution, please use lookup(String, Session, boolean) or lookup(String, WebApp, boolean) instead (depending on your scope).

This means you can use an alternative API method to retrieve an application scoped event queue by passing in a WebApp instance instead of a String (as of the documentation this method also allows to be called outside an active execution): String: EventQueues#lookup(String, WebApp, boolean)

Unlike lookup(String, String, boolean), this method can be called without an activated execution.

So this should be possible from within your webapp:

EventQueue myQueue = EventQueues.lookup("MY_QUEUE", WebApps.getCurrent(), true);

This might still fail depending on configuration (e.g. your class loader setup EJB module might be deployed remotely or in a separate classloader) ... please Please give it a try and let me know if the problem persists.

Here the related javadoc:

This method can be called only in an activated execution, i.e., Executions.getCurrent() not null. If you want to use it without an execution, please use lookup(String, Session, boolean) or lookup(String, WebApp, boolean) instead (depending on your scope).

This means you can use an alternative API method to retrieve an application scoped event queue by passing in a WebApp instance instead of a String: EventQueues#lookup(String, WebApp, boolean)

Unlike lookup(String, String, boolean), this method can be called without an activated execution.

So this should be possible from within your webapp:

EventQueue myQueue = EventQueues.lookup("MY_QUEUE", WebApps.getCurrent(), true);

This might still fail depending on configuration (e.g. your EJB module might be deployed remotely or in a separate an isolated classloader) ... Please give it a try and let me know if the problem persists.

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More