错误信息:

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
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐