The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Multiple PostConstruct methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Multiple PostConstruct methods" Watch "Multiple PostConstruct methods" New topic

Multiple PostConstruct methods

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10031


I guess thie question has already been raised before. What happens when we have multiple methods in a bean class annotated as PostConstruct?? From the apecs, it is clear that only once the PostConstruct will be called, but which one would be choosen?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
It is unspecified, so it is unpredictable.
I agree. Here's the link:
subject: Multiple PostConstruct methods
It's not a secret anymore!