Failed to bind properties under ‘mybatis-plus.global-config.db-config.id-type‘ to com.baomidou.my...
错误信息:2021-03-31 16:06:00.854INFO 8840 --- [main] o.apache.catalina.core.StandardService: Stopping service [Tomcat]2021-03-31 16:06:00.867INFO 8840 --- [main] ConditionEvaluationReportLoggingListener :
·
错误信息:
2021-03-31 16:06:00.854 INFO 8840 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-03-31 16:06:00.867 INFO 8840 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-31 16:06:00.873 ERROR 8840 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'mybatis-plus.global-config.db-config.id-type' to com.baomidou.mybatisplus.annotation.IdType:
Property: mybatis-plus.global-config.db-config.id-type
Value: assign_id
Origin: class path resource [bamu-mybatis.yml]:12:16
Reason: failed to convert java.lang.String to com.baomidou.mybatisplus.annotation.IdType
Action:
Update your application's configuration. The following values are valid:
AUTO
ID_WORKER
ID_WORKER_STR
INPUT
NONE
UUID
Disconnected from the target VM, address: '127.0.0.1:64758', transport: 'socket'
Process finished with exit code 1
原因:错误信息中说的很明白了,在配置文件中对主键的类型设定不存在(未绑定成功),因此,要么是没有在配置文件中设定 IdType,要么就是设置错了,设置如下:
在 mybatis-plus 中配置上:
global-config:
db-config:
id-type: auto
更多推荐
已为社区贡献2条内容
所有评论(0)