你好,在方法上加上注解@PostConstruct 就可以了 @Service(value = "xxxServiceImpl")public class XXXSerivceImpl { @PostConstruct //bean初始化之前调用的方法,等同于xml配置的init-method public void init() { ...... } }