Java – check Batis mapper bean error

There are spring and mybatis network projects I use IntelliJ idea for development

Review comments:

Could not autowire. No beans of 'ApplicationMapper' type found.

My spring and mybatis configurations:

<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 file:

<?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>

Is there any way to solve this small problem?

Solution

@Repository
@Repository
@Mapper 
public interface ApplicationMapper {

I'll do it

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>