亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

一直報debug錯誤


Hello World!

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

2019-11-27 14:53:14.419? INFO 21648 --- [?????????? main] com.miaoshaproject.App?????????????????? : Starting App on LAPTOP-SDCT0OIQ with PID 21648 (started by 28385 in E:\新建文件夾\miaosha)
2019-11-27 14:53:14.424? INFO 21648 --- [?????????? main] com.miaoshaproject.App?????????????????? : No active profile set, falling back to default profiles: default
2019-11-27 14:53:16.826? INFO 21648 --- [?????????? main] o.s.b.w.embedded.tomcat.TomcatWebServer? : Tomcat initialized with port(s): 8080 (http)
2019-11-27 14:53:16.835? INFO 21648 --- [?????????? main] o.apache.catalina.core.StandardService?? : Starting service [Tomcat]
2019-11-27 14:53:16.835? INFO 21648 --- [?????????? main] org.apache.catalina.core.StandardEngine? : Starting Servlet engine: [Apache Tomcat/9.0.27]
2019-11-27 14:53:16.926? INFO 21648 --- [?????????? main] o.a.c.c.C.[Tomcat].[localhost].[/]?????? : Initializing Spring embedded WebApplicationContext
2019-11-27 14:53:16.926? INFO 21648 --- [?????????? main] o.s.web.context.ContextLoader??????????? : Root WebApplicationContext: initialization completed in 2399 ms
2019-11-27 14:53:17.016? WARN 21648 --- [?????????? main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'app': Unsatisfied dependency expressed through field 'userDOMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDOMapper' defined in file [E:\新建文件夾\miaosha\target\classes\com\miaoshaproject\dao\UserDOMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' 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 suitable jdbc url
2019-11-27 14:53:17.019? INFO 21648 --- [?????????? main] o.apache.catalina.core.StandardService?? : Stopping service [Tomcat]
2019-11-27 14:53:17.112? INFO 21648 --- [?????????? main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-11-27 14:53:17.115 ERROR 21648 --- [?????????? 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 suitable jdbc url


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 1


正在回答

2 回答

1.application.properties中指定?datasource.url


spring.datasource.name=miaosha
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/miaosha
spring.datasource.username=lizhch
spring.datasource.password=lizhch

2.pom中引入 mysql的驅動

<dependency>
????<groupId>mysql</groupId>
????<artifactId>mysql-connector-java</artifactId>
????<version>5.1.41</version>
</dependency>


1 回復 有任何疑惑可以回復我~

application.properties中指定 datasource.url


spring.datasource.name=miaosha

spring.datasource.username=root
spring.datasource.password=root


1 回復 有任何疑惑可以回復我~
#1

慕斯卡7159990 提問者

我就是這么寫的,還是報debug錯誤,
2019-11-27 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
SpringBoot構建電商基礎秒殺項目
  • 參與學習       49468    人
  • 解答問題       978    個

應用SpringBoot快速搭建擁有用戶、商品、交易及秒殺活動的電商秒殺應用。

進入課程

一直報debug錯誤

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號