springboot,dubbo,nacos,spring-cloud-alibaba的整合
最近,自去年阿里开源了dubbo2.7及一系列产品后,阿里也打造了融入spring-cloud 的生态体系,本人关注,今年阿里开源的的spring-cloud-alibaba基本孵化完成,笔者更是对这一系统的东西关注有加,原spring-cloud 的netflix逐步不再维护,而阿里这套系统日益活跃,未来趋势很可能spring-cloud-alibaba更为流行。
因为前期公司一直采用的是dubbo的调用模式,所以为了兼容以前的东西,笔者想要整合并逐步引入spring-cloud-alibaba的东西,为此搞个demo。记录一下
工程目录结构:
pom是父类工程,进行版本管理
pom文件:
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.1.6.RELEASE</version>
- <relativePath/> <!-- lookup parent from repository -->
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>pom</name>
- <description>Demo project for Spring Boot</description>
- <packaging>pom</packaging>
- <properties>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-dependencies</artifactId>
- <version>Greenwich.SR2</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-alibaba-dependencies</artifactId>
- <version>0.9.0.RELEASE</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>
在这里人添加一些东西,父类中第二次整合spring-cloud-dependencies和spring-cloud-alibaba-dependencies,以及整合成功的验证这次整合是在不同环境下进行,因为网络太慢,采用的是aliyun镜像仓库
需要注意的是,现有cloud然后有cloud-alibaba,两个保持scope和type一致
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.1.6.RELEASE</version>
- <relativePath/> <!-- lookup parent from repository -->
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>pom</name>
- <packaging>pom</packaging>
- <description>Demo project for Spring Boot</description>
- <properties>
- <pom.version>2.1.6.RELEASE</pom.version>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- </dependencies>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-dependencies</artifactId>
- <version>Greenwich.SR2</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-alibaba-dependencies</artifactId>
- <version>0.9.0.RELEASE</version>
- <scope>import</scope>
- <type>pom</type>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <!-- <repositories>
- <repository>
- <id>spring-milestones</id>
- <name>Spring Milestones</name>
- <url>https://repo.spring.io/milestone</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>-->
- </project>
验证pom的终端,mvn clean进行验证如下表示成功
- Microsoft Windows [版本 10.0.17134.915]
- (c) 2018 Microsoft Corporation。保留所有权利。
- D:\drawnblue\springcloud-alibaba\pom>mvn clean
- [INFO] Scanning for projects...
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies/Greenwich.SR2/spring-cloud-dependencies-Greenwich.SR2.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies/Greenwich.SR2/spring-cloud-dependencies-Greenwich.SR2.pom (9 KB at 7.6 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.6.RELEASE/spring-cloud-dependencies-parent-2.1.6.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.6.RELEASE/spring-cloud-dependencies-parent-2.1.6.RELEASE.pom (8 KB at 17.7 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-commons-dependencies/2.1.2.RELEASE/spring-cloud-commons-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-commons-dependencies/2.1.2.RELEASE/spring-cloud-commons-dependencies-2.1.2.RELEASE.pom (4 KB at 9.6 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.5.RELEASE/spring-cloud-dependencies-parent-2.1.5.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.5.RELEASE/spring-cloud-dependencies-parent-2.1.5.RELEASE.pom (8 KB at 19.6 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-netflix-dependencies/2.1.2.RELEASE/spring-cloud-netflix-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-netflix-dependencies/2.1.2.RELEASE/spring-cloud-netflix-dependencies-2.1.2.RELEASE.pom (16 KB at 41.7 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-stream-dependencies/Fishtown.SR3/spring-cloud-stream-dependencies-Fishtown.SR3.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-stream-dependencies/Fishtown.SR3/spring-cloud-stream-dependencies-Fishtown.SR3.pom (6 KB at 14.7 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.4.RELEASE/spring-cloud-dependencies-parent-2.1.4.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.4.RELEASE/spring-cloud-dependencies-parent-2.1.4.RELEASE.pom (8 KB at 19.1 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-task-dependencies/2.1.2.RELEASE/spring-cloud-task-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-task-dependencies/2.1.2.RELEASE/spring-cloud-task-dependencies-2.1.2.RELEASE.pom (3 KB at 7.5 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-config-dependencies/2.1.3.RELEASE/spring-cloud-config-dependencies-2.1.3.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-config-dependencies/2.1.3.RELEASE/spring-cloud-config-dependencies-2.1.3.RELEASE.pom (4 KB at 10.6 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-function-dependencies/2.0.2.RELEASE/spring-cloud-function-dependencies-2.0.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-function-dependencies/2.0.2.RELEASE/spring-cloud-function-dependencies-2.0.2.RELEASE.pom (5 KB at 12.0 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-gateway-dependencies/2.1.2.RELEASE/spring-cloud-gateway-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-gateway-dependencies/2.1.2.RELEASE/spring-cloud-gateway-dependencies-2.1.2.RELEASE.pom (3 KB at 8.1 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-consul-dependencies/2.1.2.RELEASE/spring-cloud-consul-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-consul-dependencies/2.1.2.RELEASE/spring-cloud-consul-dependencies-2.1.2.RELEASE.pom (5 KB at 11.2 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-sleuth-dependencies/2.1.2.RELEASE/spring-cloud-sleuth-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-sleuth-dependencies/2.1.2.RELEASE/spring-cloud-sleuth-dependencies-2.1.2.RELEASE.pom (5 KB at 10.2 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-vault-dependencies/2.1.2.RELEASE/spring-cloud-vault-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-vault-dependencies/2.1.2.RELEASE/spring-cloud-vault-dependencies-2.1.2.RELEASE.pom (4 KB at 10.3 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-zookeeper-dependencies/2.1.2.RELEASE/spring-cloud-zookeeper-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-zookeeper-dependencies/2.1.2.RELEASE/spring-cloud-zookeeper-dependencies-2.1.2.RELEASE.pom (6 KB at 14.5 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-security-dependencies/2.1.3.RELEASE/spring-cloud-security-dependencies-2.1.3.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-security-dependencies/2.1.3.RELEASE/spring-cloud-security-dependencies-2.1.3.RELEASE.pom (4 KB at 7.3 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-cloudfoundry-dependencies/2.1.2.RELEASE/spring-cloud-cloudfoundry-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-cloudfoundry-dependencies/2.1.2.RELEASE/spring-cloud-cloudfoundry-dependencies-2.1.2.RELEASE.pom (4 KB at 8.3 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-bus-dependencies/2.1.2.RELEASE/spring-cloud-bus-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-bus-dependencies/2.1.2.RELEASE/spring-cloud-bus-dependencies-2.1.2.RELEASE.pom (3 KB at 7.5 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-contract-dependencies/2.1.2.RELEASE/spring-cloud-contract-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-contract-dependencies/2.1.2.RELEASE/spring-cloud-contract-dependencies-2.1.2.RELEASE.pom (7 KB at 17.6 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-aws-dependencies/2.1.2.RELEASE/spring-cloud-aws-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-aws-dependencies/2.1.2.RELEASE/spring-cloud-aws-dependencies-2.1.2.RELEASE.pom (7 KB at 17.9 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/amazonaws/aws-java-sdk-bom/1.11.415/aws-java-sdk-bom-1.11.415.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/amazonaws/aws-java-sdk-bom/1.11.415/aws-java-sdk-bom-1.11.415.pom (31 KB at 73.4 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/amazonaws/aws-java-sdk-pom/1.11.415/aws-java-sdk-pom-1.11.415.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/amazonaws/aws-java-sdk-pom/1.11.415/aws-java-sdk-pom-1.11.415.pom (14 KB at 36.0 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-openfeign-dependencies/2.1.2.RELEASE/spring-cloud-openfeign-dependencies-2.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-openfeign-dependencies/2.1.2.RELEASE/spring-cloud-openfeign-dependencies-2.1.2.RELEASE.pom (5 KB at 13.5 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-kubernetes-dependencies/1.0.2.RELEASE/spring-cloud-kubernetes-dependencies-1.0.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-kubernetes-dependencies/1.0.2.RELEASE/spring-cloud-kubernetes-dependencies-1.0.2.RELEASE.pom (8 KB at 19.1 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/io/fabric8/kubernetes-client-bom/4.1.0/kubernetes-client-bom-4.1.0.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/io/fabric8/kubernetes-client-bom/4.1.0/kubernetes-client-bom-4.1.0.pom (4 KB at 10.2 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-gcp-dependencies/1.1.2.RELEASE/spring-cloud-gcp-dependencies-1.1.2.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-gcp-dependencies/1.1.2.RELEASE/spring-cloud-gcp-dependencies-1.1.2.RELEASE.pom (8 KB at 20.8 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/cloud/google-cloud-bom/0.96.0-alpha/google-cloud-bom-0.96.0-alpha.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/cloud/google-cloud-bom/0.96.0-alpha/google-cloud-bom-0.96.0-alpha.pom (55 KB at 126.0 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/api/gax-bom/1.45.0/gax-bom-1.45.0.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/api/gax-bom/1.45.0/gax-bom-1.45.0.pom (3 KB at 7.0 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-alibaba-dependencies/0.9.0.RELEASE/spring-cloud-alibaba-dependencies-0.9.0.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-alibaba-dependencies/0.9.0.RELEASE/spring-cloud-alibaba-dependencies-0.9.0.RELEASE.pom (19 KB at 47.8 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.3.RELEASE/spring-cloud-dependencies-parent-2.1.3.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/cloud/spring-cloud-dependencies-parent/2.1.3.RELEASE/spring-cloud-dependencies-parent-2.1.3.RELEASE.pom (7 KB at 17.4 KB/sec)
- [INFO]
- [INFO] ------------------------------------------------------------------------
- [INFO] Building pom 0.0.1-SNAPSHOT
- [INFO] ------------------------------------------------------------------------
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-maven-plugin/2.1.6.RELEASE/spring-boot-maven-plugin-2.1.6.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-maven-plugin/2.1.6.RELEASE/spring-boot-maven-plugin-2.1.6.RELEASE.pom (5 KB at 12.8 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-tools/2.1.6.RELEASE/spring-boot-tools-2.1.6.RELEASE.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-tools/2.1.6.RELEASE/spring-boot-tools-2.1.6.RELEASE.pom (2 KB at 4.9 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-maven-plugin/2.1.6.RELEASE/spring-boot-maven-plugin-2.1.6.RELEASE.jar
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-maven-plugin/2.1.6.RELEASE/spring-boot-maven-plugin-2.1.6.RELEASE.jar (67 KB at 147.8 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/3.1.0/maven-clean-plugin-3.1.0.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/3.1.0/maven-clean-plugin-3.1.0.pom (6 KB at 14.3 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/3.1.0/maven-clean-plugin-3.1.0.jar
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/3.1.0/maven-clean-plugin-3.1.0.jar (30 KB at 83.4 KB/sec)
- [INFO]
- [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ pom ---
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.pom
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.pom (6 KB at 14.6 KB/sec)
- Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar
- Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar (163 KB at 296.3 KB/sec)
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD SUCCESS
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: 19.488 s
- [INFO] Finished at: 2019-08-03T10:33:29+08:00
- [INFO] Final Memory: 15M/123M
- [INFO] ------------------------------------------------------------------------
- D:\drawnblue\springcloud-alibaba\pom>^A
common,dao都是一般的不可执行项目,作为依赖
common pom
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>common</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>common</name>
- <description>Demo project for Spring Boot</description>
- <properties>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>
dao pom
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>dao</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>dao</name>
- <description>Demo project for Spring Boot</description>
- <properties>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>common</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>
user-service-api pom
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>user-service-api</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>user-service-api</name>
- <description>Demo project for Spring Boot</description>
- <properties>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>common</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>
user-service pom
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>user-service</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>user-service</name>
- <description>Demo project for Spring Boot</description>
- <properties>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <!--local project-->
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>common</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>dao</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>user-service-api</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <!--spingboot-->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <!--datasource config-->
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>druid</artifactId>
- <version>1.1.18</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>5.1.8.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.mybatis.spring.boot</groupId>
- <artifactId>mybatis-spring-boot-starter</artifactId>
- <version>1.3.2</version>
- </dependency>
- <!--nacos config-->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
- <version>0.9.0.RELEASE</version>
- </dependency>
- <!-- <dependency>
- <groupId>com.alibaba.boot</groupId>
- <artifactId>nacos-config-spring-boot-actuator</artifactId>
- <version>0.2.2</version>
- </dependency>-->
- <!--以下配置dubbo############################################################################## -->
- <!--dubbo config-->
- <dependency>
- <groupId>com.alibaba.boot</groupId>
- <artifactId>dubbo-spring-boot-starter</artifactId>
- <version>0.2.0</version>
- <exclusions>
- <exclusion>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <version>0.0.1</version>
- </dependency>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- <version>2.6.5</version>
- </dependency>
- <!-- <dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>0.6.2</version>
- </dependency>-->
- <dependency>
- <groupId>com.alibaba.spring</groupId>
- <artifactId>spring-context-support</artifactId>
- <version>1.0.2</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>
user-service是重点,尽管连接了数据库,但是并没有写任何的dao和common,只是做个注册的小demo,该工程结构如下:
application.yml
- spring:
- application:
- name: user-server
- ####################datasource and pool configuration start
- datasource:
- driver-class-name: com.mysql.cj.jdbc.Driver
- username: root
- password: 123456
- url: jdbc:mysql://192.168.xxx.xxx:3306/kanxxxxxxxxxxin?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
- type: com.alibaba.druid.pool.DruidDataSource
- # 下面为连接池的补充设置,应用到上面所有数据源中
- # 初始化大小,最小,最大
- initial-size: 5
- min-idle: 5
- max-active: 20
- # 配置获取连接等待超时的时间
- max-wait: 60000
- # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
- time-between-eviction-runs-millis: 60000
- # 配置一个连接在池中最小生存的时间,单位是毫秒
- min-evictable-idle-time-millis: 300000
- validation-query: SELECT 1 FROM DUAL
- test-while-idle: true
- test-on-borrow: false
- test-on-return: false
- # 打开PSCache,并且指定每个连接上PSCache的大小
- pool-prepared-statements: true
- # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
- max-pool-prepared-statement-per-connection-size: 20
- filters: stat,wall
- use-global-data-source-stat: true
- # 通过connectProperties属性来打开mergeSql功能;慢SQL记录
- connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
- ######## nacous configuation
- cloud:
- nacos:
- discovery:
- server-addr: 127.0.0.1:8848
- server:
- port: 7998
- ## mybatis config
- mybatis:
- mapper-locations: classpath:mybatis/*Mapper.xml
- type-aliases-package: com.drawnblue.entity
- #######################################################以下配置dubbo###########################################################
- #dubbo:
- # application:
- # name: test
- # qos-enable: false
- # qos-port: 33333
- # qos-accept-foreign-ip: false
- # scan:
- # base-packages: com.drawnblue.userservice.impl
- # protocol:
- # name: dubbo
- # port: -1
- # registry:
- # address: nacos://127.0.0.1:8848
外部属性文件
- dubbo.application.name = dubbo-provider-demo
- dubbo.registry.address = nacos://127.0.0.1:8848
- dubbo.protocol.name = dubbo
- dubbo.protocol.port = -1
- demo.service.version = 1.0.0
- demo.service.name = demoService
将springboot启动类改为服务提供方的引导类
- package com.drawnblue.userservice.impl;
- import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
- import org.springframework.context.annotation.AnnotationConfigApplicationContext;
- import org.springframework.context.annotation.PropertySource;
- import java.io.IOException;
- @EnableDubbo(scanBasePackages = "com.drawnblue.userservice.impl")
- @PropertySource(value = "classpath:/provider-config.properties")
- public class UserServiceApplication {
- public static void main(String[] args) throws IOException {
- AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
- context.register(UserServiceApplication.class);
- context.refresh();
- System.out.println("DemoService provider is starting...");
- System.in.read();
- }
- }
我们在服务提供房的接口中也采用官方示例中的方法例子,nacosTestServieImpl类(service类省略)
- package com.drawnblue.userservice.impl;
- import com.alibaba.dubbo.config.annotation.Service;
- import com.alibaba.dubbo.rpc.RpcContext;
- import com.drawnblue.userservice.NacosTestService;
- import org.springframework.beans.factory.annotation.Value;
- @Service(version = "${demo.service.version}",interfaceClass = NacosTestService.class)
- public class NacosTestServiceImpl implements NacosTestService {
- @Value("${demo.service.name}")
- private String serviceName;
- @Override
- public String sayName(String name) {
- RpcContext rpcContext = RpcContext.getContext();
- return String.format("Service [name :%s , port : %d] %s(\"%s\") : Hello,%s",
- serviceName,
- rpcContext.getLocalPort(),
- rpcContext.getMethodName(),
- name,
- name);
- }
- }
需要注意的是该注解的service采用的是dubbo的注解,不要搞错了
一切写完后,我们就可以启动服务了,启动成功可以看到控制台如下:
- D:\topbandSoft\java\jdk1.8\bin\java.exe "-javaagent:D:\IDEA\IntelliJ IDEA 2018.2.4\lib\idea_rt.jar=63778:D:\IDEA\IntelliJ IDEA 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath D:\topbandSoft\java\jdk1.8\jre\lib\charsets.jar;D:\topbandSoft\java\jdk1.8\jre\lib\deploy.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\cldrdata.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\dnsns.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\jaccess.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\jfxrt.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\localedata.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\nashorn.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunec.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\zipfs.jar;D:\topbandSoft\java\jdk1.8\jre\lib\javaws.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jce.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jfr.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jfxswt.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jsse.jar;D:\topbandSoft\java\jdk1.8\jre\lib\management-agent.jar;D:\topbandSoft\java\jdk1.8\jre\lib\plugin.jar;D:\topbandSoft\java\jdk1.8\jre\lib\resources.jar;D:\topbandSoft\java\jdk1.8\jre\lib\rt.jar;G:\drawnblue\springcloud-alibaba\user-service\target\classes;G:\drawnblue\springcloud-alibaba\common\target\classes;G:\drawnblue\springcloud-alibaba\dao\target\classes;G:\drawnblue\springcloud-alibaba\user-service-api\target\classes;G:\sharp\repo\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;G:\sharp\repo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;G:\sharp\repo\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;G:\sharp\repo\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;G:\sharp\repo\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;G:\sharp\repo\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;G:\sharp\repo\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;G:\sharp\repo\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;G:\sharp\repo\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;G:\sharp\repo\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;G:\sharp\repo\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;G:\sharp\repo\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;G:\sharp\repo\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;G:\sharp\repo\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;G:\sharp\repo\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;G:\sharp\repo\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;G:\sharp\repo\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;G:\sharp\repo\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;G:\sharp\repo\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;G:\sharp\repo\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-actuator\2.1.6.RELEASE\spring-boot-starter-actuator-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-actuator-autoconfigure\2.1.6.RELEASE\spring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-actuator\2.1.6.RELEASE\spring-boot-actuator-2.1.6.RELEASE.jar;G:\sharp\repo\io\micrometer\micrometer-core\1.1.5\micrometer-core-1.1.5.jar;G:\sharp\repo\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;G:\sharp\repo\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;G:\sharp\repo\com\alibaba\druid\1.1.18\druid-1.1.18.jar;G:\sharp\repo\org\springframework\spring-jdbc\5.1.8.RELEASE\spring-jdbc-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-tx\5.1.8.RELEASE\spring-tx-5.1.8.RELEASE.jar;G:\sharp\repo\mysql\mysql-connector-java\8.0.16\mysql-connector-java-8.0.16.jar;G:\sharp\repo\org\mybatis\spring\boot\mybatis-spring-boot-starter\1.3.2\mybatis-spring-boot-starter-1.3.2.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-jdbc\2.1.6.RELEASE\spring-boot-starter-jdbc-2.1.6.RELEASE.jar;G:\sharp\repo\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;G:\sharp\repo\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\1.3.2\mybatis-spring-boot-autoconfigure-1.3.2.jar;G:\sharp\repo\org\mybatis\mybatis\3.4.6\mybatis-3.4.6.jar;G:\sharp\repo\org\mybatis\mybatis-spring\1.3.2\mybatis-spring-1.3.2.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter-alibaba-nacos-discovery\0.9.0.RELEASE\spring-cloud-starter-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-alibaba-nacos-discovery\0.9.0.RELEASE\spring-cloud-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-commons\2.1.1.RELEASE\spring-cloud-commons-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\security\spring-security-crypto\5.1.5.RELEASE\spring-security-crypto-5.1.5.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-context\2.1.1.RELEASE\spring-cloud-context-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter-netflix-ribbon\2.1.1.RELEASE\spring-cloud-starter-netflix-ribbon-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter\2.1.1.RELEASE\spring-cloud-starter-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\security\spring-security-rsa\1.0.7.RELEASE\spring-security-rsa-1.0.7.RELEASE.jar;G:\sharp\repo\org\bouncycastle\bcpkix-jdk15on\1.60\bcpkix-jdk15on-1.60.jar;G:\sharp\repo\org\bouncycastle\bcprov-jdk15on\1.60\bcprov-jdk15on-1.60.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-netflix-ribbon\2.1.1.RELEASE\spring-cloud-netflix-ribbon-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-netflix-archaius\2.1.1.RELEASE\spring-cloud-netflix-archaius-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter-netflix-archaius\2.1.1.RELEASE\spring-cloud-starter-netflix-archaius-2.1.1.RELEASE.jar;G:\sharp\repo\com\netflix\archaius\archaius-core\0.7.6\archaius-core-0.7.6.jar;G:\sharp\repo\com\google\code\findbugs\jsr305\3.0.1\jsr305-3.0.1.jar;G:\sharp\repo\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;G:\sharp\repo\com\netflix\ribbon\ribbon\2.3.0\ribbon-2.3.0.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-transport\2.3.0\ribbon-transport-2.3.0.jar;G:\sharp\repo\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;G:\sharp\repo\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;G:\sharp\repo\com\netflix\hystrix\hystrix-core\1.4.3\hystrix-core-1.4.3.jar;G:\sharp\repo\javax\inject\javax.inject\1\javax.inject-1.jar;G:\sharp\repo\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-core\2.3.0\ribbon-core-2.3.0.jar;G:\sharp\repo\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-httpclient\2.3.0\ribbon-httpclient-2.3.0.jar;G:\sharp\repo\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;G:\sharp\repo\org\apache\httpcomponents\httpclient\4.5.9\httpclient-4.5.9.jar;G:\sharp\repo\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;G:\sharp\repo\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;G:\sharp\repo\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;G:\sharp\repo\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;G:\sharp\repo\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;G:\sharp\repo\com\netflix\servo\servo-core\0.10.1\servo-core-0.10.1.jar;G:\sharp\repo\com\netflix\servo\servo-internal\0.10.1\servo-internal-0.10.1.jar;G:\sharp\repo\com\netflix\netflix-commons\netflix-commons-util\0.1.1\netflix-commons-util-0.1.1.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-loadbalancer\2.3.0\ribbon-loadbalancer-2.3.0.jar;G:\sharp\repo\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;G:\sharp\repo\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;G:\sharp\repo\com\alibaba\boot\dubbo-spring-boot-starter\0.2.0\dubbo-spring-boot-starter-0.2.0.jar;G:\sharp\repo\org\apache\zookeeper\zookeeper\3.4.9\zookeeper-3.4.9.jar;G:\sharp\repo\jline\jline\0.9.94\jline-0.9.94.jar;G:\sharp\repo\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;G:\sharp\repo\org\apache\curator\curator-framework\2.12.0\curator-framework-2.12.0.jar;G:\sharp\repo\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar;G:\sharp\repo\com\alibaba\boot\dubbo-spring-boot-autoconfigure\0.2.0\dubbo-spring-boot-autoconfigure-0.2.0.jar;G:\sharp\repo\com\alibaba\dubbo-registry-nacos\0.0.1\dubbo-registry-nacos-0.0.1.jar;G:\sharp\repo\com\alibaba\nacos\nacos-client\0.6.0\nacos-client-0.6.0.jar;G:\sharp\repo\com\alibaba\nacos\nacos-common\0.6.0\nacos-common-0.6.0.jar;G:\sharp\repo\commons-io\commons-io\2.2\commons-io-2.2.jar;G:\sharp\repo\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;G:\sharp\repo\com\alibaba\nacos\nacos-api\0.6.0\nacos-api-0.6.0.jar;G:\sharp\repo\com\alibaba\fastjson\1.2.47\fastjson-1.2.47.jar;G:\sharp\repo\com\google\guava\guava\19.0\guava-19.0.jar;G:\sharp\repo\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;G:\sharp\repo\org\codehaus\jackson\jackson-mapper-lgpl\1.9.6\jackson-mapper-lgpl-1.9.6.jar;G:\sharp\repo\org\codehaus\jackson\jackson-core-lgpl\1.9.6\jackson-core-lgpl-1.9.6.jar;G:\sharp\repo\com\alibaba\dubbo\2.6.5\dubbo-2.6.5.jar;G:\sharp\repo\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;G:\sharp\repo\org\javassist\javassist\3.20.0-GA\javassist-3.20.0-GA.jar;G:\sharp\repo\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar;G:\sharp\repo\com\alibaba\spring\spring-context-support\1.0.2\spring-context-support-1.0.2.jar com.drawnblue.userservice.impl.UserServiceApplication
- 17:54:26.120 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@d70c109
- 17:54:26.138 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
- 17:54:26.221 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The dubbo config bean definition [name : com.alibaba.dubbo.config.ApplicationConfig#0, class : com.alibaba.dubbo.config.ApplicationConfig] has been registered.
- 17:54:26.223 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : com.alibaba.dubbo.config.ApplicationConfig#0] has been registered.
- 17:54:26.223 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.ModuleConfig] within prefix [dubbo.module]
- 17:54:26.223 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The dubbo config bean definition [name : com.alibaba.dubbo.config.RegistryConfig#0, class : com.alibaba.dubbo.config.RegistryConfig] has been registered.
- 17:54:26.223 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : com.alibaba.dubbo.config.RegistryConfig#0] has been registered.
- 17:54:26.223 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The dubbo config bean definition [name : com.alibaba.dubbo.config.ProtocolConfig#0, class : com.alibaba.dubbo.config.ProtocolConfig] has been registered.
- 17:54:26.223 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : com.alibaba.dubbo.config.ProtocolConfig#0] has been registered.
- 17:54:26.224 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.MonitorConfig] within prefix [dubbo.monitor]
- 17:54:26.224 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.ProviderConfig] within prefix [dubbo.provider]
- 17:54:26.224 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.ConsumerConfig] within prefix [dubbo.consumer]
- 17:54:26.249 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor#0'
- 17:54:26.281 [main] INFO com.alibaba.dubbo.common.logger.LoggerFactory - using logger: com.alibaba.dubbo.common.logger.slf4j.Slf4jLoggerAdapter
- 17:54:26.292 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] BeanNameGenerator bean can't be found in BeanFactory with name [org.springframework.context.annotation.internalConfigurationBeanNameGenerator], dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.292 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] BeanNameGenerator will be a instance of org.springframework.context.annotation.AnnotationBeanNameGenerator , it maybe a potential problem on bean name generation., dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.306 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboClassPathBeanDefinitionScanner - Identified candidate component class: file [G:\drawnblue\springcloud-alibaba\user-service\target\classes\com\drawnblue\userservice\impl\NacosTestServiceImpl.class]
- 17:54:26.309 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboClassPathBeanDefinitionScanner - Identified candidate component class: file [G:\drawnblue\springcloud-alibaba\user-service\target\classes\com\drawnblue\userservice\impl\NacosTestServiceImpl.class]
- 17:54:26.317 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.version' in PropertySource 'class path resource [provider-config.properties]' with value of type String
- 17:54:26.319 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.version' in PropertySource 'class path resource [provider-config.properties]' with value of type String
- 17:54:26.319 [main] WARN com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] The BeanDefinition[Root bean: class [com.alibaba.dubbo.config.spring.ServiceBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] of ServiceBean has been registered with name : ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.319 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] 1 annotated Dubbo's @Service Components { [Bean definition with name 'nacosTestServiceImpl': Generic bean: class [com.drawnblue.userservice.impl.NacosTestServiceImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [G:\drawnblue\springcloud-alibaba\user-service\target\classes\com\drawnblue\userservice\impl\NacosTestServiceImpl.class]] } were scanned under package[com.drawnblue.userservice.impl], dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.321 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
- 17:54:26.323 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
- 17:54:26.325 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
- 17:54:26.326 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
- 17:54:26.332 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'referenceAnnotationBeanPostProcessor'
- 17:54:26.338 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor#0'
- 17:54:26.391 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
- 17:54:26.392 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor#1'
- 17:54:26.393 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
- 17:54:26.393 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor#2'
- 17:54:26.396 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
- 17:54:26.402 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userServiceApplication'
- 17:54:26.403 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.context.annotation.DubboConfigConfiguration$Single'
- 17:54:26.405 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.ApplicationConfig#0'
- 17:54:26.482 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - The properties of bean [name : com.alibaba.dubbo.config.ApplicationConfig#0] have been binding by prefix of configuration properties : dubbo.application
- 17:54:26.482 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.RegistryConfig#0'
- 17:54:26.487 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - The properties of bean [name : com.alibaba.dubbo.config.RegistryConfig#0] have been binding by prefix of configuration properties : dubbo.registry
- 17:54:26.487 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.ProtocolConfig#0'
- 17:54:26.496 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - The properties of bean [name : com.alibaba.dubbo.config.ProtocolConfig#0] have been binding by prefix of configuration properties : dubbo.protocol
- 17:54:26.496 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'nacosTestServiceImpl'
- 17:54:26.499 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.name' in PropertySource 'class path resource [provider-config.properties]' with value of type String
- 17:54:26.506 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0'
- 17:54:26.561 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Protocol$Adaptive implements com.alibaba.dubbo.rpc.Protocol {
- public void destroy() {throw new UnsupportedOperationException("method public abstract void com.alibaba.dubbo.rpc.Protocol.destroy() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!");
- }
- public int getDefaultPort() {throw new UnsupportedOperationException("method public abstract int com.alibaba.dubbo.rpc.Protocol.getDefaultPort() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!");
- }
- public com.alibaba.dubbo.rpc.Exporter export(com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
- return extension.export(arg0);
- }
- public com.alibaba.dubbo.rpc.Invoker refer(java.lang.Class arg0, com.alibaba.dubbo.common.URL arg1) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg1 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg1;
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
- return extension.refer(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.571 [main] WARN com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory - [DUBBO] No spring extension (bean) named:defaultCompiler, try to find an extension (bean) of type java.lang.String, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.575 [main] WARN com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory - [DUBBO] No spring extension (bean) named:defaultCompiler, type:java.lang.String found, stop get bean., dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.732 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class ProxyFactory$Adaptive implements com.alibaba.dubbo.rpc.ProxyFactory {
- public com.alibaba.dubbo.rpc.Invoker getInvoker(java.lang.Object arg0, java.lang.Class arg1, com.alibaba.dubbo.common.URL arg2) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg2 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg2;
- String extName = url.getParameter("proxy", "javassist");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
- com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
- return extension.getInvoker(arg0, arg1, arg2);
- }
- public java.lang.Object getProxy(com.alibaba.dubbo.rpc.Invoker arg0, boolean arg1) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = url.getParameter("proxy", "javassist");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
- com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
- return extension.getProxy(arg0, arg1);
- }
- public java.lang.Object getProxy(com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = url.getParameter("proxy", "javassist");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
- com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
- return extension.getProxy(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.806 [main] INFO com.alibaba.dubbo.config.AbstractConfig - [DUBBO] The service ready on spring started. service: com.drawnblue.userservice.NacosTestService, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.859 [main] WARN com.alibaba.dubbo.config.AbstractConfig - [DUBBO] Use random available port(20880) for protocol dubbo, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.894 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.cache;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class CacheFactory$Adaptive implements com.alibaba.dubbo.cache.CacheFactory {
- public com.alibaba.dubbo.cache.Cache getCache(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.rpc.Invocation arg1) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- if (arg1 == null) throw new IllegalArgumentException("invocation == null");
- String methodName = arg1.getMethodName();
- String extName = url.getMethodParameter(methodName, "cache", "lru");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.cache.CacheFactory) name from url(" + url.toString() + ") use keys([cache])");
- com.alibaba.dubbo.cache.CacheFactory extension = (com.alibaba.dubbo.cache.CacheFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.cache.CacheFactory.class).getExtension(extName);
- return extension.getCache(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.910 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.monitor;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class MonitorFactory$Adaptive implements com.alibaba.dubbo.monitor.MonitorFactory {
- public com.alibaba.dubbo.monitor.Monitor getMonitor(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.monitor.MonitorFactory) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.monitor.MonitorFactory extension = (com.alibaba.dubbo.monitor.MonitorFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.monitor.MonitorFactory.class).getExtension(extName);
- return extension.getMonitor(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.939 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.validation;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Validation$Adaptive implements com.alibaba.dubbo.validation.Validation {
- public com.alibaba.dubbo.validation.Validator getValidator(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("validation", "jvalidation");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.validation.Validation) name from url(" + url.toString() + ") use keys([validation])");
- com.alibaba.dubbo.validation.Validation extension = (com.alibaba.dubbo.validation.Validation)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.validation.Validation.class).getExtension(extName);
- return extension.getValidator(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.947 [main] INFO com.alibaba.dubbo.config.AbstractConfig - [DUBBO] Export dubbo service com.drawnblue.userservice.NacosTestService to local registry, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.947 [main] INFO com.alibaba.dubbo.config.AbstractConfig - [DUBBO] Export dubbo service com.drawnblue.userservice.NacosTestService to url dubbo://192.168.26.30:20880/com.drawnblue.userservice.NacosTestService?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&bind.ip=192.168.26.30&bind.port=20880&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=10932&revision=1.0.0&side=provider×tamp=1564480466829&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.947 [main] INFO com.alibaba.dubbo.config.AbstractConfig - [DUBBO] Register dubbo service com.drawnblue.userservice.NacosTestService url dubbo://192.168.26.30:20880/com.drawnblue.userservice.NacosTestService?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&bind.ip=192.168.26.30&bind.port=20880&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=10932&revision=1.0.0&side=provider×tamp=1564480466829&version=1.0.0 to registry registry://127.0.0.1:8848/com.alibaba.dubbo.registry.RegistryService?application=dubbo-provider-demo&dubbo=2.0.2&pid=10932®istry=nacos×tamp=1564480466820, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.953 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc.cluster;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Cluster$Adaptive implements com.alibaba.dubbo.rpc.cluster.Cluster {
- public com.alibaba.dubbo.rpc.Invoker join(com.alibaba.dubbo.rpc.cluster.Directory arg0) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directory argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directory argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = url.getParameter("cluster", "failover");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.Cluster) name from url(" + url.toString() + ") use keys([cluster])");
- com.alibaba.dubbo.rpc.cluster.Cluster extension = (com.alibaba.dubbo.rpc.cluster.Cluster)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.Cluster.class).getExtension(extName);
- return extension.join(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.961 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.registry;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class RegistryFactory$Adaptive implements com.alibaba.dubbo.registry.RegistryFactory {
- public com.alibaba.dubbo.registry.Registry getRegistry(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.registry.RegistryFactory) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.registry.RegistryFactory extension = (com.alibaba.dubbo.registry.RegistryFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.registry.RegistryFactory.class).getExtension(extName);
- return extension.getRegistry(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:26.969 [main] WARN com.alibaba.dubbo.qos.protocol.QosProtocolWrapper - [DUBBO] Fail to start qos server: , dubbo version: 2.6.5, current host: 192.168.26.30
- java.lang.NoClassDefFoundError: io/netty/channel/EventLoopGroup
- at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.startQosServer(QosProtocolWrapper.java:95)
- at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:59)
- at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:55)
- at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:98)
- at com.alibaba.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
- at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:513)
- at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:358)
- at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:317)
- at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:216)
- at com.alibaba.dubbo.config.spring.ServiceBean.export(ServiceBean.java:291)
- at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:131)
- at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:53)
- at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
- at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
- at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
- at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
- at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
- at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
- at com.drawnblue.userservice.impl.UserServiceApplication.main(UserServiceApplication.java:17)
- Caused by: java.lang.ClassNotFoundException: io.netty.channel.EventLoopGroup
- at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
- ... 20 common frames omitted
- 17:54:27.069 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.remoting;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Transporter$Adaptive implements com.alibaba.dubbo.remoting.Transporter {
- public com.alibaba.dubbo.remoting.Client connect(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.remoting.ChannelHandler arg1) throws com.alibaba.dubbo.remoting.RemotingException {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("client", url.getParameter("transporter", "netty"));
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString() + ") use keys([client, transporter])");
- com.alibaba.dubbo.remoting.Transporter extension = (com.alibaba.dubbo.remoting.Transporter)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Transporter.class).getExtension(extName);
- return extension.connect(arg0, arg1);
- }
- public com.alibaba.dubbo.remoting.Server bind(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.remoting.ChannelHandler arg1) throws com.alibaba.dubbo.remoting.RemotingException {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("server", url.getParameter("transporter", "netty"));
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString() + ") use keys([server, transporter])");
- com.alibaba.dubbo.remoting.Transporter extension = (com.alibaba.dubbo.remoting.Transporter)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Transporter.class).getExtension(extName);
- return extension.bind(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.101 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.remoting;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Dispatcher$Adaptive implements com.alibaba.dubbo.remoting.Dispatcher {
- public com.alibaba.dubbo.remoting.ChannelHandler dispatch(com.alibaba.dubbo.remoting.ChannelHandler arg0, com.alibaba.dubbo.common.URL arg1) {
- if (arg1 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg1;
- String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler", "all")));
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Dispatcher) name from url(" + url.toString() + ") use keys([dispatcher, dispather, channel.handler])");
- com.alibaba.dubbo.remoting.Dispatcher extension = (com.alibaba.dubbo.remoting.Dispatcher)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Dispatcher.class).getExtension(extName);
- return extension.dispatch(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.109 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.common.threadpool;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class ThreadPool$Adaptive implements com.alibaba.dubbo.common.threadpool.ThreadPool {
- public java.util.concurrent.Executor getExecutor(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("threadpool", "fixed");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.common.threadpool.ThreadPool) name from url(" + url.toString() + ") use keys([threadpool])");
- com.alibaba.dubbo.common.threadpool.ThreadPool extension = (com.alibaba.dubbo.common.threadpool.ThreadPool)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.common.threadpool.ThreadPool.class).getExtension(extName);
- return extension.getExecutor(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.166 [main] DEBUG org.jboss.netty.channel.socket.nio.SelectorUtil - [DUBBO] Using select timeout of 500, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.166 [main] DEBUG org.jboss.netty.channel.socket.nio.SelectorUtil - [DUBBO] Epoll-bug workaround enabled = false, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.341 [main] INFO com.alibaba.dubbo.remoting.transport.AbstractServer - [DUBBO] Start NettyServer bind /0.0.0.0:20880, export /192.168.26.30:20880, dubbo version: 2.6.5, current host: 192.168.26.30
- Tue Jul 30 17:54:27 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Init JM logger with Slf4jLoggerFactory success, sun.misc.Launcher$AppClassLoader@18b4aac2
- Tue Jul 30 17:54:27 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Log root path: C:\Users\Administrator\logs\
- Tue Jul 30 17:54:27 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Set nacos log path: C:\Users\Administrator\logs\nacos
- 17:54:27.393 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Register: dubbo://192.168.26.30:20880/com.drawnblue.userservice.NacosTestService?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=10932&revision=1.0.0&side=provider×tamp=1564480466829&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.490 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Subscribe: provider://192.168.26.30:20880/com.drawnblue.userservice.NacosTestService?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=configurators&check=false&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=10932&revision=1.0.0&side=provider×tamp=1564480466829&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.550 [main] WARN com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Ignore empty notify urls for subscribe url provider://192.168.26.30:20880/com.drawnblue.userservice.NacosTestService?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=configurators&check=false&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=10932&revision=1.0.0&side=provider×tamp=1564480466829&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 17:54:27.560 [com.alibaba.nacos.naming.client.listener] WARN com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Ignore empty notify urls for subscribe url provider://192.168.26.30:20880/com.drawnblue.userservice.NacosTestService?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=configurators&check=false&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=10932&revision=1.0.0&side=provider×tamp=1564480466829&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- DemoService provider is starting...
然后登陆nacos控制台查看
点击详情查看如下:
至此,服务注册到nacos上了,后面就可以整合spring-cloud-alibaba的其他的功能了。
在这个过程中刚开始服务总是注册不上,最后还是看官方文档来解决了,所以做示例时,如果出现困难一定看官方文档,认真去看
https://nacos.io/zh-cn/docs/use-nacos-with-dubbo.html
消费端项目结构
pom
- <?xml version="1.0" encoding="UTF-8"?>
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>pom</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <groupId>com.drawnblue</groupId>
- <artifactId>user</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <name>user</name>
- <description>Demo project for Spring Boot</description>
- <properties>
- <java.version>1.8</java.version>
- </properties>
- <dependencies>
- <!--local project-->
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>common</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>com.drawnblue</groupId>
- <artifactId>user-service-api</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- </dependency>
- <!--spingboot-->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <!--nacos config-->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
- <version>0.9.0.RELEASE</version>
- </dependency>
- <!-- <dependency>
- <groupId>com.alibaba.boot</groupId>
- <artifactId>nacos-config-spring-boot-actuator</artifactId>
- <version>0.2.2</version>
- </dependency>-->
- <!--以下配置dubbo############################################################################## -->
- <!--dubbo config-->
- <dependency>
- <groupId>com.alibaba.boot</groupId>
- <artifactId>dubbo-spring-boot-starter</artifactId>
- <version>0.2.0</version>
- <exclusions>
- <exclusion>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo-registry-nacos</artifactId>
- <version>0.0.1</version>
- </dependency>
- <dependency>
- <groupId>com.alibaba</groupId>
- <artifactId>dubbo</artifactId>
- <version>2.6.5</version>
- </dependency>
- <!-- <dependency>
- <groupId>com.alibaba.nacos</groupId>
- <artifactId>nacos-client</artifactId>
- <version>0.6.2</version>
- </dependency>-->
- <dependency>
- <groupId>com.alibaba.spring</groupId>
- <artifactId>spring-context-support</artifactId>
- <version>1.0.2</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </project>
yml
- spring:
- application:
- name: user-springboot
- ######## nacous configuation
- cloud:
- nacos:
- discovery:
- server-addr: 127.0.0.1:8848
- server:
- port: 7999
- #######################################################��������dubbo###########################################################
- dubbo:
- application:
- name: test
- # qos-enable: false
- # qos-port: 33333
- # qos-accept-foreign-ip: false
- scan:
- base-packages: com.drawnblue.userservice
- protocol:
- name: dubbo
- port: -1
- registry:
- address: nacos://127.0.0.1:8848
cosumer配置
- dubbo.application.name = dubbo-consumer-demo
- dubbo.registry.address = nacos://127.0.0.1:8848
- dubbo.protocol.name = dubbo
- dubbo.protocol.port = -1
- demo.service.version = 1.0.0
改造启动类
- package com.drawnblue.user;
- import com.alibaba.dubbo.config.annotation.Reference;
- import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
- import com.drawnblue.userservice.NacosTestService;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.context.annotation.AnnotationConfigApplicationContext;
- import org.springframework.context.annotation.PropertySource;
- import javax.annotation.PostConstruct;
- import java.io.IOException;
- //@SpringBootApplication
- @EnableDubbo
- @PropertySource(value = "classpath:/consumer-config.properties")
- public class UserApplication {
- @Reference(version = "${demo.service.version}")
- private NacosTestService testService;
- @PostConstruct
- public void init() {
- for (int i = 0; i < 10; i++) {
- System.out.println(testService.sayName("小马哥(mercyblitz)"));
- }
- }
- public static void main(String[] args) throws IOException{
- // SpringApplication.run(UserApplication.class, args);
- AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
- context.register(UserApplication.class);
- context.refresh();
- context.close();
- }
- }
启动
- D:\topbandSoft\java\jdk1.8\bin\java.exe "-javaagent:D:\IDEA\IntelliJ IDEA 2018.2.4\lib\idea_rt.jar=56456:D:\IDEA\IntelliJ IDEA 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath D:\topbandSoft\java\jdk1.8\jre\lib\charsets.jar;D:\topbandSoft\java\jdk1.8\jre\lib\deploy.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\access-bridge-64.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\cldrdata.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\dnsns.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\jaccess.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\jfxrt.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\localedata.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\nashorn.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunec.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunjce_provider.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunmscapi.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\sunpkcs11.jar;D:\topbandSoft\java\jdk1.8\jre\lib\ext\zipfs.jar;D:\topbandSoft\java\jdk1.8\jre\lib\javaws.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jce.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jfr.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jfxswt.jar;D:\topbandSoft\java\jdk1.8\jre\lib\jsse.jar;D:\topbandSoft\java\jdk1.8\jre\lib\management-agent.jar;D:\topbandSoft\java\jdk1.8\jre\lib\plugin.jar;D:\topbandSoft\java\jdk1.8\jre\lib\resources.jar;D:\topbandSoft\java\jdk1.8\jre\lib\rt.jar;G:\drawnblue\springcloud-alibaba\user\target\classes;G:\drawnblue\springcloud-alibaba\common\target\classes;G:\drawnblue\springcloud-alibaba\user-service-api\target\classes;G:\sharp\repo\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;G:\sharp\repo\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;G:\sharp\repo\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;G:\sharp\repo\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;G:\sharp\repo\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;G:\sharp\repo\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;G:\sharp\repo\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;G:\sharp\repo\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;G:\sharp\repo\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;G:\sharp\repo\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;G:\sharp\repo\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;G:\sharp\repo\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;G:\sharp\repo\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;G:\sharp\repo\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;G:\sharp\repo\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;G:\sharp\repo\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;G:\sharp\repo\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;G:\sharp\repo\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;G:\sharp\repo\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;G:\sharp\repo\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;G:\sharp\repo\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;G:\sharp\repo\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;G:\sharp\repo\org\springframework\boot\spring-boot-starter-actuator\2.1.6.RELEASE\spring-boot-starter-actuator-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-actuator-autoconfigure\2.1.6.RELEASE\spring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;G:\sharp\repo\org\springframework\boot\spring-boot-actuator\2.1.6.RELEASE\spring-boot-actuator-2.1.6.RELEASE.jar;G:\sharp\repo\io\micrometer\micrometer-core\1.1.5\micrometer-core-1.1.5.jar;G:\sharp\repo\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;G:\sharp\repo\org\latencyutils\LatencyUtils\2.0.3\LatencyUtils-2.0.3.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter-alibaba-nacos-discovery\0.9.0.RELEASE\spring-cloud-starter-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-alibaba-nacos-discovery\0.9.0.RELEASE\spring-cloud-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-commons\2.1.1.RELEASE\spring-cloud-commons-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\security\spring-security-crypto\5.1.5.RELEASE\spring-security-crypto-5.1.5.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-context\2.1.1.RELEASE\spring-cloud-context-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter-netflix-ribbon\2.1.1.RELEASE\spring-cloud-starter-netflix-ribbon-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter\2.1.1.RELEASE\spring-cloud-starter-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\security\spring-security-rsa\1.0.7.RELEASE\spring-security-rsa-1.0.7.RELEASE.jar;G:\sharp\repo\org\bouncycastle\bcpkix-jdk15on\1.60\bcpkix-jdk15on-1.60.jar;G:\sharp\repo\org\bouncycastle\bcprov-jdk15on\1.60\bcprov-jdk15on-1.60.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-netflix-ribbon\2.1.1.RELEASE\spring-cloud-netflix-ribbon-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-netflix-archaius\2.1.1.RELEASE\spring-cloud-netflix-archaius-2.1.1.RELEASE.jar;G:\sharp\repo\org\springframework\cloud\spring-cloud-starter-netflix-archaius\2.1.1.RELEASE\spring-cloud-starter-netflix-archaius-2.1.1.RELEASE.jar;G:\sharp\repo\com\netflix\archaius\archaius-core\0.7.6\archaius-core-0.7.6.jar;G:\sharp\repo\com\google\code\findbugs\jsr305\3.0.1\jsr305-3.0.1.jar;G:\sharp\repo\commons-configuration\commons-configuration\1.8\commons-configuration-1.8.jar;G:\sharp\repo\com\netflix\ribbon\ribbon\2.3.0\ribbon-2.3.0.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-transport\2.3.0\ribbon-transport-2.3.0.jar;G:\sharp\repo\io\reactivex\rxnetty-contexts\0.4.9\rxnetty-contexts-0.4.9.jar;G:\sharp\repo\io\reactivex\rxnetty-servo\0.4.9\rxnetty-servo-0.4.9.jar;G:\sharp\repo\com\netflix\hystrix\hystrix-core\1.4.3\hystrix-core-1.4.3.jar;G:\sharp\repo\javax\inject\javax.inject\1\javax.inject-1.jar;G:\sharp\repo\io\reactivex\rxnetty\0.4.9\rxnetty-0.4.9.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-core\2.3.0\ribbon-core-2.3.0.jar;G:\sharp\repo\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-httpclient\2.3.0\ribbon-httpclient-2.3.0.jar;G:\sharp\repo\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;G:\sharp\repo\org\apache\httpcomponents\httpclient\4.5.9\httpclient-4.5.9.jar;G:\sharp\repo\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;G:\sharp\repo\com\sun\jersey\jersey-client\1.19.1\jersey-client-1.19.1.jar;G:\sharp\repo\com\sun\jersey\jersey-core\1.19.1\jersey-core-1.19.1.jar;G:\sharp\repo\javax\ws\rs\jsr311-api\1.1.1\jsr311-api-1.1.1.jar;G:\sharp\repo\com\sun\jersey\contribs\jersey-apache-client4\1.19.1\jersey-apache-client4-1.19.1.jar;G:\sharp\repo\com\netflix\servo\servo-core\0.10.1\servo-core-0.10.1.jar;G:\sharp\repo\com\netflix\servo\servo-internal\0.10.1\servo-internal-0.10.1.jar;G:\sharp\repo\com\netflix\netflix-commons\netflix-commons-util\0.1.1\netflix-commons-util-0.1.1.jar;G:\sharp\repo\com\netflix\ribbon\ribbon-loadbalancer\2.3.0\ribbon-loadbalancer-2.3.0.jar;G:\sharp\repo\com\netflix\netflix-commons\netflix-statistics\0.1.1\netflix-statistics-0.1.1.jar;G:\sharp\repo\io\reactivex\rxjava\1.3.8\rxjava-1.3.8.jar;G:\sharp\repo\com\alibaba\boot\dubbo-spring-boot-starter\0.2.0\dubbo-spring-boot-starter-0.2.0.jar;G:\sharp\repo\org\apache\zookeeper\zookeeper\3.4.9\zookeeper-3.4.9.jar;G:\sharp\repo\jline\jline\0.9.94\jline-0.9.94.jar;G:\sharp\repo\io\netty\netty\3.10.5.Final\netty-3.10.5.Final.jar;G:\sharp\repo\org\apache\curator\curator-framework\2.12.0\curator-framework-2.12.0.jar;G:\sharp\repo\org\apache\curator\curator-client\2.12.0\curator-client-2.12.0.jar;G:\sharp\repo\com\alibaba\boot\dubbo-spring-boot-autoconfigure\0.2.0\dubbo-spring-boot-autoconfigure-0.2.0.jar;G:\sharp\repo\com\alibaba\dubbo-registry-nacos\0.0.1\dubbo-registry-nacos-0.0.1.jar;G:\sharp\repo\com\alibaba\nacos\nacos-client\0.6.0\nacos-client-0.6.0.jar;G:\sharp\repo\com\alibaba\nacos\nacos-common\0.6.0\nacos-common-0.6.0.jar;G:\sharp\repo\commons-io\commons-io\2.2\commons-io-2.2.jar;G:\sharp\repo\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;G:\sharp\repo\com\alibaba\nacos\nacos-api\0.6.0\nacos-api-0.6.0.jar;G:\sharp\repo\com\alibaba\fastjson\1.2.47\fastjson-1.2.47.jar;G:\sharp\repo\com\google\guava\guava\19.0\guava-19.0.jar;G:\sharp\repo\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;G:\sharp\repo\org\codehaus\jackson\jackson-mapper-lgpl\1.9.6\jackson-mapper-lgpl-1.9.6.jar;G:\sharp\repo\org\codehaus\jackson\jackson-core-lgpl\1.9.6\jackson-core-lgpl-1.9.6.jar;G:\sharp\repo\com\alibaba\dubbo\2.6.5\dubbo-2.6.5.jar;G:\sharp\repo\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;G:\sharp\repo\org\javassist\javassist\3.20.0-GA\javassist-3.20.0-GA.jar;G:\sharp\repo\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar;G:\sharp\repo\com\alibaba\spring\spring-context-support\1.0.2\spring-context-support-1.0.2.jar com.drawnblue.user.UserApplication
- 09:36:00.241 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4f4a7090
- 09:36:00.260 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
- 09:36:00.365 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The dubbo config bean definition [name : com.alibaba.dubbo.config.ApplicationConfig#0, class : com.alibaba.dubbo.config.ApplicationConfig] has been registered.
- 09:36:00.366 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : com.alibaba.dubbo.config.ApplicationConfig#0] has been registered.
- 09:36:00.367 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.ModuleConfig] within prefix [dubbo.module]
- 09:36:00.367 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The dubbo config bean definition [name : com.alibaba.dubbo.config.RegistryConfig#0, class : com.alibaba.dubbo.config.RegistryConfig] has been registered.
- 09:36:00.368 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : com.alibaba.dubbo.config.RegistryConfig#0] has been registered.
- 09:36:00.369 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The dubbo config bean definition [name : com.alibaba.dubbo.config.ProtocolConfig#0, class : com.alibaba.dubbo.config.ProtocolConfig] has been registered.
- 09:36:00.369 [main] INFO com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - The BeanPostProcessor bean definition [com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor] for dubbo config bean [name : com.alibaba.dubbo.config.ProtocolConfig#0] has been registered.
- 09:36:00.369 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.MonitorConfig] within prefix [dubbo.monitor]
- 09:36:00.369 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.ProviderConfig] within prefix [dubbo.provider]
- 09:36:00.369 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboConfigBindingRegistrar - There is no property for binding to dubbo config class [com.alibaba.dubbo.config.ConsumerConfig] within prefix [dubbo.consumer]
- 09:36:00.403 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor#0'
- 09:36:00.431 [main] INFO com.alibaba.dubbo.common.logger.LoggerFactory - using logger: com.alibaba.dubbo.common.logger.slf4j.Slf4jLoggerAdapter
- 09:36:00.446 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] BeanNameGenerator bean can't be found in BeanFactory with name [org.springframework.context.annotation.internalConfigurationBeanNameGenerator], dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.446 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] BeanNameGenerator will be a instance of org.springframework.context.annotation.AnnotationBeanNameGenerator , it maybe a potential problem on bean name generation., dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.471 [main] WARN com.alibaba.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationBeanPostProcessor - [DUBBO] No Spring Bean annotating Dubbo's @Service was found under package[com.drawnblue.user], dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.473 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
- 09:36:00.475 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
- 09:36:00.477 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
- 09:36:00.478 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
- 09:36:00.481 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'referenceAnnotationBeanPostProcessor'
- 09:36:00.482 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor#0'
- 09:36:00.512 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
- 09:36:00.513 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor#1'
- 09:36:00.514 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
- 09:36:00.514 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor#2'
- 09:36:00.514 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
- 09:36:00.521 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userApplication'
- 09:36:00.545 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.version' in PropertySource 'class path resource [consumer-config.properties]' with value of type String
- 09:36:00.547 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.version' in PropertySource 'class path resource [consumer-config.properties]' with value of type String
- 09:36:00.547 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.version' in PropertySource 'class path resource [consumer-config.properties]' with value of type String
- 09:36:00.642 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Protocol$Adaptive implements com.alibaba.dubbo.rpc.Protocol {
- public void destroy() {throw new UnsupportedOperationException("method public abstract void com.alibaba.dubbo.rpc.Protocol.destroy() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!");
- }
- public int getDefaultPort() {throw new UnsupportedOperationException("method public abstract int com.alibaba.dubbo.rpc.Protocol.getDefaultPort() of interface com.alibaba.dubbo.rpc.Protocol is not adaptive method!");
- }
- public com.alibaba.dubbo.rpc.Exporter export(com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
- return extension.export(arg0);
- }
- public com.alibaba.dubbo.rpc.Invoker refer(java.lang.Class arg0, com.alibaba.dubbo.common.URL arg1) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg1 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg1;
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
- return extension.refer(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.646 [main] WARN com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory - [DUBBO] No spring extension (bean) named:defaultCompiler, try to find an extension (bean) of type java.lang.String, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.647 [main] WARN com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory - [DUBBO] No spring extension (bean) named:defaultCompiler, type:java.lang.String found, stop get bean., dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.767 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc.cluster;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Cluster$Adaptive implements com.alibaba.dubbo.rpc.cluster.Cluster {
- public com.alibaba.dubbo.rpc.Invoker join(com.alibaba.dubbo.rpc.cluster.Directory arg0) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directory argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directory argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = url.getParameter("cluster", "failover");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.Cluster) name from url(" + url.toString() + ") use keys([cluster])");
- com.alibaba.dubbo.rpc.cluster.Cluster extension = (com.alibaba.dubbo.rpc.cluster.Cluster)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.Cluster.class).getExtension(extName);
- return extension.join(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.791 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class ProxyFactory$Adaptive implements com.alibaba.dubbo.rpc.ProxyFactory {
- public com.alibaba.dubbo.rpc.Invoker getInvoker(java.lang.Object arg0, java.lang.Class arg1, com.alibaba.dubbo.common.URL arg2) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg2 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg2;
- String extName = url.getParameter("proxy", "javassist");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
- com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
- return extension.getInvoker(arg0, arg1, arg2);
- }
- public java.lang.Object getProxy(com.alibaba.dubbo.rpc.Invoker arg0, boolean arg1) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = url.getParameter("proxy", "javassist");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
- com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
- return extension.getProxy(arg0, arg1);
- }
- public java.lang.Object getProxy(com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException {
- if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
- if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
- String extName = url.getParameter("proxy", "javassist");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
- com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
- return extension.getProxy(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.814 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Found key 'demo.service.version' in PropertySource 'class path resource [consumer-config.properties]' with value of type String
- 09:36:00.837 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.ApplicationConfig#0'
- 09:36:00.842 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - The properties of bean [name : com.alibaba.dubbo.config.ApplicationConfig#0] have been binding by prefix of configuration properties : dubbo.application
- 09:36:00.842 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.RegistryConfig#0'
- 09:36:00.849 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - The properties of bean [name : com.alibaba.dubbo.config.RegistryConfig#0] have been binding by prefix of configuration properties : dubbo.registry
- 09:36:00.850 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceBeanBuilder - The bean[type:ReferenceBean] has been built.
- 09:36:00.893 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.registry;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class RegistryFactory$Adaptive implements com.alibaba.dubbo.registry.RegistryFactory {
- public com.alibaba.dubbo.registry.Registry getRegistry(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.registry.RegistryFactory) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.registry.RegistryFactory extension = (com.alibaba.dubbo.registry.RegistryFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.registry.RegistryFactory.class).getExtension(extName);
- return extension.getRegistry(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:00.911 [main] WARN com.alibaba.dubbo.qos.protocol.QosProtocolWrapper - [DUBBO] Fail to start qos server: , dubbo version: 2.6.5, current host: 192.168.26.30
- java.lang.NoClassDefFoundError: io/netty/channel/EventLoopGroup
- at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.startQosServer(QosProtocolWrapper.java:95)
- at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:68)
- at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:106)
- at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
- at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394)
- at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333)
- at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163)
- at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.init(ReferenceAnnotationBeanPostProcessor.java:163)
- at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.access$100(ReferenceAnnotationBeanPostProcessor.java:147)
- at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildInvocationHandler(ReferenceAnnotationBeanPostProcessor.java:141)
- at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildProxy(ReferenceAnnotationBeanPostProcessor.java:123)
- at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:117)
- at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:50)
- at com.alibaba.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:340)
- at com.alibaba.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:520)
- at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
- at com.alibaba.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:128)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1416)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
- at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
- at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
- at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
- at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
- at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
- at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
- at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
- at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
- at com.drawnblue.user.UserApplication.main(UserApplication.java:32)
- Caused by: java.lang.ClassNotFoundException: io.netty.channel.EventLoopGroup
- at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
- ... 28 common frames omitted
- Wed Jul 31 09:36:00 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Init JM logger with Slf4jLoggerFactory success, sun.misc.Launcher$AppClassLoader@18b4aac2
- Wed Jul 31 09:36:00 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Log root path: C:\Users\Administrator\logs\
- Wed Jul 31 09:36:00 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Set nacos log path: C:\Users\Administrator\logs\nacos
- 09:36:01.083 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Load registry store file C:\Users\Administrator\.dubbo\dubbo-registry-dubbo-consumer-demo-127.0.0.1:8848.cache, data: {com.drawnblue.userservice.NacosTestService:1.0.0=dubbo://192.168.26.30:20880?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=providers&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=8660&protocol=dubbo&revision=1.0.0&side=provider×tamp=1564533362655&version=1.0.0}, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.089 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc.cluster;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class RouterFactory$Adaptive implements com.alibaba.dubbo.rpc.cluster.RouterFactory {
- public com.alibaba.dubbo.rpc.cluster.Router getRouter(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getProtocol();
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.RouterFactory) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.rpc.cluster.RouterFactory extension = (com.alibaba.dubbo.rpc.cluster.RouterFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.RouterFactory.class).getExtension(extName);
- return extension.getRouter(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.132 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.rpc.cluster;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class ConfiguratorFactory$Adaptive implements com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory {
- public com.alibaba.dubbo.rpc.cluster.Configurator getConfigurator(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getProtocol();
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory extension = (com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory.class).getExtension(extName);
- return extension.getConfigurator(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.150 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Register: consumer://192.168.26.30/com.drawnblue.userservice.NacosTestService?application=dubbo-consumer-demo&category=consumers&check=false&dubbo=2.0.2&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=9560&revision=1.0.0&side=consumer×tamp=1564536960855&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.435 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Subscribe: consumer://192.168.26.30/com.drawnblue.userservice.NacosTestService?application=dubbo-consumer-demo&category=providers,configurators,routers&dubbo=2.0.2&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=9560&revision=1.0.0&side=consumer×tamp=1564536960855&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.490 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Notify urls for subscribe url consumer://192.168.26.30/com.drawnblue.userservice.NacosTestService?application=dubbo-consumer-demo&category=providers,configurators,routers&dubbo=2.0.2&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=9560&revision=1.0.0&side=consumer×tamp=1564536960855&version=1.0.0, urls: [dubbo://192.168.26.30:20880?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=providers&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=8660&protocol=dubbo&revision=1.0.0&side=provider×tamp=1564533362655&version=1.0.0], dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.516 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.remoting;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Transporter$Adaptive implements com.alibaba.dubbo.remoting.Transporter {
- public com.alibaba.dubbo.remoting.Client connect(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.remoting.ChannelHandler arg1) throws com.alibaba.dubbo.remoting.RemotingException {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("client", url.getParameter("transporter", "netty"));
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString() + ") use keys([client, transporter])");
- com.alibaba.dubbo.remoting.Transporter extension = (com.alibaba.dubbo.remoting.Transporter)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Transporter.class).getExtension(extName);
- return extension.connect(arg0, arg1);
- }
- public com.alibaba.dubbo.remoting.Server bind(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.remoting.ChannelHandler arg1) throws com.alibaba.dubbo.remoting.RemotingException {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("server", url.getParameter("transporter", "netty"));
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString() + ") use keys([server, transporter])");
- com.alibaba.dubbo.remoting.Transporter extension = (com.alibaba.dubbo.remoting.Transporter)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Transporter.class).getExtension(extName);
- return extension.bind(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.584 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.remoting;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Dispatcher$Adaptive implements com.alibaba.dubbo.remoting.Dispatcher {
- public com.alibaba.dubbo.remoting.ChannelHandler dispatch(com.alibaba.dubbo.remoting.ChannelHandler arg0, com.alibaba.dubbo.common.URL arg1) {
- if (arg1 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg1;
- String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler", "all")));
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Dispatcher) name from url(" + url.toString() + ") use keys([dispatcher, dispather, channel.handler])");
- com.alibaba.dubbo.remoting.Dispatcher extension = (com.alibaba.dubbo.remoting.Dispatcher)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Dispatcher.class).getExtension(extName);
- return extension.dispatch(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.592 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.common.threadpool;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class ThreadPool$Adaptive implements com.alibaba.dubbo.common.threadpool.ThreadPool {
- public java.util.concurrent.Executor getExecutor(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("threadpool", "fixed");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.common.threadpool.ThreadPool) name from url(" + url.toString() + ") use keys([threadpool])");
- com.alibaba.dubbo.common.threadpool.ThreadPool extension = (com.alibaba.dubbo.common.threadpool.ThreadPool)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.common.threadpool.ThreadPool.class).getExtension(extName);
- return extension.getExecutor(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.634 [main] INFO com.alibaba.dubbo.remoting.transport.AbstractClient - [DUBBO] Successed connect to server /192.168.26.30:20880 from NettyClient 192.168.26.30 using dubbo version 2.6.5, channel is NettyChannel [channel=[id: 0xcda15f3d, /192.168.26.30:56476 => /192.168.26.30:20880]], dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.634 [main] INFO com.alibaba.dubbo.remoting.transport.AbstractClient - [DUBBO] Start NettyClient hh-PC/192.168.26.30 connect to the server /192.168.26.30:20880, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.656 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.cache;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class CacheFactory$Adaptive implements com.alibaba.dubbo.cache.CacheFactory {
- public com.alibaba.dubbo.cache.Cache getCache(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.rpc.Invocation arg1) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- if (arg1 == null) throw new IllegalArgumentException("invocation == null");
- String methodName = arg1.getMethodName();
- String extName = url.getMethodParameter(methodName, "cache", "lru");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.cache.CacheFactory) name from url(" + url.toString() + ") use keys([cache])");
- com.alibaba.dubbo.cache.CacheFactory extension = (com.alibaba.dubbo.cache.CacheFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.cache.CacheFactory.class).getExtension(extName);
- return extension.getCache(arg0, arg1);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.665 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.monitor;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class MonitorFactory$Adaptive implements com.alibaba.dubbo.monitor.MonitorFactory {
- public com.alibaba.dubbo.monitor.Monitor getMonitor(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.monitor.MonitorFactory) name from url(" + url.toString() + ") use keys([protocol])");
- com.alibaba.dubbo.monitor.MonitorFactory extension = (com.alibaba.dubbo.monitor.MonitorFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.monitor.MonitorFactory.class).getExtension(extName);
- return extension.getMonitor(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.673 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader - [DUBBO] package com.alibaba.dubbo.validation;
- import com.alibaba.dubbo.common.extension.ExtensionLoader;
- public class Validation$Adaptive implements com.alibaba.dubbo.validation.Validation {
- public com.alibaba.dubbo.validation.Validator getValidator(com.alibaba.dubbo.common.URL arg0) {
- if (arg0 == null) throw new IllegalArgumentException("url == null");
- com.alibaba.dubbo.common.URL url = arg0;
- String extName = url.getParameter("validation", "jvalidation");
- if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.validation.Validation) name from url(" + url.toString() + ") use keys([validation])");
- com.alibaba.dubbo.validation.Validation extension = (com.alibaba.dubbo.validation.Validation)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.validation.Validation.class).getExtension(extName);
- return extension.getValidator(arg0);
- }
- }, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.686 [main] INFO com.alibaba.dubbo.config.AbstractConfig - [DUBBO] Refer dubbo service com.drawnblue.userservice.NacosTestService from url nacos://127.0.0.1:8848/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=dubbo-consumer-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=providers&check=false&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=9560&protocol=dubbo®ister.ip=192.168.26.30&remote.timestamp=1564533362655&revision=1.0.0&side=consumer×tamp=1564536960855&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.778 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.789 [com.alibaba.nacos.naming.client.listener] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry - [DUBBO] Notify urls for subscribe url consumer://192.168.26.30/com.drawnblue.userservice.NacosTestService?application=dubbo-consumer-demo&category=providers,configurators,routers&dubbo=2.0.2&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=9560&revision=1.0.0&side=consumer×tamp=1564536960855&version=1.0.0, urls: [dubbo://192.168.26.30:20880?anyhost=true&application=dubbo-provider-demo&bean.name=ServiceBean:com.drawnblue.userservice.NacosTestService:1.0.0&category=providers&dubbo=2.0.2&generic=false&interface=com.drawnblue.userservice.NacosTestService&methods=sayName&pid=8660&protocol=dubbo&revision=1.0.0&side=provider×tamp=1564533362655&version=1.0.0], dubbo version: 2.6.5, current host: 192.168.26.30
- 09:36:01.793 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.797 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.804 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.806 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.810 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.812 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.813 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.814 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.815 [DubboClientHandler-192.168.26.30:20880-thread-1] DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler - [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.6.5, current host: 192.168.26.30
- Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
- 09:36:01.816 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.spring.context.annotation.DubboConfigConfiguration$Single'
- 09:36:01.817 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.ProtocolConfig#0'
- 09:36:01.824 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - The properties of bean [name : com.alibaba.dubbo.config.ProtocolConfig#0] have been binding by prefix of configuration properties : dubbo.protocol
- 09:36:01.843 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@4f4a7090, started on Wed Jul 31 09:36:00 CST 2019
- 09:36:01.844 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor - com.alibaba.dubbo.common.bytecode.proxy0@79c7532f was destroying!
- 09:36:01.844 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor - class com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor was destroying!
详情
该整合存在如下问题:
1、该整合还不算是题目中的整合,因为他废掉了springboot,仅仅用了dubbo和nacos
2、虽然将service注册上来,但是如何调用呢
3、是否能够实现restful风格和service并存的随意调用还需要探索,笔者查询网路尚未看到,大多数是要将dubbo封装成restful
=====================================================补充============================================================
细细想来,一般项目中dubbo和restful风格一般一个服务中仅用一种,如果混着用会显得非常乱而无章可循,所以,如果老项目用的dubbo,那么我们可以将其注册到nacos上,相应调用也用dubbo,新项目则可以采用cloud风格,如果需要调用到以前的服务,可以通过dubbo调用,在包装成新的cloud,一般一个项目还是统一风格比较好。
<!-- Dubbo Nacos registry dependency -->
- <dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-registry-nacos</artifactId>
<version>2.6.7</version>
</dependency>
<!-- Dubbo dependency -->- <dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.6.5</version>
</dependency>
<!-- Alibaba Spring Context extension -->
<dependency>
<groupId>com.alibaba.spring</groupId>
<artifactId>spring-context-support</artifactId>
<version>1.0.2</version>
</dependency>- <!– 该包是由于依赖找不类而更换版本添加--》
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-api</artifactId>
<version>1.1.4</version>
</dependency>
nacos配置和zk配置的区别在,集群配置如下:
<dubbo:registry address="nacos://192.168.xx.xx:8848?backup=192.168.xx.xx:8848,192.168.xx.xx:8848"/>
springboot,dubbo,nacos,spring-cloud-alibaba的整合的更多相关文章
- Spring Cloud Alibaba Sentinel 整合 Feign 的设计实现
作者 | Spring Cloud Alibaba 高级开发工程师洛夜 来自公众号阿里巴巴中间件投稿 前段时间 Hystrix 宣布不再维护之后(Hystrix 停止开发...Spring Cloud ...
- Spring Cloud Alibaba生态探索:Dubbo、Nacos及Sentinel的完美结合
@ 目录 背景 一.项目框架 1.1 采用IDEA和Maven多模块进行项目搭建 1.2 模块管理及版本管理 二.微服务公共接口 2.1 定义一个公共接口Api 2.2 pom.xml 2.3 Goo ...
- Spring Cloud Alibaba 新版本发布:众多期待内容整合打包加入!
在Nacos 1.0.0 Release之后,Spring Cloud Alibaba也终于发布了最新的版本.该版本距离上一次发布,过去了整整4个月!下面就随我一起看看,这个大家期待已久的版本都有哪些 ...
- Spring Cloud与Dubbo的完美融合之手「Spring Cloud Alibaba」
很早以前,在刚开始搞Spring Cloud基础教程的时候,写过这样一篇文章:<微服务架构的基础框架选择:Spring Cloud还是Dubbo?>,可能不少读者也都看过.之后也就一直有关 ...
- Spring Cloud Alibaba系列之分布式服务组件Dubbo
本博客的例子代码可以在github找到下载链接:代码下载 SpringBoot.SpringCloud Alibaba系列博客专栏:链接 1.分布式理论 1.1.分布式基本定义 <分布式系统原理 ...
- Spring Cloud Alibaba基础教程:Sentinel使用Nacos存储规则
通过上一篇<使用Sentinel实现接口限流>的介绍,相信大家对Sentinel已经有了初步的认识.在Spring Cloud Alibaba的整合封装之下,接口限流这件事情可以非常轻易的 ...
- 厉害了,Spring Cloud Alibaba 发布 GA 版本!
? 小马哥 & Josh Long ? 喜欢写一首诗一般的代码,更喜欢和你共同 code review,英雄的相惜,犹如时间沉淀下来的对话,历久方弥新. 相见如故,@杭州. 4 月 18 日, ...
- Spring Cloud Alibaba到底坑不坑?
之前我发过一篇<说说我为什么看好Spring Cloud Alibaba>,然后这两天有网友给我转了这篇文章<坑爹项目spring-cloud-alibaba,我们也来一个>, ...
- Spring Cloud Alibaba基础教程:使用Sentinel实现接口限流
最近管点闲事浪费了不少时间,感谢网友libinwalan的留言提醒.及时纠正路线,继续跟大家一起学习Spring Cloud Alibaba. Nacos作为注册中心和配置中心的基础教程,到这里先告一 ...
- Spring Cloud Alibaba 使用Sentinel实现接口限流
Sentinel是什么 Sentinel的官方标题是:分布式系统的流量防卫兵.从名字上来看,很容易就能猜到它是用来作服务稳定性保障的.对于服务稳定性保障组件,如果熟悉Spring Cloud的用户,第 ...
随机推荐
- Python中注释与声明
Python中注释的写法 #:使用井号进行单行注释 Python中貌似没有提供多行注释,不过我们可以利用三引号的多行字符串来进行多行注释 """ 多行注释内容 多行注释内 ...
- 深度学习之父低调开源 CapsNet,欲取代 CNN
“卷积神经网络(CNN)的时代已经过去了!” ——Geoffrey Hinton 酝酿许久,深度学习之父Geoffrey Hinton在10月份发表了备受瞩目的Capsule Networks(Cap ...
- 自身经历 .NET转Java 的一些分享
原因 楼主在二线城市从事.NET开发8年,当薪资达到15k想往20k跳的时候,发现一个残酷的现实.在招聘信息上给出这个薪资的一共10家,其中:2~3家给出的是假的薪资范围(吸引面试者),2家是总人数不 ...
- Hash Table(散列表)
这篇主要是基础的数据结构学习,写的时候才明白了书上说到的一些问题,由于该篇仅仅只是对这种数据结构进行一个理解,所以很基础,关于h(x)函数也只是简单的运用了除法散列,然后为了应对冲突,我用的是链接法. ...
- mybatis 无效字符
只想说 是真的坑啊!!!!!sql就是对 但就是报错无效字符..... 一.sql后有 “:”,我觉得这个应该坑了很多人了 二.标签后有类似于空格的东西(我也不知道是tab还是空格,反正删完就对了) ...
- idea修改项目编码
- Python 基础之面向对象之八步理解装饰器
装饰器:在不改变原有代码的情况下,为该原函数扩展新功能特征:返回新函数,替换旧函数语法:@ 语法糖 1.装饰器原型 #例1: def kuozhan(func): def newfunc(): ...
- Keras的TimeDistributed层
Keras的TimeDistributed层主要用途是在时间维度上进行全连接. 比如Faster RCNN,1张图生成了16个ROI,需要对每一个ROI进行分类和回归,ROI的维度是7×7×512,长 ...
- vue element多图上传
最近项目需要优化图片上传,由单个改成多个,这里记录下自己遇到的一些问题和解决方法 本以为是传全部图片到后台,然后统一处理,但后面在Network中发现upload组件其实还是单一上传,那只能依照它的方 ...
- spring cloud spring boot JPA 克隆对象修改属性后 无法正常的执行save方法进行保存或者更新
2019-12-1220:34:58 spring cloud spring boot JPA 克隆对象修改属性后 无法正常的执行save方法进行保存或者更新 未解决