Announcement Announcement Module
Collapse
No announcement yet.
EJB @PostConstruct method being invoked twice Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EJB @PostConstruct method being invoked twice

    Hi,

    I'm using Spring 3.0 for DI in a SLSB EJB 3.0 bean.
    The bean has a @PostConstruct annotated method that appears to get invoked twice: once by the EJB container and once by Spring. Is this correct?

    Spring is bootstrapped using an interceptor like this:

    @Interceptors(SpringBeanAutowiringInterceptor.clas s)

    @PostConstruct
    public void init() {
    //...
    }

    I haven't explicitly registered any BeanPostProcessor classes.

    Is there a way to prevent the method being invoked multiple times?


    marko

  • #2
    If it is invoked twice it is constructed twice... Did you register the bean as a spring bean?

    Comment

    Working...
    X