Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Local stateless EJB injection within singleton startup EJB

is this possible somehow? Following scenario:

  • statelesse local EJB with name A
  • singleton startup EJB with name B
  • B contains a reference to A

I tried but my application server (WAS) fails on application startup with the error that A was not found. The console log also makes clear that A was not started at the moment the B is loaded but some other stateless EJBs are started before B. Making A also a singleton EJB and letting B depond on A via annotation @DependsOn({"A"}) produced an error, too, stating that dependent bean A was not found. Using A in a web module works fine.

Any ideas what' I do wrong? Thx for any help! Steffen Harbich

like image 964
Steffen Harbich Avatar asked May 16 '26 04:05

Steffen Harbich


1 Answers

If A is in a different module/application as B, then you need to ensure that the module of A is configured to start before the module of B. You can either use initialize-in-order in application.xml, or use module starting weights in the admin console.

like image 65
Brett Kail Avatar answered May 19 '26 03:05

Brett Kail