I created a Java Web Application Project in NetBeans, and created a startup bean in it:
package malibu.util; import javax.annotation.PostConstruct; import javax
Try the following set of annotations:
@Singleton @Startup public class Startup { @EJB private ProviderEJB providerEJB; @PostConstruct public void onStartup() { System.err.println("Initialization success."); } }
You will find more details here and in this book (chapter 2).