I have a simple mavenized Spring 3.1 MVC application with running in Eclipse on a Tomcat 6.0 server.
My controller is Autowiring a DAO as shown below
@Autowired
private UserDAO userDAO;
@Component
public class UserDAO extends NamedParameterJdbcDaoSupport implements UserDetailsService {....}
I have <mvc:annotation-driven />
in my spring context file. All works well. Now, I did a ctrl+c + ctrl+p (copy-paste) of UserDAO. I kept the name as CopyOfUserDAO. I changed the private class in Controller to CopyOfUserDAO. When I start tomcat, it is unable to find CopyOfUserDAO bean. I did all kinds of clean-up but it is unable to find the CopyOfUserDAO. I even created a new class from scratch and updated controller and yet it is unable to find it.
What am I doing wrong?