0
votes

On invoking an @Asynchronous method in EJB, I see an error getting logged though the method execution works fine. Any suggestion on what is going wrong? EJB 3.1 on WebSphere V8

The interface is :

@Local
public interface MyService {
    @Asynchronous
    public void doJob(MyObj o);
}

The implementation class :

@Stateless
@Local(MyService.class)
public class MyBean implements MyService {
    @Asynchronous
    public void doJob(MyObj o) {

        // insert to DB

   }
}

Error message

CWWAM1101E: In class {0} the method {1} is annotated with @Asynchronous but must be applied to a business method of a bean class or to a business method of a Local/Remote business interface.

2

2 Answers

1
votes

As you're implementing an interface (MyService) your bean doesn't expose a no-interface view. This means all methods for which the EJB container has to "do something", have to be defined in that interface.

It's very likely that void doJob(...) is not defined MyService. When in doubt, please show the full definition of doJob and MyService.

1
votes

This is a defect in WebSphere till V8.0.0.5 and a fix is expected in V8.0.0.6