I'am testing the new feature of the EJB 3.1 concerning the asynchronous invocation using JBOSSAS 6.0.0M4

Strangely, i'm not having an asynchronous behaviour, my client is blocked when calling the asynchronous method

i am using two EJB3.1 session beans :

My asynchronous method

@Asynchronous

public void changeState() {

System.out.println("change state started");

number++;

try {

Thread.sleep(10000);

} catch (InterruptedException e) {

e.printStackTrace();

}

setState("asychronous call succeded");

System.out.println("change state finished");

//System.err.println("asychronous call succeded");

//return new AsyncResult<String>(getState());

}

@Asynchronous

public void changeState() {

System.out.println("change state started");

number++;

try {

Thread.sleep(10000);

} catch (InterruptedException e) {

e.printStackTrace();

}

System.out.println("change state finished");

}

My Client call :

public String sayHello(){

String test = null;

System.out.println("Accesing the async invocation");

masr.changeState();// this is the call to the asynchronous method

System.out.println("i will get the result later");

System.out.println("after doing somthing else");

return "i finally got the answer";

}

i tried the same thing using Future<V> and i'm having the same resultes.i'm wondering if thread.sleep() method is not suitable for an asynchronous call or if the trace using sysout is not convenient for having a trace of an asynchronous call.

I changed my MyAsyncStateless type, when i made it stateless (and stateful later) that worked fine...but still the same problem with a singleton bean (i checked in jboss and i do not have any other singleton instance)

@Asynchronous invocation (except on nointerface view) is available in AS 6.0.0.M4/M5. The nointerface view @Asynchronous invocation bug will be fixed before AS 6.0 goes GA. What exact issue are you running into? Please post the relevant details including the code and any configs and logs.