How can I configure dependency on JMS service?
Issue
- How can I configure dependency on JMS service?
I have this class:
@Singleton
@Startup
public class ApplicationStartup {
and this method:
@PreDestroy
public void stopService() {
System.out.println("*******Service has been stopped *******");
}
When I add this to the class:
@Resource(mappedName = "queue/xyz")
private static Queue queue;
the method "stopService() " is not called when server stops.
Strange. When I remove this ( private static Queue queue;
) then this method is called again.
Can you suggest why?
Environment
- Red Hat JBoss Enterprise Application (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.