I would like to migrate some old EJB 2.1 code to EJB 3.0, but there is some handling of configuration errors in the ejbCreate method. Is there an EJB 3 version of that method?
Edit: In EJB 2.x ejbCreate could throw a CreateException. Based on the documentation of @PostConstruct etc. I can no longer throw any checked Exceptions. How can i handle this if i cannot migrate the code using the EJB right now.
Edit2: The frontend specifically handles CreateException which unfortunately is checked.
@PostConstruct
public void anyName() {
//initialization code, dependencies are already injected
}
No only the name is arbitrary, you can have several UPDATE:@PostConstruct
methods in one EJB - however the order of invocation is unspecified, so be careful and try to stick with one method.
Only one method can be annotated with this annotation.