springboot注入问题
springboot吧
全部回复
仅看楼主
level 1
启动报错Description:A component required a bean of type 'com.example.demo.sysfile.mapper.SysFileMapper' that could not be found.Action:Consider defining a bean of type 'com.example.demo.sysfile.mapper.SysFileMapper' in your configuration.Disconnected from the target VM, address: '127.0.0.1:61525', transport: 'socket'Process finished with exit code 1,但是将SysFileMapper文件放入user.mapper中就可以运行,这是为什么,其他的都没改动。
2023年07月27日 03点07分 1
level 1
是因为全局配置了
@Configuration
@MapperScan("com.example.demo.user.mapper")
public class MybatisPlusConfig {}
将@MapperScan("com.example.demo.user.mapper")改成@MapperScan("com.example.demo")就可以了
2023年07月27日 05点07分 2
1