I have two SLSBs:
BeanF
,BeanO
in two ejb-jars:
ModF
,ModO
.
BeanF
fires an event and BeanO
observes it.
The first fire(-)
operation ends with the exception (Wildfly 8.2):
ERROR [org.jboss.as.ejb3.invocation] JBAS014134: EJB Invocation failed on component BeanF for method public void BeanF.publish(ModEvent):
javax.ejb.EJBException: org.jboss.msc.service.ServiceNotFoundException: Service service
jboss.deployment.subunit."myapp.ear"."modO.jar".component.BeanO.VIEW."BeanO".LOCAL not found
Further fire(-)
operations reach the observer but I can't let any event to be lost.
Is there a way to force the initialization of the observer before the event is fired (or on the fly after the event is fired and awaits processing)?
The @Observes(notifyObserver = Reception.IF_EXISTS)
only allows the event to be skipped silently when the observer is not ready yet.
In my case the BeanF
cannot be dependent on BeanO
because ModO
must be declared after ModF
in the application.xml
.
Is it possible with CDI events/listeners or would I need to go with JMS?