springboot启动时报错

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

2020-03-16 16:13:09.621 INFO 13932 --- [ main] com.example.demo.Mysql123Application : Starting Mysql123Application on LAPTOP-PC170346 with PID 13932 (D:\spring-work\mysql123\target\classes started by 86135 in D:\spring-work\mysql123)
2020-03-16 16:13:09.626 INFO 13932 --- [ main] com.example.demo.Mysql123Application : No active profile set, falling back to default profiles: default
2020-03-16 16:13:10.529 INFO 13932 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-03-16 16:13:10.560 INFO 13932 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 18ms. Found 0 JPA repository interfaces.
2020-03-16 16:13:11.785 INFO 13932 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-03-16 16:13:11.800 INFO 13932 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-03-16 16:13:11.801 INFO 13932 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
2020-03-16 16:13:11.967 INFO 13932 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-03-16 16:13:11.967 INFO 13932 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2274 ms
2020-03-16 16:13:12.074 WARN 13932 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is 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
2020-03-16 16:13:12.078 INFO 13932 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-03-16 16:13:12.101 INFO 13932 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-16 16:13:12.106 ERROR 13932 --- [ main] 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).

1个回答

数据库的url配置错误了,而且没有指定对应的driverclass对象
spring.datasource.url=jdbc:mysql://localhost:3306/spring

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐