springboot启动报错A component required a bean of type ‘com.xxx.service.xxxService‘
springboot启动报错A component required a bean of type ‘com.xxx.service.xxxService’Description:A component required a bean of type 'com.zzd.service.UserService' that could not be found.Action:Consider defi
·
springboot启动报错A component required a bean of type ‘com.xxx.service.xxxService’
Description:
A component required a bean of type 'com.zzd.service.UserService' that could not be found.
Action:
Consider defining a bean of type 'com.zzd.service.UserService' in your configuration.
Process finished with exit code 0
这条错误解决之后 ,又出现了另外数据库的错误
### Error updating database. Cause: java.sql.SQLException: Field 'user_id' doesn't have a default value
### The error may exist in file [H:\IdeaProjects\FMShop\springboot-demo01\target\classes\mappers\UserNapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into users(user_name,user_pwd,user_realname,user_img) values(?,?,?,?)
### Cause: java.sql.SQLException: Field 'user_id' doesn't have a default value
左链接查询时用的字段名称和已有的字段名称重复,Navicat里字段重复时会自动区分,mybatis里只能手动修改该字段名称
在设计表时主键id设置为自动递增,就能很简单的解决这个问题
更多推荐
已为社区贡献7条内容
所有评论(0)