页面发生500错误

页面发生500错误

org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/imooc/sm/dao/DepartmentDao.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ' String'.  Cause: java.lang.ClassNotFoundException: Cannot find class:  String

网页错误是

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentController': Unsatisfied dependency expressed through field 'departmentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'departmentService': Unsatisfied dependency expressed through field 'departmentDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'departmentDao' defined in URL [jar:file:/D:/apache-tomcat-8.5.39/webapps/ROOT/WEB-INF/lib/sm_service-1.0-SNAPSHOT.jar!/com/imooc/sm/dao/DepartmentDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/imooc/sm/dao/DepartmentDao.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ' String'.  Cause: java.lang.ClassNotFoundException: Cannot find class:  String

正在回答

登陆购买课程后可参与讨论,去登陆

2回答

同学,你好!检查一下DepartmentDao.xml文件,看一下resultType或者resultMap的内容是否写错了,可以和老师的源码对比一下。如果还不能解决,建议将DepartmentDao.xml的内容贴出来,贴到我要回答里。图片也可以放到我要回答里。

如下所示:鼠标单击我要回答的文本框,就会看到第二张图中的内容,点击选中的图标就可以上传图片了。

http://img1.sycdn.imooc.com//climg/5d439b4f0001f20707750099.jpg

http://img1.sycdn.imooc.com//climg/5d439b81000177e705490063.jpg

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

好帮手慕阿满 2019-08-01 16:32:40

同学你好,报错提示创建departmentController错误,创建departmentDao错误,建议同学检查一下DepartmentController类上是否有注解@Controller("departmentController"),DepartmentDao
类上是否有@Repository("departmentDao")注解,如:

http://img1.sycdn.imooc.com//climg/5d42a3950001d6a804610073.jpg

http://img1.sycdn.imooc.com//climg/5d42a38d0001309104090087.jpg

如果有,建议同学将控制的报错信息贴一下。

祝:学习愉快~

  • 提问者 慕勒0484729 #1
    注解看着没啥问题 但是错误还是没消 我不知道咋发图片
    2019-08-01 19:24:14
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师