@Resource injects by name. So we are fine here. Are there @Autowired in the code? Should replace them with @Resource.