3

I have a singleton startup ejb A which depends on another singleton startup ejb B which is in another module. I added depends on annotation but the deployment failed with no ejb found exception.

Then I moved the startup ejb to the module where the other startup ejb is placed. The startup ejb are initializing fine now.

Then I tried injecting the singleton ejb A using inject annotation in a stateless ejb from another module and the deployment failed with no ejb exception.

Can anyone help me fix this issue.

P.S Also I would like to know how to use dependson annotation when the startup singleton ejb are in different modules. I used the jarname.jar#EjbName but it did not work.

Krishna Chaitanya
  • 2,533
  • 4
  • 40
  • 74
  • I figured out why the singleton ejb is not injecting in the stateless ejb. The reason is the singleton is implementing an interface(listener related to something else) and the binding was not happening because the container assumed/confused with the listener interface. I created a new interface and made the singleton implement it and added @Local(Clazz.class) and then the deployment is successful. But I still want to know how to use DependsOn annotation when ejb are in different modules – Krishna Chaitanya Oct 04 '16 at 15:13

0 Answers0