请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Config-server可以获取配置文件, 使用bootstrap.yml启动Order-service 失败

启动错误日志

2019-04-01 23:14:46.400  INFO 11748 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$9797c5ba] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-04-01 23:14:46.728  INFO 11748 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-04-01 23:14:46.728  INFO 11748 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-04-01 23:14:46.728  INFO 11748 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.16
2019-04-01 23:14:47.009  INFO 11748 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-04-01 23:14:47.009  INFO 11748 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2304 ms
2019-04-01 23:14:47.306  INFO 11748 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2019-04-01 23:14:47.321  INFO 11748 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-04-01 23:14:47.321  INFO 11748 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-04-01 23:14:47.321  INFO 11748 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-04-01 23:14:47.321  INFO 11748 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2019-04-01 23:14:47.384  WARN 11748 --- [           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.HibernateJpaAutoConfiguration': 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: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
2019-04-01 23:14:47.400  INFO 11748 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-04-01 23:14:47.431  WARN 11748 --- [           main] o.s.b.c.e.EventPublishingRunListener     : Error calling ApplicationEventListener

java.lang.ClassCastException: org.springframework.boot.context.event.ApplicationFailedEvent cannot be cast to org.springframework.boot.web.context.WebServerInitializedEvent
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:159) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) [spring-context-5.0.0.RC3.jar:5.0.0.RC3]
	at org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:114) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:803) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M3.jar:2.0.0.M3]
	at com.david.order.OrderApplication.main(OrderApplication.java:18) [classes/:na]

2019-04-01 23:14:47.462  INFO 11748 --- [           main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2019-04-01 23:14:47.462 ERROR 11748 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Cannot determine embedded database driver class for database type NONE

正在回答 回答被采纳积分+3

1回答

廖师兄 2019-04-02 23:52:41
Cannot determine embedded database driver class for database type NONE

没获取到数据库配置

0 回复 有任何疑惑可以回复我~
  • 提问者 Scoundrel浩 #1
    嗯,这个我知道,是从默认地址本地8888拿到的,但是不知道为什么没有从配置中心获取
    回复 有任何疑惑可以回复我~ 2019-04-02 23:56:16
  • 廖师兄 回复 提问者 Scoundrel浩 #2
    从日志里没看出从8888获取。springcloud里,默认的config-server地址是localhost:8888,先去eureka上找,找不到就是默认的。eureka上有名为“CONFIG-SERVER”的服务吗?我看你的名字是config
    回复 有任何疑惑可以回复我~ 2019-04-03 11:41:10
  • 提问者 Scoundrel浩 回复 廖师兄 #3
    谢谢师兄,上午的时候看了下官方文档的配置。发现client端有个配置错位了,enabled应该是和service-id同级的。等下班回去试下
    回复 有任何疑惑可以回复我~ 2019-04-03 11:47:50
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信