注解@PreDestory在scope是prototype的时候没有执行,如果scope为prototype则可以执行,请问这是什么原因?
<context:component-scan base-package="com.hiway.entity"></context:component-scan>

<bean name="service" class="com.hiway.entity.UserService" scope="prototype">

</bean>@Component("service")
public class UserService { private User u ; public User getU() {
return u;
} @Resource(name="u")
public void setU(User u) {
this.u = u;
}

@PostConstruct
public void init(){
System.out.println("post constructor");
}

@PreDestroy
public void destroy(){
System.out.println("pre destroy");
}
}
在销毁ClassPathXmlApplicatonContext的时候,没调用@PreDestory的方法,请问为什么?