my problem is that the @PostConstruct is called twice even though it shouldn't. I searched a lot and found similiar problems with jersey https://java.net/jira/browse/JERSEY-1883?filter=-3. However I tried to make a small example which apparently still causes the problem even without any clatter.
import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@Singleton
@Startup
public class TestSingleton {
@PostConstruct
public void init() {
System.out.println("How many times am I being called?");
}
}
Configuration
- Application server: Glassfish 3.1.2
- Java Version: JDK 1.7_17
- Packaging: A war file within an ear
Any ideas?