-
1. Re: @Asynchronous EJB 3.1 AS7
jaikiran Jul 24, 2011 11:34 PM (in response to sprycjan)It's not available in 7.0 but will be available in upcoming AS7 releases.
-
2. Re: @Asynchronous EJB 3.1 AS7
iran1314 Nov 15, 2011 4:24 AM (in response to jaikiran)any detail plan? thxxxx
-
3. Re: @Asynchronous EJB 3.1 AS7
jaikiran Nov 15, 2011 5:32 AM (in response to iran1314)It's already there in 7.0.2 which has been released a while back.
-
4. Re: @Asynchronous EJB 3.1 AS7
iran1314 Nov 15, 2011 10:15 PM (in response to sprycjan)Some of my colleagues using Jboss 7.0.1
NOW, it is ok!
thxxx
-
5. Re: @Asynchronous EJB 3.1 AS7
jkronegg Nov 16, 2011 2:51 PM (in response to jaikiran)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):
{code}
20:36:16,815 INFO [stdout] (http--127.0.0.1-8080-1) request: begin Wed Nov 16 20:36:16 CET 2011
20:36:16,831 INFO [stdout] (http--127.0.0.1-8080-1) doAsyncStuff: begin Wed Nov 16 20:36:16 CET 2011
20:36:21,832 INFO [stdout] (http--127.0.0.1-8080-1) doAsyncStuff: end Wed Nov 16 20:36:21 CET 2011
20:36:21,834 INFO [stdout] (http--127.0.0.1-8080-1) request: end Wed Nov 16 20:36:21 CET 2011
{code}
My EJB is :
{code}
@Stateless
public class MyAsyncService {
@Asynchronous
public void doAsyncStuff() {
System.out.println("doAsyncStuff: begin "+ new Date());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
System.out.println("doAsyncStuff: interrupted");
}
System.out.println("doAsyncStuff: end "+ new Date());
}
}
{code}
My servlet is :
{code}
@WebServlet("/MyServlet")
public class MyServlet extends HttpServlet {
@EJB
MyAsyncService myAsyncService;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("request: begin "+new Date());
myAsyncService.doAsyncStuff();
System.out.println("request: end "+new Date());
}
}
{code}
Is this code supposed to work under 7.0.2?
-
6. Re: @Asynchronous EJB 3.1 AS7
jkronegg Nov 18, 2011 2:23 PM (in response to jkronegg)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.