描述:原本项目在另一台电脑运行正常,然后整个项目完整复制到这个电脑,就报下面错误,各方面配置也是正常的,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>