@Startup @Singleton @PostConstruct not called in jar with ejb-jar.xml specifying 2.x in JBoss EAP 6
Issue
- I have a Singleton class and packaged the same class in my application and deployed in standalone JBoss server. But I do not see the activate() method being called.
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@Startup
@Singleton
public class MySingleton {
private Logger log = Logger.getLogger(getClass());
@PostConstruct
public void activate() {
log.info("Activate Time: " + System.currentTimeMillis() + ". Activating SystemWorkerExecutorSingleton");
}
}
Environment
Red Hat JBoss Enterprise Application Platform (EAP) 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.