O método @PostConstruct não é chamado no Spring
SampleBean:
package com.springexample;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
public class SampleBean {
private BeanTypeOne beanOne;
private BeanTypeTwo beanTwo;
public void init() {
System.out.println("This is from the init() method");
}
@PostConstruct
public void initAnnotation() {
System.out.println("This is from the initAnnotation() method");
}
e arquivo de configuração como este:
<bean id="SampleBean" class="com.springexample.SampleBean">
<property name="beanOne" ref="beanOneOne"></property>
<property name="beanTwo" ref="beanTwoOne"></property>
</bean>
E eu não tenhométodo init-padrão atributo definido nofeijões etiqueta, rótulo, palavra-chave.
Alguém pode dizer por que o método @PostConstruct não é chamado.