0 Replies Latest reply: Dec 30, 2011 12:41 PM by arjan tijms RSS

No injection in AsyncListener in AS 7.1

arjan tijms Novice

Using JBoss AS 7.1CRb I have defined the following Servlet AsyncListener:


public class AsyncServletListener implements AsyncListener {
    private AsyncBean asyncBean; 
    public void onStartAsync(AsyncEvent event) throws IOException {
    public void onComplete(AsyncEvent event) throws IOException {

    public void onError(AsyncEvent event) throws IOException {

    public void onTimeout(AsyncEvent event) throws IOException {


I registered this listener on an AsyncContext as follows:


AsyncContext asyncContext = request.startAsync();


The listener is called correctly, but there's no injection happening. Everything is inside a single war and the mandatory empty beans.xml has been created. JBoss AS is indeed starting up CDI ("Starting weld service" appears in the logs).


If I run the same code in GlassFish, injection does happen.