運行springboot項目報錯:Field userMapper in XX required a bean of type 'xx' that could not be found.

運行springboot項目報錯:spring

***************************springboot

APPLICATION FAILED TO STARTapp

***************************ide

Description:ui

Field userMapper in com.whohim.springboot.service.impl.UserServiceImpl required a bean of type 'com.whohim.springboot.dao.UserMapper' that could not be found.code

Action:blog

Consider defining a bean of type 'com.whohim.springboot.dao.UserMapper' in your configuration.ip

Process finished with exit code 0

it

在項目啓動類加上下面註解便可(掃描對應的mapper包)io

相關文章
相關標籤/搜索