这下问题来了,springmvc整合mybatis注解有问题,听说晚上高手多
java吧
全部回复
仅看楼主
level 10
浏览器错误:
HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name *studentController*: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.test.service.StudentServiceImpl com.test.controller.StudentController.studentService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name *studentServiceImpl*: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public com.test.dao.StudentMapper com.test.service.StudentServiceImpl.studentMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.test.dao.StudentMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2014年11月08日 15点11分 1
level 10
有没有也到过同中问题的额的人儿呢???
2014年11月08日 15点11分 2
level 10
他提示至少应该有一种注入,客可是我的那个也写了阿,来个个人给我说说贝
2014年11月08日 15点11分 3
level 10
求助
    -------众人皆醒而我独醉 @( ̄- ̄)@
2014年11月08日 15点11分 4
level 10
求解了
   --谁要是欺负我,我就把他挂在小尾巴上!!!
2014年11月08日 23点11分 5
level 7
mymails配置中没有定义扫描mapper的bean
2014年11月09日 00点11分 6
在factory里面定义了扫描,还要再另外定义一遍吗?
2014年11月09日 00点11分
说错了,是在spring配置中
2014年11月09日 01点11分
回复 q335977043 :好的,我试试就是在spring中也扫描那个mapper那个包吧
2014年11月09日 01点11分
是在spring缺少自动生成mapper实现的配置
2014年11月09日 01点11分
level 12
你就按着保存信息看,就能找到问题原因。
2014年11月09日 00点11分 7
找不到controller的那个bean,测试的时候能访问数据库,配置文件没错吧
2014年11月09日 00点11分
就是在controller中注入数据的时候失败了
2014年11月09日 01点11分
level 12
我也是小白
   --蓝脸的窦尔敦草泥马,红脸的关公床上趴 ,黄脸的几把,白脸的菊花,黑脸的楼主来~姨~妈~啊~啊~啊~
2014年11月09日 00点11分 8
求教啊
2014年11月09日 00点11分
level 9
楼主有springMvc学习资料吗? 想学下
2014年11月09日 01点11分 9
我都是在网上看视频的,孙浩的讲的比较详细
2014年11月09日 01点11分
回复 西门_吹雪pj :哦 谢谢 我去网上找找
2014年11月09日 03点11分
level 7
你把 @Controller类里面的 private StudentServiceImpl studentService;
换成接口 @Autowired StudentService studentService;
2014年11月09日 02点11分 10
试过,还是注入失败
2014年11月09日 03点11分
回复 西门_吹雪pj :你用的别 方式注入。。。。。xml配置 或者 把 mvc 注解先去掉。。。。只用 这几个类注解运行 看 。。。。。。。。。。
2014年11月09日 03点11分
回复 tobeleaderman :方法很多 。。。。。自己 看看 。。。。。。
2014年11月09日 03点11分
回复 tobeleaderman :你给我发个例子行不?
2014年11月09日 03点11分
level 11
com.test.dao.StudentMapper 注入失败 用的 @Resource 注解吧
2014年11月09日 03点11分 11
确实注入失败,可是换了还是不行
2014年11月09日 03点11分
level 9
我不会告诉你哥在达内培训的项目就是用SpringMVC+MyBatis实现的么?
2014年11月09日 18点11分 12
1