@Startup @Singleton @PostConstruct not called in jar with ejb-jar.xml specifying 2.x in JBoss EAP 6

Solution Unverified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content