org.apache.ibatis.binding.BindingException spring springMVC mybatis 整合

xiaoxiao2021-02-28  135

严重: Servlet.service() for servlet [springMVC] in context with path [/ssMVCm] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Type interface com.mapper.PersonMapper is not known to the MapperRegistry.] with root cause

org.apache.ibatis.binding.BindingException: Type interface com.mapper.PersonMapper is not known to the MapperRegistry.

找不到对应的mybatis配置文件

配置sqlSession的时候

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mapperLocations" value="classpath*:com/mapper/*.xml" /> </bean>

把对应的mybatis配置文件配置上就行!

应该很多原因能引发这个异常,只是,我刚好是这个错误!

转载请注明原文地址: https://www.6miu.com/read-17538.html

最新回复(0)