缺少DataSource配置文件

更新时间:2023-06-14 03:10:56 阅读: 评论:0

缺少DataSource配置⽂件
由于我们做的是微服务的架构,所以在创建⼀个新的服务时,我拷贝的是之前项⽬的东西,由于少拷贝了⼀个DataSource的配置类,报了如下的错误:
09:31:18.691 [localhost-startStop-1] ERROR org.springframework.at.TomcatStarter - [log,87] - Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'rvletEndpointRegistrar' defined in class path resource
[org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMv cServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.dpoint.web.ServletEndpointRegistrar]: Factory method 'rvletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'healthEndpoint' defined in class path resource
[org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.boot.actuate.health.HealthEndpoint]: Factory method 'healthEndpoint' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB $$49aceae4]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Post-processing of FactoryBean's singleton object failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.dataSource' defined in class path resource [org/springframework/boot/autoconfigure/j
dbc/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
09:31:18.722 [main] INFO  org.StandardService - [log,180] - Stopping rvice [Tomcat]
09:31:18.738 [localhost-startStop-1] WARN  org.apache.catalina.loader.WebappClassLoaderBa - [log,180] - The web application [ROOT] appears to have started a thread named [raven-pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
urrent.locks.LockSupport.park(LockSupport.java:175)
urrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
urrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)
urrent.LinkedBlockingDeque.take(LinkedBlockingDeque.java:680)
Task(ThreadPoolExecutor.java:1067)
urrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
urrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
09:31:18.740 [localhost-startStop-1] WARN  org.apache.catalina.loader.WebappClassLoaderBa - [log,180] - The web
application [ROOT] appears to have started a thread named
[AsyncReporter{org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender@6004c0d3}] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
urrent.locks.LockSupport.parkNanos(LockSupport.java:215)
urrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
骆驼祥子感悟09:31:18.742 [localhost-startStop-1] WARN  org.apache.catalina.loader.WebappClassLoaderBa - [log,180] - The web application [ROOT] appears to have started a thread named [raven-pool-1-thread-2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
urrent.locks.LockSupport.park(LockSupport.java:175)
urrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
urrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)
urrent.LinkedBlockingDeque.take(LinkedBlockingDeque.java:680)
Task(ThreadPoolExecutor.java:1067)
urrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
urrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
09:31:18.750 [main] WARN  o.s.boot.t.AnnotationConfigServletWebServerApplicationContext - [log,87] -Exception encountered during context initialization - cancelling refresh attempt:
t.ApplicationContextException: Unable to start web rver; nested exception is
org.springframework.boot.web.rver.WebServerException: Unable to start embedded Tomcat
09:31:19.077 [AsyncReporter{org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender
@6004c0d3}] INFO
t.annotation.AnnotationConfigApplicationContext - [log,87] - Refreshing SpringClientFactory-
10.0.86.196: startup date [Wed Oct 31 09:31:19 CST 2018]; parent:
org.springframework.boot.t.AnnotationConfigServletWebServerApplicationContext@60d1b21f
09:31:19.087 [AsyncReporter{org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender@6004c0d3}] INFO
org.apache.catalina.loader.WebappClassLoaderBa - [log,182] - Illegal access: this web application instance has been stopped already. Could not load [org/springframework/cloud/consul/discovery/ConsulRibbonClientConfiguration.class]. The following stack trace is thrown for debugging purpos as well as to attempt to terminate the thread which caud the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped alrea
dy. Could not load
[org/springframework/cloud/consul/discovery/ConsulRibbonClientConfiguration.class]. The following stack trace is thrown for debugging purpos as well as to attempt to terminate the thread which caud the illegal access.
怎样编中国结
at org.apache.catalina.loader.WebappClassLoaderBa.checkStateForResourceLoading(WebappClassLoaderBa.java:1329)
at org.apache.catalina.ResourceAsStream(WebappClassLoaderBa.java:1063)
at InputStream(ClassPathResource.java:174)
at ype.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51)
at
ype.MetadataReader(SimpleMetadataReaderFactory.ja va:103)
at
ype.MetadataReader(CachingMetadataReaderFactor y.java:123)
at
ype.MetadataReader(SimpleMetadataReaderFactory.ja va:81)
at
t.ieveBeanMethodMetadata(ConfigurationClassParr.java: 400)
at
歌颂祖国的优美句子t.annotation.ConfigurationClassParr.doProcessConfigurationClass(ConfigurationClassParr.java: 318)
at
t.annotation.ConfigurationClassParr.processConfigurationClass(ConfigurationClassParr.java:24 5)
at t.annotation.ConfigurationClassParr.par(ConfigurationClassParr.java:202)
at t.annotation.ConfigurationClassParr.par(ConfigurationClassParr.java:170)
at
t.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassP ostProcessor.java:316)
at
设备锁怎么设置
t.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationCl assPostProcessor.java:233)
at
t.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostPro cessorRegistrationDelegate.java:271)
at
t.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorReg istrationDelegate.java:91)
at
t.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationCont ext.java:694)
at t.fresh(AbstractApplicationContext.java:532)
at org.t.ateContext(NamedContextFactory.java:117)
at org.t.Context(NamedContextFactory.java:85)
at org.springframework.cloudflix.Context(SpringClientFactory.java:118)
at org.t.Instance(NamedContextFactory.java:126)
at org.springframework.cloudflix.Instance(SpringClientFactory.java:108)
at org.springframework.cloudflix.LoadBalancer(SpringClientFactory.java:57)
at org.springframework.cloudflix.LoadBalancer(RibbonLoadBalancerClient.java:155)懒吧
大蒜种植方法at org.springframework.cloudflix.Server(RibbonLoadBalancerClient.java:144)
at org.springframework.cloudflix.ribbon.RibbonLoadBalancerClient.choo(RibbonLoadBalancerClient.java:76)
at
org.springframework.cloud.sleuth.zipkin2.nder.LoadBalancerClientZipkinLoadBalancer.instance(LoadBalancerClientZipkinLoadB alancer.java:42)
at
org.springframework.cloud.sleuth.zipkin2.nder.ZipkinRestTemplateSenderConfiguration$1.zipkinUrl(ZipkinRestTemplateSender Configuration.java:104)
at
org.springframework.cloud.sleuth.zipkin2.nder.ZipkinRestTemplateWrapper.doExecute(ZipkinRestTemplateSenderConfiguratio n.java:130)
at org.springframework.web.hange(RestTemplate.java:622)
at org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender.post(RestTemplateSender.java:112)
at org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender$HttpPostCall.doExecute(RestTemplateSender.java:123)
at org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender$HttpPostCall.doExecute(RestTemplateSender.java:115)
at zipkin2.ute(Call.java:379)
打竹板
porter.AsyncReporter$BoundedAsyncReporter.flush(AsyncReporter.java:286)邮件营销专家
porter.AsyncReporter$Builder$1.run(AsyncReporter.java:190)
09:31:19.094 [AsyncReporter{org.springframework.cloud.sleuth.zipkin2.nder.RestTemplateSender@6004c0d3}] WARN
t.annotation.AnnotationConfigApplicationContext - [log,87] - Exception encountered during
context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionS
toreException: Failed to par configuration class [org.sul.discovery.ConsulRibbonClientConfiguration]; nested exception is java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load
[org/springframework/cloud/consul/discovery/ConsulRibbonClientConfiguration.class]. The following stack trace is thrown for debugging purpos as well as to attempt to terminate the thread which caud the illegal access.
解决⽅法:添加DataSource配置类。

本文发布于:2023-06-14 03:10:56,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1037475.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:配置   添加   架构
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图