How to deploy Java stadnalone application on JBOSS along with other web applications : I am writing a Java program which will keep on listening to JMS/ActiveM queue for any messages. When there is a message posted on the queue, this program will pick up the message and process it. this program has a main method. Now I want to deploy this program in JBOSS/wildfly. already there are some web application deployed on JBOSS. I want to deploy this program also on JBOSS to avoid manual start ups. Whenever the JBOSS server starts, this program also should run and listen to queue.

If main method cannot be used, Need some advise on alternative solution to this requirement.