java – 想法检查batis mapper bean错误
发布时间:2020-12-15 02:00:52 所属栏目:Java 来源:网络整理
导读:有 Spring和MyBatis的网络项目.我使用IntelliJ IDEA进行开发. 虽然存在与数据访问对象的链接,但IDEA无法正确检查MyBatis bean并产生令人讨厌的欠压. 检查评论: Could not autowire. No beans of 'ApplicationMapper' type found. 我的Spring和MyBatis配置:
有
Spring和MyBatis的网络项目.我使用IntelliJ IDEA进行开发.
虽然存在与数据访问对象的链接,但IDEA无法正确检查MyBatis bean并产生令人讨厌的欠压. 检查评论: Could not autowire. No beans of 'ApplicationMapper' type found. 我的Spring和MyBatis配置: <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="configLocation" value="classpath:spring/mybatis-config.xml"/> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.db.gbs.gbsapps.rds.backend.model.integration.mapping"/> </bean> MyBatis的-config.xml文件: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <mappers> <mapper resource="mybatis/ApplicationMapper.xml"/> </mappers> </configuration> 有没有办法解决这个小问题? 解决方法@Repository @Mapper public interface ApplicationMapper { 会做的 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |