I have a Dynamic webproject created in eclipse with Glassfish server, I want to execute a specific class automatically when the server get started. That class has a listener that listens to a JMS queue, How can I achieve this? Do I have to configure it in web.xml? If so how to do it? Any code example would be really appreciated.