mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
修复nacos,etcd由于SpringAware取不到bean会报错的问题
This commit is contained in:
@@ -30,7 +30,9 @@ public class EtcdParserHelper {
|
||||
this.etcdParserVO = etcdParserVO;
|
||||
|
||||
try{
|
||||
this.etcdClient = ContextAwareHolder.loadContextAware().getBean(EtcdClient.class);
|
||||
try{
|
||||
this.etcdClient = ContextAwareHolder.loadContextAware().getBean(EtcdClient.class);
|
||||
}catch (Exception ignored){}
|
||||
if (this.etcdClient == null) {
|
||||
Client client = Client.builder()
|
||||
.endpoints(etcdParserVO.getConnectStr().split(","))
|
||||
|
||||
@@ -32,7 +32,9 @@ public class NacosParserHelper {
|
||||
public NacosParserHelper(NacosParserVO nacosParserVO) {
|
||||
this.nacosParserVO = nacosParserVO;
|
||||
try{
|
||||
this.configService = ContextAwareHolder.loadContextAware().getBean(NacosConfigService.class);
|
||||
try{
|
||||
this.configService = ContextAwareHolder.loadContextAware().getBean(NacosConfigService.class);
|
||||
}catch (Exception ignored){}
|
||||
if (this.configService == null){
|
||||
Properties properties = new Properties();
|
||||
properties.put(PropertyKeyConst.SERVER_ADDR, nacosParserVO.getServerAddr());
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -39,7 +39,7 @@
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<revision>2.9.1</revision>
|
||||
<revision>2.9.2</revision>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
|
||||
Reference in New Issue
Block a user