I have a Singleton bean as follows:
@Singleton
@Startup
public class StartUpBean {
private static final Logger logger = LoggerFactory.getLogger(StartUpBean.class.getName());
public StartUpBean(){
logger.info("here");
}
@PostConstruct
public void onStartup(){
logger.info("hello?");
}
}
Which is inside a project named control that is referenced as an EJB module in a ear (i am using maven) as follows:
<project...>
<packaging>ear</packaging>
...
<dependencies>
...
<dependency>
<groupId>com.thenaglecode</groupId>
<artifactId>control</artifactId>
<version>1.0.0.Pre-Alpha</version>
<type>ejb</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
...
<configuration>
<ejbModule>
<groupId>com.thenaglecode</groupId>
<artifactId>control</artifactId>
<bundleFileName>control.jar</bundleFileName>
<bundleDir>/</bundleDir>
</ejbModule>
...
</configuration>
</plugin>
...
</plugins>
</build>
</project>
I can see the output that is binding the StartUpBean to it's jndi names:
20:23:50,217 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-12) JNDI bindings for session bean named StartUpBean in deployment unit subdeployment "control.jar" of deployment "thenaglecode.ear" are as follows:
java:global/thenaglecode/control/StartUpBean!com.thenaglecode.control.ejb.StartUpBean
java:app/control/StartUpBean!com.thenaglecode.control.ejb.StartUpBean
java:module/StartUpBean!com.thenaglecode.control.ejb.StartUpBean
java:global/thenaglecode/control/StartUpBean
java:app/control/StartUpBean
java:module/StartUpBean
But the code never gets to the post construct method. The break points are never hit even though i can successfully hit other ones in the same run. anybody have a clue what i'm missing? i've seen other similar posts where the solution was to do with the annotations, but my annotations are correct as far as i've read.
EDIT: Startup and Singleton are both from the javax.ejb package.