I think a lot of developers would probably appreciate the solution. This is simply solved by not using @Resource, instead you can use @Autowired, and/or with combination of @Qualifier, with the point being taking component scanning of @Resource out of the equation.