The "default" way is to have a servlet with an init() method. Then in the servlet-descriptor you mark this servlet as load-on-startup 1:
Example:
Seam Resource Servlet
org.jboss.seam.servlet.SeamResourceServlet
1
As soon as the servlet is deployed (which happens after the EJBs are deployed), that init() method is called and you can execute the task you want.