org.springframework.context.annotation.ConflictingBeanDefinitionException: Annot

Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean  name 'usersDao' for bean class [com.dahua.dssc.users.dao.UsersDaoImpl] conflicts with existing, non-compatible bean  definition of same name and class [com.dahua.dssc.user.UsersDaoImpl]



public interface JDBCBaseDao<T, ID extends Serializable> {其他略。。。}

@Repository
public class JDBCBaseDaoImpl<T, PK extends Serializable>
implements JDBCBaseDao<T, PK> {

@Autowired
private JdbcTemplate jdbcTemplate ;


public SimpleJdbcCall createSimpleJdbcCall() {
return new SimpleJdbcCall(this.jdbcTemplate);
}
其他略。。。
}


@Transactional
@Repository
public interface UsersDao extends JDBCBaseDao<Users, Long> {
// 显示全部用户
public List<Users> getUsers(Pager pager);
public int countAll() ;
}

public class UsersDaoImpl extends JDBCBaseDaoImpl<Users, Long> implements UsersDao{
}

public class AllTests extends BaseTestTemplate implements test{

    @Resource(name="usersDao")
    private UsersDao usersDao;
@Test
public void testList() {
//删除方法
usersDao.deleteById(Users.class,3354L);
}
其他略。。。
}
报错信息及部分代码

猜你喜欢

转载自shizhijian870525.iteye.com/blog/1698279