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);
}
其他略。。。
}
报错信息及部分代码
分享到:
相关推荐
org.springframework.web.bind.annotation.SessionAttributes.class org.springframework.web.bind.support.ConfigurableWebBindingInitializer.class org.springframework.web.bind.support....
3. **元数据与注解处理**:`org.springframework.core.annotation`包实现了对Java注解的处理,包括注解的元数据解析、处理和应用,使得基于注解的编程成为可能。Spring框架大量使用注解简化配置,如@Component、@...
6. `org.springframework.core.annotation`: 包含了对Java注解的处理,如`MergedAnnotations`接口,用于合并和检索注解信息,是Spring元数据解析的关键部分。 7. `org.springframework.core.type`: 提供了类型扫描...
org.springframework.test.annotation.AbstractAnnotationAwareTransactionalTests.class org.springframework.test.annotation.DirtiesContext.class org.springframework.test.annotation.ExpectedException.class...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...
spring mvc 开发的必须有的架包org.springframework.web.servlet-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.0.M4.jar
org.springframework.transaction-3.0.0.M4.jar
The import org.springframework.web.bind.annotation cannot be resolved. json.jar spring.jar mail.jar log4j.jar
org.springframework.osgi.extensions.annotation-1.2.1.jar
org.springframework.beans.annotation org.springframework.beans.factory org.springframework.beans.factory.access org.springframework.beans.factory.access.el org.springframework.beans.factory.annotation...
xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:oscache=...
nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...
nested exception is java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are ...
赠送jar包:jakarta.annotation-api-1.3.5.jar; 赠送原API文档:jakarta.annotation-api-1.3.5-javadoc.jar; 赠送源代码:jakarta.annotation-api-1.3.5-sources.jar; 赠送Maven依赖信息文件:jakarta.annotation...
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:689) at org.springframework.web.servlet.mvc.method....
import org.springframework.context.annotation.ComponentScan; @SpringBootApplication @ComponentScan(basePackages = {"com.example.*"}) //指定扫描包路径 public class DemoApplication { public static void ...
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication public class MainApplication { public static ...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java....
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...