idea-创建springboot项目启动报错

idea创建springboot项目启动报错

1. 问题描述

D:\Java\jdk1.8.0_60\bin\java -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=13063 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-javaagent:D:\IntelliJ IDEA 2017.2.1\lib\idea_rt.jar=13064:D:\IntelliJ IDEA 2017.2.1\bin" -Dfile.encoding=UTF-8 -classpath D:\Java\jdk1.8.0_60\jre\lib\charsets.jar;D:\Java\jdk1.8.0_60\jre\lib\deploy.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_60\jre\lib\javaws.jar;D:\Java\jdk1.8.0_60\jre\lib\jce.jar;D:\Java\jdk1.8.0_60\jre\lib\jfr.jar;D:\Java\jdk1.8.0_60\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_60\jre\lib\jsse.jar;D:\Java\jdk1.8.0_60\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_60\jre\lib\plugin.jar;D:\Java\jdk1.8.0_60\jre\lib\resources.jar;D:\Java\jdk1.8.0_60\jre\lib\rt.jar;E:\Workspaces\IdeaProjects\demo_cyb\target\classes;D:\maven\repo\org\springframework\boot\spring-boot-starter-data-redis\2.1.8.RELEASE\spring-boot-starter-data-redis-2.1.8.RELEASE.jar;D:\maven\repo\org\springframework\boot\spring-boot-starter\2.1.8.RELEASE\spring-boot-starter-2.1.8.RELEASE.jar;D:\maven\repo\org\springframework\boot\spring-boot-starter-logging\2.1.8.RELEASE\spring-boot-starter-logging-2.1.8.RELEASE.jar;D:\maven\repo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\maven\repo\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\maven\repo\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\maven\repo\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\maven\repo\org\slf4j\jul-to-slf4j\1.7.28\jul-to-slf4j-1.7.28.jar;D:\maven\repo\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\maven\repo\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\maven\repo\org\springframework\data\spring-data-redis\2.1.10.RELEASE\spring-data-redis-2.1.10.RELEASE.jar;D:\maven\repo\org\springframework\data\spring-data-keyvalue\2.1.10.RELEASE\spring-data-keyvalue-2.1.10.RELEASE.jar;D:\maven\repo\org\springframework\data\spring-data-commons\2.1.10.RELEASE\spring-data-commons-2.1.10.RELEASE.jar;D:\maven\repo\org\springframework\spring-tx\5.1.9.RELEASE\spring-tx-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\spring-beans\5.1.9.RELEASE\spring-beans-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\spring-oxm\5.1.9.RELEASE\spring-oxm-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\spring-aop\5.1.9.RELEASE\spring-aop-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\spring-context-support\5.1.9.RELEASE\spring-context-support-5.1.9.RELEASE.jar;D:\maven\repo\org\slf4j\slf4j-api\1.7.28\slf4j-api-1.7.28.jar;D:\maven\repo\io\lettuce\lettuce-core\5.1.8.RELEASE\lettuce-core-5.1.8.RELEASE.jar;D:\maven\repo\io\netty\netty-common\4.1.39.Final\netty-common-4.1.39.Final.jar;D:\maven\repo\io\netty\netty-handler\4.1.39.Final\netty-handler-4.1.39.Final.jar;D:\maven\repo\io\netty\netty-buffer\4.1.39.Final\netty-buffer-4.1.39.Final.jar;D:\maven\repo\io\netty\netty-codec\4.1.39.Final\netty-codec-4.1.39.Final.jar;D:\maven\repo\io\netty\netty-transport\4.1.39.Final\netty-transport-4.1.39.Final.jar;D:\maven\repo\io\netty\netty-resolver\4.1.39.Final\netty-resolver-4.1.39.Final.jar;D:\maven\repo\io\projectreactor\reactor-core\3.2.12.RELEASE\reactor-core-3.2.12.RELEASE.jar;D:\maven\repo\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\maven\repo\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.0\mybatis-spring-boot-starter-2.1.0.jar;D:\maven\repo\org\springframework\boot\spring-boot-starter-jdbc\2.1.8.RELEASE\spring-boot-starter-jdbc-2.1.8.RELEASE.jar;D:\maven\repo\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\maven\repo\org\springframework\spring-jdbc\5.1.9.RELEASE\spring-jdbc-5.1.9.RELEASE.jar;D:\maven\repo\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.0\mybatis-spring-boot-autoconfigure-2.1.0.jar;D:\maven\repo\org\mybatis\mybatis\3.5.2\mybatis-3.5.2.jar;D:\maven\repo\org\mybatis\mybatis-spring\2.0.2\mybatis-spring-2.0.2.jar;D:\maven\repo\org\springframework\boot\spring-boot-devtools\2.1.8.RELEASE\spring-boot-devtools-2.1.8.RELEASE.jar;D:\maven\repo\org\springframework\boot\spring-boot\2.1.8.RELEASE\spring-boot-2.1.8.RELEASE.jar;D:\maven\repo\org\springframework\spring-context\5.1.9.RELEASE\spring-context-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\spring-expression\5.1.9.RELEASE\spring-expression-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\boot\spring-boot-autoconfigure\2.1.8.RELEASE\spring-boot-autoconfigure-2.1.8.RELEASE.jar;D:\maven\repo\mysql\mysql-connector-java\8.0.17\mysql-connector-java-8.0.17.jar;D:\maven\repo\org\springframework\spring-core\5.1.9.RELEASE\spring-core-5.1.9.RELEASE.jar;D:\maven\repo\org\springframework\spring-jcl\5.1.9.RELEASE\spring-jcl-5.1.9.RELEASE.jar com.cyb.demo.DemoApplication

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.8.RELEASE)

2019-09-17 17:12:29.581  INFO 988 --- [  restartedMain] com.cyb.demo.DemoApplication             : Starting DemoApplication on USER-20180930HX with PID 988 (E:\Workspaces\IdeaProjects\demo_cyb\target\classes started by Administrator in E:\Workspaces\IdeaProjects\demo_cyb)
2019-09-17 17:12:29.584  INFO 988 --- [  restartedMain] com.cyb.demo.DemoApplication             : No active profile set, falling back to default profiles: default
2019-09-17 17:12:29.619  INFO 988 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-09-17 17:12:30.037  INFO 988 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-09-17 17:12:30.040  INFO 988 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-09-17 17:12:30.073  INFO 988 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 9ms. Found 0 repository interfaces.
2019-09-17 17:12:30.159  WARN 988 --- [  restartedMain] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.cyb.demo]' package. Please check your configuration.
2019-09-17 17:12:30.371  WARN 988 --- [  restartedMain] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2019-09-17 17:12:30.379  INFO 988 --- [  restartedMain] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-09-17 17:12:30.386 ERROR 988 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).


Process finished with exit code 0

截图:

在这里插入图片描述

2. 问题原因

引入了数据库相关的包,但是没有增加数据库配置

3. 解决方法

注释引用的包,需要的时候再进行引入
在这里插入图片描述

参考链接

https://blog.csdn.net/qq_33472557/article/details/81256249

发布了36 篇原创文章 · 获赞 3 · 访问量 2939

猜你喜欢

转载自blog.csdn.net/weixin_39836585/article/details/100933350
今日推荐