### Error building SqlSession.
### The error may exist in com.pearl.mapper\StuClassMapper.xml
### The error occurred while processing mapper_resultMap[stuClassResultsMap]_collection[stuInfoList]
这是我第二次出现这个问题,第一次花了好长时间,才解决,这次又出现了这个错误
这次我出错的地方在StuClassMapper.xml文件里
<select id="findStuClassByCid" parameterType="Integer" resultMap="stuClassResultsMap">
select c.*,s.sid,s.sname,s.age,s.course from stu_class c,stu_info s where s.classid=c.cid and c.cid =#{cid}
</select>
这里的resultMap="stuClassResultsMap"> 切记不要写成resultType
另外,还可能出错的点
![](https://img-blog.csdnimg.cn/img_convert/f6bf1d1089a9d7d2f6ccf60262d5681c.png)
第三点:在Mybatis-config.xml文件中
如果写了下面的代码,表示直接告诉系统类所在的包名,这样之后,该包下的类可以直接使用类名作为返回值,且首字母不区分大小写!
![](https://img-blog.csdnimg.cn/img_convert/a053a231dd86cb9590fa435087dd776c.png)
即,在mapper.xml文件中
![](https://img-blog.csdnimg.cn/img_convert/5e35df31db520e37c294ff42b75e17ed.png)