PostConstruct « Core « Spring Q&A





1. @PostConstruct method is not called in Spring    stackoverflow.com

SampleBean:

package com.springexample;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

public class SampleBean {

    private BeanTypeOne beanOne;

    private BeanTypeTwo beanTwo;

    public void init() {

      ...

2. @PostConstruct called twice    forum.springsource.org

@PostConstruct called twice Hi Forum, I did some research on this @PostConstruct called twice, but didn't found my case. The issue is: my @PostConstruct method been called twice in my web ...

3. @PostConstruct in test class    forum.springsource.org

Hi, I have a test class which extends AbstractTransactionalJUnit4SpringContextTests and has a method marked @PostConstruct. It appears that this method is being called before every test method, because a new instance ...

4. @PostConstruct does not work    forum.springsource.org

@PostConstruct does not work Env: Spring 2.5.1, JDK:1.6 I have a bean whose init-method is annotated with @PostConstruct so I can avoid having to specify the init-method in XML configuration: Code: ...

5. @PostConstruct not triggered    forum.springsource.org

@PostConstruct not triggered I have a FactoryBean implementation and I use @PostConstruct to trigger off the resolution of some complex dependencies and generate a bean when required. This all works fine ...

6. @PostConstruct and @PreDestroy, what are they for?    forum.springsource.org

Just a quick question. When would I want to use the @PostConstruct instead of constructors? Same with @PreDestroy when we have finalizers? Or were these just created for compatibility with EJB3 ...

7. Postconstruct and PreDestroy problems    forum.springsource.org

Postconstruct and PreDestroy problems hi, i'm trying to use @PostConstruct and @PreDestroy annotations in my class i tried to register CommonAnnotationBeanPostProcessor but the @PostConstruct and the @PreDestroy annotated methods aren't invoked ...

8. @PostConstruct called twice    forum.springsource.org

Hi, when I annotate a method with @PostConstruct the method is called offen (not every time!) twice. When ich use init-method in XML, it works fine. It is a MVC app ...

9. Help with @PostConstruct mediator    forum.springsource.org

Help with @PostConstruct mediator Hi all, Our app uses a mix of JDO and straight DAO objects. I have created an interface "MigrationCapable". I'm using @Autowired in the following code. Code: ...