6 Replies Latest reply on Nov 18, 2011 2:23 PM by jkronegg

    @Asynchronous EJB 3.1 AS7



      Invoking methods with @Asynchronous annotation  does not work with JBoss 7. In JBoss 6 you can invoke method asynchronously, but you can't cancel it. In AS7 the method isn't even invoked asynchronusly, also it can't be canceled. You get an Exception when you try to. I'm running standalone-prewiev.


      Will @Asynchronous ever be supported?


      I'm just asking because it's a very cool feature and it's quite useful for me.

        • 1. Re: @Asynchronous EJB 3.1 AS7

          It's not available in 7.0 but will be available in upcoming AS7 releases.

          • 2. Re: @Asynchronous EJB 3.1 AS7

            any detail plan? thxxxx

            • 3. Re: @Asynchronous EJB 3.1 AS7

              It's already there in 7.0.2 which has been released a while back.

              • 4. Re: @Asynchronous EJB 3.1 AS7

                Some of my colleagues using Jboss 7.0.1

                NOW, it is ok!



                • 5. Re: @Asynchronous EJB 3.1 AS7

                  Hi Jaikiran,


                  I tested a simple asynchronous EJB under Jboss AS 7.0.2.Final Arc, and it does not work (the asynchronous method waits for 5 seconds synchronously):



                  20:36:16,815 INFO  [stdout] (http-- request: begin Wed Nov 16 20:36:16 CET 2011

                  20:36:16,831 INFO  [stdout] (http-- doAsyncStuff: begin Wed Nov 16 20:36:16 CET 2011

                  20:36:21,832 INFO  [stdout] (http-- doAsyncStuff: end Wed Nov 16 20:36:21 CET 2011

                  20:36:21,834 INFO  [stdout] (http-- request: end Wed Nov 16 20:36:21 CET 2011



                  My EJB is :





                  public class MyAsyncService {


                      public void doAsyncStuff() {

                          System.out.println("doAsyncStuff: begin "+ new Date());

                          try {


                          } catch (InterruptedException e) {

                              System.out.println("doAsyncStuff: interrupted");


                          System.out.println("doAsyncStuff: end "+ new Date());





                  My servlet is :





                  public class MyServlet extends HttpServlet {



                      MyAsyncService myAsyncService;


                     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

                          System.out.println("request: begin "+new Date());




                          System.out.println("request: end "+new Date());





                  Is this code supposed to work under 7.0.2?

                  • 6. Re: @Asynchronous EJB 3.1 AS7

                    I found the solution: the server was configured with Web Profile (i.e. no asynchronous behavior) and not with the Full Profile.

                    I ran the server (7.0.2) with the following program argument in the Eclipse's server launch configuration:

                    {code}-server-config standalone-preview.xml{code}

                    JBoss AS 7.1 will merge the standalone and standalone-preview configuration.