问题:
.UnsatisfiedDependencyException: Error creating bean with name 'adminController':
排查:
1、有说impl没有加@Service
2、有说mapper没使用@mapper或者启动类没使用MapperScan(‘com.xxx.mapper’)
都不是
解决:我在pom.xml
解决:查看resources文件夹,看是否已经Mark为Resources Root,如果没有,那就Mark一下。
解决!
为什么会出现这个问题呢,因为我重写了Resources配置
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
实际上应该把resources文件夹也加上的,如下:
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
解决 !!!