docker-compose 部署读取不到配置${blade.datasource.dev.url}

Blade 未结 3 1779
luying777
luying777 2021-08-16 15:54
悬赏:5

一、该问题的重现步骤是什么?

1. 部署在docker 里,通过.env 文件进行配置;不管是配置 dev,test,prod 都拿不到配置;

2.  获取不到 配置,java.sql.SQLException: connect error, url ${blade.datasource.dev.url}, driverClass com.mysql.cj.jdbc.Driver

3.但是,如果不通过.env 配置 spring.profiles.active=${PROFILE} 

blade-auth1:
  image: "${REGISTER}/blade-auth:${TAG}"
  environment:
    - TZ=Asia/Shanghai
  privileged: true
  restart: always
  networks:
    blade_net:
      ipv4_address: 172.30.0.91

codker-compose.yml 这样部署的话,默认获取test,运行正常;

但如果用下面方式部署

blade-auth1:
  image: "${REGISTER}/blade-auth:${TAG}"
  environment:
    - TZ=Asia/Shanghai
  privileged: true
  restart: always
  command:
    - --spring.profiles.active=${PROFILE}
    - --spring.cloud.nacos.discovery.ip=${ADMIN_IP}
    - --spring.cloud.nacos.discovery.port=${ADMIN_PORT}
    - --spring.cloud.sentinel.transport.port=${ADMIN_SENTINEL_PORT}
    - --spring.cloud.nacos.discovery.namespace=${NACOS_NAMESPACE}
    - --spring.cloud.nacos.config.namespace=${NACOS_NAMESPACE}
    - --spring.cloud.nacos.config.group=${NACOS_GROUP}
    - --spring.cloud.nacos.config.server-addr=${NACOS_SERVER_ADDR}
    - --spring.cloud.nacos.discovery.server-addr=${NACOS_SERVER_ADDR}
    - --spring.cloud.sentinel.transport.dashboard=${SENTINEL_DASHBOARD_ADDR}
    - --sentinel.heartbeat.client.ip=${ADMIN_IP}
  networks:
    blade_net:
      ipv4_address: 172.30.0.91

PROFILE 不管是 dev,test,prod 都出以上错误,就是读取不到 nacos 的配置;

image.png

nacos 里监听不到任务记录;


二、你期待的结果是什么?实际看到的又是什么?

image.png

这个配置,应该是怎么样配置?有没有完整示例?

我想部署在docker里,profile 变量希望是 dev,test 可以切换的;


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladeX2.8.1 linux docker 

四、请提供详细的错误堆栈信息,这很重要。

----启动中,读取到的环境变量:[test],jar地址:[file:/blade/auth/app.jar]----

                   ______  _             _       ___   ___

                   | ___ \| |           | |      \  \ /  /

                   | |_/ /| |  __ _   __| |  ___  \  V  /

                   | ___ \| | / _` | / _` | / _ \   > <

                   | |_/ /| || (_| || (_| ||  __/ /  .  \

                   \____/ |_| \__,_| \__,_| \___|/__/ \__\


:: BladeX 2.8.1.RELEASE :: blade-auth:test :: Running SpringBoot 2.2.13.RELEASE ::


2021-08-16 15:38:47.283  INFO 1 --- [           main] c.a.n.c.c.impl.LocalConfigInfoProcessor  : LOCAL_SNAPSHOT_PATH:/root/nacos/config

2021-08-16 15:38:47.485  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 148 ms to scan 1 urls, producing 3 keys and 6 values

2021-08-16 15:38:47.582  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 68 ms to scan 1 urls, producing 4 keys and 9 values

2021-08-16 15:38:47.651  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 62 ms to scan 1 urls, producing 3 keys and 10 values

2021-08-16 15:38:48.205  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 546 ms to scan 266 urls, producing 0 keys and 0 values

2021-08-16 15:38:48.247  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 41 ms to scan 1 urls, producing 1 keys and 5 values

2021-08-16 15:38:48.317  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 65 ms to scan 1 urls, producing 1 keys and 7 values

2021-08-16 15:38:48.373  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 50 ms to scan 1 urls, producing 2 keys and 8 values

2021-08-16 15:38:48.932  INFO 1 --- [           main] org.reflections.Reflections              : Reflections took 554 ms to scan 266 urls, producing 0 keys and 0 values

2021-08-16 15:38:48.934  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]RpcClient init label, labels={module=config, Vipserver-Tag=null, source=sdk, Amory-Tag=null, Location-Tag=null, taskId=0, AppName=unknown}

2021-08-16 15:38:48.935  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$261/000000003454EAC0

2021-08-16 15:38:48.936  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$$Lambda$262/000000003454F390

2021-08-16 15:38:48.937  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Registry connection listener to current client:com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$1

2021-08-16 15:38:48.939  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]RpcClient init, ServerListFactory =com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient$2

2021-08-16 15:38:48.946  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8] Try to connect to server on start up, server: {serverIp='172.30.0.48', server main port=8848}

2021-08-16 15:38:50.889  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8] Success to connect to server [172.30.0.48:8848] on start up,connectionId=1629099530452_172.30.0.92_54294

2021-08-16 15:38:50.891  INFO 1 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Notify connected event to listeners.

2021-08-16 15:38:50.892  INFO 1 --- [t.remote.worker] c.a.n.client.config.impl.ClientWorker    : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8] Connected,notify listen context...

2021-08-16 15:38:50.893  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$ConnectResetRequestHandler

2021-08-16 15:38:50.894  INFO 1 --- [           main] com.alibaba.nacos.common.remote.client   : [config-0-0b3c4836-002f-4b4b-8d11-c3f7732900a8]Register server push request handler:com.alibaba.nacos.common.remote.client.RpcClient$4

2021-08-16 15:38:51.095  INFO 1 --- [           main] c.a.nacos.client.config.impl.Limiter     : limitTime:5.0

2021-08-16 15:38:51.141  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.154  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-test.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.165  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-auth] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.173  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-auth.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.190  WARN 1 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[blade-auth-test.yaml] & group[DEFAULT_GROUP]

2021-08-16 15:38:51.192  INFO 1 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-blade-auth-test.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade-auth.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade-auth,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade-test.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-blade.yaml,DEFAULT_GROUP'}]

2021-08-16 15:38:51.255  INFO 1 --- [           main] org.springblade.auth.AuthApplication     : The following profiles are active: test

2021-08-16 15:38:51.638  WARN 1 --- [           main] o.s.c.c.u.SpringFactoryImportSelector    : More than one implementation of @EnableCircuitBreaker (now relying on @Conditionals to pick one): [org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration, com.alibaba.cloud.sentinel.custom.SentinelCircuitBreakerConfiguration]

2021-08-16 15:38:58.528  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!

2021-08-16 15:38:58.536  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.

2021-08-16 15:38:58.659  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 Redis repository interfaces.

2021-08-16 15:38:58.991  WARN 1 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.

2021-08-16 15:38:59.065  WARN 1 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'hystrix.stream' contains invalid characters, please migrate to a valid format.

2021-08-16 15:38:59.507  WARN 1 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[org.springblade.auth]' package. Please check your configuration.

2021-08-16 15:39:00.137  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=1ada99cf-dbaa-33fd-b2a9-af6a2ba20b64

2021-08-16 15:39:00.149  INFO 1 --- [           main] s.c.l.p.BladePropertySourcePostProcessor : BladePropertySourcePostProcessor init.

2021-08-16 15:39:00.149  INFO 1 --- [           main] s.c.l.p.BladePropertySourcePostProcessor : BladePropertySourcePostProcessor process @BladePropertySource bean.

2021-08-16 15:39:01.812  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.sentinel-com.alibaba.cloud.sentinel.SentinelProperties' of type [com.alibaba.cloud.sentinel.SentinelProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2021-08-16 15:39:02.049  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration' of type [com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

2021-08-16 15:39:02.594  WARN 1 --- [           main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used

2021-08-16 15:39:02.628  INFO 1 --- [           main] io.undertow.servlet                      : Initializing Spring embedded WebApplicationContext

2021-08-16 15:39:02.629  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 11224 ms

2021-08-16 15:39:03.014  WARN 1 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.

2021-08-16 15:39:03.014  INFO 1 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

2021-08-16 15:39:03.052  INFO 1 --- [           main] c.netflix.config.DynamicPropertyFactory  : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@e275730f

2021-08-16 15:39:04.264  INFO 1 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource

2021-08-16 15:39:05.012 ERROR 1 --- [           main] com.alibaba.druid.pool.DruidDataSource   : init datasource error, url: ${blade.datasource.test.url}


java.sql.SQLException: connect error, url ${blade.datasource.test.url}, driverClass com.mysql.cj.jdbc.Driver

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1722) ~[druid-1.2.5.jar!/:1.2.5]

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:915) ~[druid-1.2.5.jar!/:1.2.5]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1920) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1862) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1525) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1489) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1378) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1265) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:409) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50) [blade-core-launch-2.8.1.RELEASE.jar!/:na]

at org.springblade.auth.AuthApplication.main(AuthApplication.java:35) [classes!/:na]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [app.jar:na]

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [app.jar:na]


2021-08-16 15:39:05.033 ERROR 1 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} init error


java.sql.SQLException: connect error, url ${blade.datasource.test.url}, driverClass com.mysql.cj.jdbc.Driver

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1722) ~[druid-1.2.5.jar!/:1.2.5]

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:915) ~[druid-1.2.5.jar!/:1.2.5]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1920) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1862) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1525) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1489) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1378) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1265) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:409) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1356) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1203) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$136/00000000347B2560.getObject(Unknown Source) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) [spring-beans-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.2.13.RELEASE.jar!/:2.2.13.RELEASE]

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50) [blade-core-launch-2.8.1.RELEASE.jar!/:na]

at org.springblade.auth.AuthApplication.main(AuthApplication.java:35) [classes!/:na]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_262]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_262]

at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_262]

at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [app.jar:na]

at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) [app.jar:na]

at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) [app.jar:na]


2021-08-16 15:39:05.034  INFO 1 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited

2021-08-16 15:39:05.035 ERROR 1 --- [eate--274000221] com.alibaba.druid.pool.DruidDataSource   : create connection SQLException, url: ${blade.datasource.test.url}, errorCode 0, state null


java.sql.SQLException: connect error, url ${blade.datasource.test.url}, driverClass com.mysql.cj.jdbc.Driver

at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1722) ~[druid-1.2.5.jar!/:1.2.5]

at com.alibaba.druid.pool.Dr




3条回答
  •  zdd
    zdd (楼主)
    2023-01-10 16:30

    同问,此处

    pointcloud-message1:

    image: "${REGISTER}/blade-message:${TAG}"

    container_name: "pointcloud-message1"

    environment:

    - TZ=Asia/Shanghai

    volumes:

    - ${POINTCLOUD_BASE_PATH}/back/wait-for:/wait-for

    entrypoint: "sh /wait-for pointcloud-nacos-server:8848 -- java -Djava.security.egd=file:/dev/./urandom -jar /blade/message/app.jar"

    privileged: true

    restart: always

    logging:

    driver: "json-file"

    options:

    max-size: "200m"

    max-file: "3"

    command:

    - --spring.profiles.active=${PROFILE}

    - --spring.cloud.nacos.config.server-addr=172.30.0.48:8848

    - --spring.cloud.nacos.discovery.server-addr=172.30.0.48:8848

    - --spring.cloud.nacos.discovery.namespace=public1

    - --spring.cloud.nacos.config.namespace=public1

    - --spring.cloud.nacos.config.group=ZDD_GROUP

    networks:

    pointcloud_back:

    ipv4_address: 172.30.0.108

    就错误

    pointcloud-message1:

    image: "${REGISTER}/blade-message:${TAG}"

    container_name: "pointcloud-message1"

    environment:

    - TZ=Asia/Shanghai

    volumes:

    - ${POINTCLOUD_BASE_PATH}/back/wait-for:/wait-for

    entrypoint: "sh /wait-for pointcloud-nacos-server:8848 -- java -Djava.security.egd=file:/dev/./urandom -jar /blade/message/app.jar"

    privileged: true

    restart: always

    logging:

    driver: "json-file"

    options:

    max-size: "200m"

    max-file: "3"

    command:

    - --spring.profiles.active=${PROFILE}

    - --spring.cloud.nacos.config.server-addr=172.30.0.48:8848

    - --spring.cloud.nacos.discovery.server-addr=172.30.0.48:8848

    networks:

    pointcloud_back:

    ipv4_address: 172.30.0.108

    这样配置就可以;

    但是我的需求是想根据namespace 区别我的服务获取nacos中的配置信息

提交回复