Skip to Main Content

EJB 3.1 @Singleton with @Startup causes @PostConstruct to be called twice...

user3057653Feb 26 2015 — edited Feb 27 2015

I have been working on initializing a some elements in the @PostConstruct annotated method within an EJB that is already annotated as @Singleton.  I decided that I wanted the initialization to be done when the EJB is deployed so I added the @Startup.  Both the constructor and @PostConstruct method is getting called twice.  Can someone please explain to me why it appears the EJB is being initialized twice and if there is a way to prevent the @PostConstruct method from being called twice?

Many thanks,

- Joe

Post Details
Added on Feb 26 2015
1 comment