admin管理员组文章数量:1025218
目录
一、问题描述
二、创建文件MyBatisConfig
三、或者直接
一、问题描述
Description:
Parameter 0 of constructor in com.god.demo.app.service.impl.SysUserServiceImpl required a bean of type 'com.god.demo.app.dao.mapper.SysUserMapper' that could not be found.
Action:
Consider defining a bean of type 'com.god.demo.app.dao.mapper.SysUserMapper' in your configuration.
Disconnected from the target VM, address: '127.0.0.1:63159', transport: 'socket'
说明:
com.god.emo.app.service.impl.SysUserServiceImpl中构造函数的参数0需要类型为“com.god.demo.app.dao.mapper.SysUserMapper”的bean,但找不到该bean。
操作:
考虑在配置中定义一个类型为“com.god.demo.app.dao.mapper.SysUserMapper”的bean。
已断开与目标VM的连接,地址:“127.0.0.1:63159”,传输:“socket”
二、创建文件MyBatisConfig
@MapperScan("com.xx.dao.mapper")
@Configuration
public class MyBatisConfig {
@Bean
public ConfigurationCustomizer configurationCustomizer() {
return configuration -> {
//驼峰命名法
configuration.setMapUnderscoreToCamelCase(true);
};
}
}
三、或者直接
@MapperScan("com.xx.dao.mapper")
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
有用请点赞,养成良好习惯!
疑问、交流、鼓励请留言!
目录
一、问题描述
二、创建文件MyBatisConfig
三、或者直接
一、问题描述
Description:
Parameter 0 of constructor in com.god.demo.app.service.impl.SysUserServiceImpl required a bean of type 'com.god.demo.app.dao.mapper.SysUserMapper' that could not be found.
Action:
Consider defining a bean of type 'com.god.demo.app.dao.mapper.SysUserMapper' in your configuration.
Disconnected from the target VM, address: '127.0.0.1:63159', transport: 'socket'
说明:
com.god.emo.app.service.impl.SysUserServiceImpl中构造函数的参数0需要类型为“com.god.demo.app.dao.mapper.SysUserMapper”的bean,但找不到该bean。
操作:
考虑在配置中定义一个类型为“com.god.demo.app.dao.mapper.SysUserMapper”的bean。
已断开与目标VM的连接,地址:“127.0.0.1:63159”,传输:“socket”
二、创建文件MyBatisConfig
@MapperScan("com.xx.dao.mapper")
@Configuration
public class MyBatisConfig {
@Bean
public ConfigurationCustomizer configurationCustomizer() {
return configuration -> {
//驼峰命名法
configuration.setMapUnderscoreToCamelCase(true);
};
}
}
三、或者直接
@MapperScan("com.xx.dao.mapper")
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
有用请点赞,养成良好习惯!
疑问、交流、鼓励请留言!
本文标签: TypeBeandefiningConfigurationSysUserMapper
版权声明:本文标题:Consider defining a bean of type ‘com....mapper.SysUserMapper‘ in your configuration. 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1738336617a1562811.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论