- 检查一下mapper.xml的namespace是否为对应的mapper的路径
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/ad73caa9e7b5ec862c7d8a088fbb1c67.png)
- 检查application.yml中定义的
mybatis: mapperLocations: classpath*:com/gy/springsecurity/security/bean/**/*.xml typeAliasesPackage: com.gy.springsecurity.security.bean.* configuration: mapUnderscoreToCamelCase: true
- 检车pom.xml中是否配置资源路径
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.dat</include>
<include>**/*.sql</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.yml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>