描述:原本项目在另一台电脑运行正常,然后整个项目完整复制到这个电脑,就报下面错误,各方面配置也是正常的,ecilipse重启,电脑重启也没用,mapper.xml中的namespace配置也是对的报错:
三月 04, 2018 11:20:57 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springMVC] in context with path [/ExaminationSystem] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.seventh.examingsystem.dao.StudentMapper.selectLogin] with root cause
java.lang.IllegalArgumentException: Result Maps collection does not contain value for org.seventh.examingsystem.pojo.Student
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)
at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:534)
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:363)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:303)mapper.xml配置
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.seventh.examingsystem.dao.StudentMapper">
sql语句:
<select id="selectLogin" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from STUDENT
where LOGINNAME = #{loginname,jdbcType=VARCHAR}
</select><!-- spring整合myBatis -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" /><!-- 配置数据源 -->
<property name="configLocation" value="classpath:mybatis-config.xml" />
<property name="mapperLocations" value="classpath:mapper/*.xml" />
</bean><!-- dao mapping接口扫描 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="org.seventh.examingsystem.dao" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
三月 04, 2018 11:20:57 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springMVC] in context with path [/ExaminationSystem] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.seventh.examingsystem.dao.StudentMapper.selectLogin] with root cause
java.lang.IllegalArgumentException: Result Maps collection does not contain value for org.seventh.examingsystem.pojo.Student
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:775)
at org.apache.ibatis.session.Configuration.getResultMap(Configuration.java:534)
at org.apache.ibatis.builder.MapperBuilderAssistant.setStatementResultMap(MapperBuilderAssistant.java:363)
at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:303)mapper.xml配置
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="org.seventh.examingsystem.dao.StudentMapper">
sql语句:
<select id="selectLogin" resultMap="BaseResultMap"
parameterType="java.lang.String">
select
<include refid="Base_Column_List" />
from STUDENT
where LOGINNAME = #{loginname,jdbcType=VARCHAR}
</select><!-- spring整合myBatis -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" /><!-- 配置数据源 -->
<property name="configLocation" value="classpath:mybatis-config.xml" />
<property name="mapperLocations" value="classpath:mapper/*.xml" />
</bean><!-- dao mapping接口扫描 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="org.seventh.examingsystem.dao" />
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
</bean>
解决方案 »
- 中文乱码问题 请高手帮出出主意
- 关于jforum的几个疑问
- java web 作一个有连Oracle的网页时的错误:An exception occurred processing JSP page /success.j
- 新手学习,尝试做第一个jsp在线考试系统,请高手指点,100分相送
- HIHERNATE双表查询
- 使用可视化编辑器ewebedit(纯javascript)的编辑时的问题
- 如何关闭IE窗口?
- ※※※※讨论:关于数字签名及网络安全问题?请大家参与。※※※※
- 请问在jsp中怎么弹出一个提示框。。。
- 为什么我的JSP文件预览显示源码呢
- 求大佬帮帮忙
- 急,如何建立一张数据库的表,用来储存学生的成绩,但是又要包括这张试卷的各个题目的分数??
org.seventh.examingsystem.dao.StudentMapper.selectLogin] with root cause
检查一下pojo类和 resultMap="BaseResultMap" 是否对应