Singleton Bean fails to call session bean in @PreDestroy in EJB in JBoss EAP 6
Issue
- There exists a Singleton Bean for initialization stuff with a @PostContruct for construction of Resources.
-
When initializing a resource for an EJB Bean, the @PostConstruct annotation is fine, but its not possible for a method to be called a method in the @Predestroy on JBoss Shutdown.
-
We are directly performing a remote lookup on @Singleton Bean.
- When calling a method in @PreDestroy, we can getting the exception,
JBAS014134: EJB Invocation failed on component xxxx for method public java.lang.String ws.SOMECLASS METHOD(java.lang.String): org.jboss.as.ejb3.component.EJBComponentUnavailableException: JBAS014559: Invocation cannot proceed as component is shutting down
- Why method marked as pre-destroy is not called for Singleton Session Bean?
Environment
- JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.