启动Spring Boot 项目 报错:Application failed to start with classpath

错误信息:

启动Spring Boot 项目 报错:Application failed to start with classpath_第1张图片
image.png

看不出具体是哪里出了错,后来经过同事提醒,配置文件中数据库密码有特殊字符

spring:
  datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
     url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=sjdsx;autoReconnect=true
     username: sa
     password: !+r@sSsMGC1@@i25*w
  jpa:
     database: sql_server
     hibernate:
       ddl-auto: none
     show-sql: true
     database-platform: org.hibernate.dialect.SQLServer2008Dialect

需要加上引号:

spring:
  datasource:
     driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
     url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=sjdsx;autoReconnect=true
     username: sa
     password: '!+r@sSsMGC1@@i25*w'
  jpa:
     database: sql_server
     hibernate:
       ddl-auto: none
     show-sql: true
     database-platform: org.hibernate.dialect.SQLServer2008Dialect

你可能感兴趣的:(启动Spring Boot 项目 报错:Application failed to start with classpath)