I'm having a difficult time wrapping my head around the Javadoc for @PostConstruct
. It says:
If the method throws an unchecked exception the class MUST NOT be put into service except in the case of EJBs where the EJB can handle exceptions and even recover from them
In prior versions of Java the docs read:
The method MUST NOT throw a checked exception
The latter requirement seems to have been dropped. What does it mean "If the method throws an unchecked exception the class MUST NOT be put into service"? Should I prefer checked exceptions to unchecked exceptions in this context or does it matter?
Note that I'm aware of this similar question, but the Javadoc has since changed and my lack of understanding around the unchecked scenario is what drew me here.