SSM框架中dao层和mapper.xml无法实现绑定,求大神指点啊

[复制链接]
查看11 | 回复6 | 2021-1-27 07:15:46 | 显示全部楼层 |阅读模式
描述:原本项目在另一台电脑运行正常,然后整个项目完整复制到这个电脑,就报下面错误,各方面配置也是正常的,ecilipse重启,电脑重启也没用,mapper.xml中的namespace配置也是对的
报错:
三月04,201811:20:57上午org.apache.catalina.core.StandardWrapperValveinvoke
严重:Servlet.service()forservlet[springMVC]incontextwithpath[/ExaminationSystem]threwexception[Requestprocessingfailed;nestedexceptionisorg.apache.ibatis.binding.BindingException:Invalidboundstatement(notfound):org.seventh.examingsystem.dao.StudentMapper.selectLogin]withrootcause
java.lang.IllegalArgumentException:ResultMapscollectiondoesnotcontainvaluefororg.seventh.examingsystem.pojo.Student
atorg.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)
atorg.apache.ibatis.session.Configuration.getResultMap(Configuration.java:534)
atorg.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:363)
atorg.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:303)
mapper.xml配置


sql语句:
select

fromSTUDENT
whereLOGINNAME=#{loginname,jdbcType=VARCHAR}










分 -->
回复

使用道具 举报

千问 | 2021-1-27 07:15:46 | 显示全部楼层
求大神指点啊,在线急等
回复

使用道具 举报

千问 | 2021-1-27 07:15:46 | 显示全部楼层
dao的pom中少个插件吧
回复

使用道具 举报

千问 | 2021-1-27 07:15:46 | 显示全部楼层
看你的web服务器中加载进来配置文件了吗
回复

使用道具 举报

千问 | 2021-1-27 07:15:46 | 显示全部楼层
这错误提示很明显了啊,仔细找找吧~
回复

使用道具 举报

千问 | 2021-1-27 07:15:46 | 显示全部楼层
resultMap="BaseResultMap"你把这个resultmap和student的pojo类发上来看看
回复

使用道具 举报

千问 | 2021-1-27 07:15:46 | 显示全部楼层
org.seventh.examingsystem.pojo.Student
org.seventh.examingsystem.dao.StudentMapper.selectLogin]withrootcause
检查一下pojo类和resultMap="BaseResultMap"是否对应
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行