I'm currently working with Java EE (WildFly 8.0) I have the following classes:
public interface A {
public void method();
}
It's Implementation
@Stateless
public class ABean implements A {
public void method() { //do stuff}
}
And a Singleton which has this interface as an EJB
@Singleton
@LocalBean
public class Singleton {
@EJB
public A a;
}
Whenever I call Singleton.a.method() within another EJB in my business logic, it throws an InvokationException saying: EJB Invocation failed.
Is there something missing here? I already tried declaring the interface @Local but still the same problem.
Have you tried wrapping the method call inside a method in the singleton?
This works for me on Wildfly 8.1, while TestSingleton.a.Method() fails with a NullPointer.