zoukankan      html  css  js  c++  java
  • 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文件:

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     4     <modelVersion>4.0.0</modelVersion>
     5     <parent>
     6         <groupId>org.springframework.boot</groupId>
     7         <artifactId>spring-boot-starter-parent</artifactId>
     8         <version>2.1.6.RELEASE</version>
     9         <relativePath/> <!-- lookup parent from repository -->
    10     </parent>
    11     <groupId>com.drawnblue</groupId>
    12     <artifactId>pom</artifactId>
    13     <version>0.0.1-SNAPSHOT</version>
    14     <name>pom</name>
    15     <description>Demo project for Spring Boot</description>
    16     <packaging>pom</packaging>
    17     <properties>
    18         <java.version>1.8</java.version>
    19     </properties>
    20 
    21     <dependencies>
    22         <dependency>
    23             <groupId>org.springframework.boot</groupId>
    24             <artifactId>spring-boot-starter</artifactId>
    25         </dependency>
    26 
    27         <dependency>
    28             <groupId>org.springframework.boot</groupId>
    29             <artifactId>spring-boot-starter-test</artifactId>
    30             <scope>test</scope>
    31         </dependency>
    32     </dependencies>
    33     <dependencyManagement>
    34         <dependencies>
    35             <dependency>
    36                 <groupId>org.springframework.cloud</groupId>
    37                 <artifactId>spring-cloud-dependencies</artifactId>
    38                 <version>Greenwich.SR2</version>
    39             </dependency>
    40             <dependency>
    41                 <groupId>org.springframework.cloud</groupId>
    42                 <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    43                 <version>0.9.0.RELEASE</version>
    44             </dependency>
    45         </dependencies>
    46     </dependencyManagement>
    47     <build>
    48         <plugins>
    49             <plugin>
    50                 <groupId>org.springframework.boot</groupId>
    51                 <artifactId>spring-boot-maven-plugin</artifactId>
    52             </plugin>
    53         </plugins>
    54     </build>
    55  
    56 </project>
    View Code

    在这里人添加一些东西,父类中第二次整合spring-cloud-dependencies和spring-cloud-alibaba-dependencies,以及整合成功的验证这次整合是在不同环境下进行,因为网络太慢,采用的是aliyun镜像仓库

    需要注意的是,现有cloud然后有cloud-alibaba,两个保持scope和type一致

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     4     <modelVersion>4.0.0</modelVersion>
     5     <parent>
     6         <groupId>org.springframework.boot</groupId>
     7         <artifactId>spring-boot-starter-parent</artifactId>
     8         <version>2.1.6.RELEASE</version>
     9         <relativePath/> <!-- lookup parent from repository -->
    10     </parent>
    11     <groupId>com.drawnblue</groupId>
    12     <artifactId>pom</artifactId>
    13     <version>0.0.1-SNAPSHOT</version>
    14     <name>pom</name>
    15     <packaging>pom</packaging>
    16     <description>Demo project for Spring Boot</description>
    17 
    18     <properties>
    19         <pom.version>2.1.6.RELEASE</pom.version>
    20         <java.version>1.8</java.version>
    21     </properties>
    22 
    23     <dependencies>
    24         <dependency>
    25             <groupId>org.springframework.boot</groupId>
    26             <artifactId>spring-boot-starter</artifactId>
    27         </dependency>
    28     </dependencies>
    29 <dependencyManagement>
    30     <dependencies>
    31         <dependency>
    32             <groupId>org.springframework.cloud</groupId>
    33             <artifactId>spring-cloud-dependencies</artifactId>
    34             <version>Greenwich.SR2</version>
    35             <scope>import</scope>
    36             <type>pom</type>
    37         </dependency>
    38 
    39         <dependency>
    40             <groupId>org.springframework.cloud</groupId>
    41             <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    42             <version>0.9.0.RELEASE</version>
    43             <scope>import</scope>
    44             <type>pom</type>
    45         </dependency>
    46 
    47     </dependencies>
    48 
    49 </dependencyManagement>
    50     <build>
    51         <plugins>
    52             <plugin>
    53                 <groupId>org.springframework.boot</groupId>
    54                 <artifactId>spring-boot-maven-plugin</artifactId>
    55             </plugin>
    56         </plugins>
    57     </build>
    58    <!-- <repositories>
    59         <repository>
    60             <id>spring-milestones</id>
    61             <name>Spring Milestones</name>
    62             <url>https://repo.spring.io/milestone</url>
    63             <snapshots>
    64                 <enabled>false</enabled>
    65             </snapshots>
    66         </repository>
    67     </repositories>-->
    68 </project>
    View Code

    验证pom的终端,mvn clean进行验证如下表示成功

    Microsoft Windows [版本 10.0.17134.915]
    (c) 2018 Microsoft Corporation。保留所有权利。
    
    D:drawnbluespringcloud-alibabapom>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:drawnbluespringcloud-alibabapom>^A
    View Code

    common,dao都是一般的不可执行项目,作为依赖

    common pom

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     4     <modelVersion>4.0.0</modelVersion>
     5     <parent>
     6         <groupId>com.drawnblue</groupId>
     7         <artifactId>pom</artifactId>
     8         <version>0.0.1-SNAPSHOT</version>
     9     </parent>
    10     <groupId>com.drawnblue</groupId>
    11     <artifactId>common</artifactId>
    12     <version>0.0.1-SNAPSHOT</version>
    13     <name>common</name>
    14     <description>Demo project for Spring Boot</description>
    15 
    16     <properties>
    17         <java.version>1.8</java.version>
    18     </properties>
    19 
    20     <dependencies>
    21         <dependency>
    22             <groupId>org.springframework.boot</groupId>
    23             <artifactId>spring-boot-starter</artifactId>
    24         </dependency>
    25 
    26         <dependency>
    27             <groupId>org.springframework.boot</groupId>
    28             <artifactId>spring-boot-starter-test</artifactId>
    29             <scope>test</scope>
    30         </dependency>
    31     </dependencies>
    32 
    33     <build>
    34         <plugins>
    35             <plugin>
    36                 <groupId>org.springframework.boot</groupId>
    37                 <artifactId>spring-boot-maven-plugin</artifactId>
    38             </plugin>
    39         </plugins>
    40     </build>
    41 
    42 </project>
    View Code

    dao pom

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     4     <modelVersion>4.0.0</modelVersion>
     5     <parent>
     6         <groupId>com.drawnblue</groupId>
     7         <artifactId>pom</artifactId>
     8         <version>0.0.1-SNAPSHOT</version>
     9     </parent>
    10     <groupId>com.drawnblue</groupId>
    11     <artifactId>dao</artifactId>
    12     <version>0.0.1-SNAPSHOT</version>
    13     <name>dao</name>
    14     <description>Demo project for Spring Boot</description>
    15 
    16     <properties>
    17         <java.version>1.8</java.version>
    18     </properties>
    19 
    20     <dependencies>
    21         <dependency>
    22             <groupId>com.drawnblue</groupId>
    23             <artifactId>common</artifactId>
    24             <version>0.0.1-SNAPSHOT</version>
    25         </dependency>
    26     </dependencies>
    27 
    28     <build>
    29         <plugins>
    30             <plugin>
    31                 <groupId>org.springframework.boot</groupId>
    32                 <artifactId>spring-boot-maven-plugin</artifactId>
    33             </plugin>
    34         </plugins>
    35     </build>
    36 
    37 </project>
    View Code

    user-service-api pom

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     4     <modelVersion>4.0.0</modelVersion>
     5     <parent>
     6         <groupId>com.drawnblue</groupId>
     7         <artifactId>pom</artifactId>
     8         <version>0.0.1-SNAPSHOT</version>
     9     </parent>
    10     <groupId>com.drawnblue</groupId>
    11     <artifactId>user-service-api</artifactId>
    12     <version>0.0.1-SNAPSHOT</version>
    13     <name>user-service-api</name>
    14     <description>Demo project for Spring Boot</description>
    15 
    16     <properties>
    17         <java.version>1.8</java.version>
    18     </properties>
    19 
    20     <dependencies>
    21         <dependency>
    22             <groupId>com.drawnblue</groupId>
    23             <artifactId>common</artifactId>
    24             <version>0.0.1-SNAPSHOT</version>
    25         </dependency>
    26     </dependencies>
    27 
    28     <build>
    29         <plugins>
    30             <plugin>
    31                 <groupId>org.springframework.boot</groupId>
    32                 <artifactId>spring-boot-maven-plugin</artifactId>
    33             </plugin>
    34         </plugins>
    35     </build>
    36 
    37 </project>
    View Code

    user-service pom

      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4     <modelVersion>4.0.0</modelVersion>
      5     <parent>
      6         <groupId>com.drawnblue</groupId>
      7         <artifactId>pom</artifactId>
      8         <version>0.0.1-SNAPSHOT</version>
      9     </parent>
     10     <groupId>com.drawnblue</groupId>
     11     <artifactId>user-service</artifactId>
     12     <version>0.0.1-SNAPSHOT</version>
     13     <name>user-service</name>
     14     <description>Demo project for Spring Boot</description>
     15 
     16     <properties>
     17         <java.version>1.8</java.version>
     18     </properties>
     19 
     20     <dependencies>
     21         <!--local project-->
     22         <dependency>
     23             <groupId>com.drawnblue</groupId>
     24             <artifactId>common</artifactId>
     25             <version>0.0.1-SNAPSHOT</version>
     26         </dependency>
     27         <dependency>
     28             <groupId>com.drawnblue</groupId>
     29             <artifactId>dao</artifactId>
     30             <version>0.0.1-SNAPSHOT</version>
     31         </dependency>
     32         <dependency>
     33             <groupId>com.drawnblue</groupId>
     34             <artifactId>user-service-api</artifactId>
     35             <version>0.0.1-SNAPSHOT</version>
     36         </dependency>
     37 <!--spingboot-->
     38         <dependency>
     39             <groupId>org.springframework.boot</groupId>
     40             <artifactId>spring-boot-starter</artifactId>
     41         </dependency>
     42         <dependency>
     43             <groupId>org.springframework.boot</groupId>
     44             <artifactId>spring-boot-starter-web</artifactId>
     45         </dependency>
     46         <dependency>
     47             <groupId>org.springframework.boot</groupId>
     48             <artifactId>spring-boot-starter-test</artifactId>
     49             <scope>test</scope>
     50         </dependency>
     51         <dependency>
     52             <groupId>org.springframework.boot</groupId>
     53             <artifactId>spring-boot-starter-actuator</artifactId>
     54         </dependency>
     55         <!--datasource config-->
     56         <dependency>
     57             <groupId>com.alibaba</groupId>
     58             <artifactId>druid</artifactId>
     59             <version>1.1.18</version>
     60         </dependency>
     61         <dependency>
     62             <groupId>org.springframework</groupId>
     63             <artifactId>spring-jdbc</artifactId>
     64             <version>5.1.8.RELEASE</version>
     65         </dependency>
     66         <dependency>
     67             <groupId>mysql</groupId>
     68             <artifactId>mysql-connector-java</artifactId>
     69             <scope>runtime</scope>
     70         </dependency>
     71         <dependency>
     72             <groupId>org.mybatis.spring.boot</groupId>
     73             <artifactId>mybatis-spring-boot-starter</artifactId>
     74             <version>1.3.2</version>
     75         </dependency>
     76 
     77 <!--nacos config-->
     78         <dependency>
     79             <groupId>org.springframework.cloud</groupId>
     80             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
     81             <version>0.9.0.RELEASE</version>
     82         </dependency>
     83 <!--        <dependency>
     84             <groupId>com.alibaba.boot</groupId>
     85             <artifactId>nacos-config-spring-boot-actuator</artifactId>
     86             <version>0.2.2</version>
     87         </dependency>-->
     88         <!--以下配置dubbo############################################################################## -->
     89         <!--dubbo config-->
     90         <dependency>
     91             <groupId>com.alibaba.boot</groupId>
     92             <artifactId>dubbo-spring-boot-starter</artifactId>
     93             <version>0.2.0</version>
     94             <exclusions>
     95                 <exclusion>
     96                     <groupId>com.alibaba</groupId>
     97                     <artifactId>dubbo</artifactId>
     98                 </exclusion>
     99             </exclusions>
    100         </dependency>
    101         <dependency>
    102             <groupId>com.alibaba</groupId>
    103             <artifactId>dubbo-registry-nacos</artifactId>
    104             <version>0.0.1</version>
    105         </dependency>
    106         <dependency>
    107             <groupId>com.alibaba</groupId>
    108             <artifactId>dubbo</artifactId>
    109             <version>2.6.5</version>
    110         </dependency>
    111 <!--        <dependency>
    112             <groupId>com.alibaba.nacos</groupId>
    113             <artifactId>nacos-client</artifactId>
    114             <version>0.6.2</version>
    115         </dependency>-->
    116         <dependency>
    117             <groupId>com.alibaba.spring</groupId>
    118             <artifactId>spring-context-support</artifactId>
    119             <version>1.0.2</version>
    120         </dependency>
    121     </dependencies>
    122     <build>
    123         <plugins>
    124             <plugin>
    125                 <groupId>org.springframework.boot</groupId>
    126                 <artifactId>spring-boot-maven-plugin</artifactId>
    127             </plugin>
    128         </plugins>
    129     </build>
    130 
    131 </project>
    View Code

     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类省略)

     1 package com.drawnblue.userservice.impl;
     2 
     3 import com.alibaba.dubbo.config.annotation.Service;
     4 import com.alibaba.dubbo.rpc.RpcContext;
     5 import com.drawnblue.userservice.NacosTestService;
     6 import org.springframework.beans.factory.annotation.Value;
     7 
     8 @Service(version = "${demo.service.version}",interfaceClass = NacosTestService.class)
     9 public class NacosTestServiceImpl implements NacosTestService {
    10     @Value("${demo.service.name}")
    11     private String serviceName;
    12     @Override
    13     public String sayName(String name) {
    14         RpcContext rpcContext = RpcContext.getContext();
    15         return String.format("Service [name :%s , port : %d] %s("%s") : Hello,%s",
    16                 serviceName,
    17                 rpcContext.getLocalPort(),
    18                 rpcContext.getMethodName(),
    19                 name,
    20                 name);
    21     }
    22 }

    需要注意的是该注解的service采用的是dubbo的注解,不要搞错了

    一切写完后,我们就可以启动服务了,启动成功可以看到控制台如下:

    D:	opbandSoftjavajdk1.8injava.exe "-javaagent:D:IDEAIntelliJ IDEA 2018.2.4libidea_rt.jar=63778:D:IDEAIntelliJ IDEA 2018.2.4in" -Dfile.encoding=UTF-8 -classpath D:	opbandSoftjavajdk1.8jrelibcharsets.jar;D:	opbandSoftjavajdk1.8jrelibdeploy.jar;D:	opbandSoftjavajdk1.8jrelibextaccess-bridge-64.jar;D:	opbandSoftjavajdk1.8jrelibextcldrdata.jar;D:	opbandSoftjavajdk1.8jrelibextdnsns.jar;D:	opbandSoftjavajdk1.8jrelibextjaccess.jar;D:	opbandSoftjavajdk1.8jrelibextjfxrt.jar;D:	opbandSoftjavajdk1.8jrelibextlocaledata.jar;D:	opbandSoftjavajdk1.8jrelibext
    ashorn.jar;D:	opbandSoftjavajdk1.8jrelibextsunec.jar;D:	opbandSoftjavajdk1.8jrelibextsunjce_provider.jar;D:	opbandSoftjavajdk1.8jrelibextsunmscapi.jar;D:	opbandSoftjavajdk1.8jrelibextsunpkcs11.jar;D:	opbandSoftjavajdk1.8jrelibextzipfs.jar;D:	opbandSoftjavajdk1.8jrelibjavaws.jar;D:	opbandSoftjavajdk1.8jrelibjce.jar;D:	opbandSoftjavajdk1.8jrelibjfr.jar;D:	opbandSoftjavajdk1.8jrelibjfxswt.jar;D:	opbandSoftjavajdk1.8jrelibjsse.jar;D:	opbandSoftjavajdk1.8jrelibmanagement-agent.jar;D:	opbandSoftjavajdk1.8jrelibplugin.jar;D:	opbandSoftjavajdk1.8jrelib
    esources.jar;D:	opbandSoftjavajdk1.8jrelib
    t.jar;G:drawnbluespringcloud-alibabauser-service	argetclasses;G:drawnbluespringcloud-alibabacommon	argetclasses;G:drawnbluespringcloud-alibabadao	argetclasses;G:drawnbluespringcloud-alibabauser-service-api	argetclasses;G:sharp
    epoorgspringframeworkootspring-boot-starter2.1.6.RELEASEspring-boot-starter-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot2.1.6.RELEASEspring-boot-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-autoconfigure2.1.6.RELEASEspring-boot-autoconfigure-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-logging2.1.6.RELEASEspring-boot-starter-logging-2.1.6.RELEASE.jar;G:sharp
    epochqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;G:sharp
    epochqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;G:sharp
    epoorgapachelogginglog4jlog4j-to-slf4j2.11.2log4j-to-slf4j-2.11.2.jar;G:sharp
    epoorgapachelogginglog4jlog4j-api2.11.2log4j-api-2.11.2.jar;G:sharp
    epoorgslf4jjul-to-slf4j1.7.26jul-to-slf4j-1.7.26.jar;G:sharp
    epojavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;G:sharp
    epoorgspringframeworkspring-core5.1.8.RELEASEspring-core-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-jcl5.1.8.RELEASEspring-jcl-5.1.8.RELEASE.jar;G:sharp
    epoorgyamlsnakeyaml1.23snakeyaml-1.23.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-web2.1.6.RELEASEspring-boot-starter-web-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-json2.1.6.RELEASEspring-boot-starter-json-2.1.6.RELEASE.jar;G:sharp
    epocomfasterxmljacksoncorejackson-databind2.9.9jackson-databind-2.9.9.jar;G:sharp
    epocomfasterxmljacksoncorejackson-annotations2.9.0jackson-annotations-2.9.0.jar;G:sharp
    epocomfasterxmljacksoncorejackson-core2.9.9jackson-core-2.9.9.jar;G:sharp
    epocomfasterxmljacksondatatypejackson-datatype-jdk82.9.9jackson-datatype-jdk8-2.9.9.jar;G:sharp
    epocomfasterxmljacksondatatypejackson-datatype-jsr3102.9.9jackson-datatype-jsr310-2.9.9.jar;G:sharp
    epocomfasterxmljacksonmodulejackson-module-parameter-names2.9.9jackson-module-parameter-names-2.9.9.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-tomcat2.1.6.RELEASEspring-boot-starter-tomcat-2.1.6.RELEASE.jar;G:sharp
    epoorgapache	omcatembed	omcat-embed-core9.0.21	omcat-embed-core-9.0.21.jar;G:sharp
    epoorgapache	omcatembed	omcat-embed-el9.0.21	omcat-embed-el-9.0.21.jar;G:sharp
    epoorgapache	omcatembed	omcat-embed-websocket9.0.21	omcat-embed-websocket-9.0.21.jar;G:sharp
    epoorghibernatevalidatorhibernate-validator6.0.17.Finalhibernate-validator-6.0.17.Final.jar;G:sharp
    epojavaxvalidationvalidation-api2.0.1.Finalvalidation-api-2.0.1.Final.jar;G:sharp
    epoorgjbossloggingjboss-logging3.3.2.Finaljboss-logging-3.3.2.Final.jar;G:sharp
    epocomfasterxmlclassmate1.4.0classmate-1.4.0.jar;G:sharp
    epoorgspringframeworkspring-web5.1.8.RELEASEspring-web-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-webmvc5.1.8.RELEASEspring-webmvc-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-aop5.1.8.RELEASEspring-aop-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-expression5.1.8.RELEASEspring-expression-5.1.8.RELEASE.jar;G:sharp
    epoorgslf4jslf4j-api1.7.26slf4j-api-1.7.26.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-actuator2.1.6.RELEASEspring-boot-starter-actuator-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-actuator-autoconfigure2.1.6.RELEASEspring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-actuator2.1.6.RELEASEspring-boot-actuator-2.1.6.RELEASE.jar;G:sharp
    epoiomicrometermicrometer-core1.1.5micrometer-core-1.1.5.jar;G:sharp
    epoorghdrhistogramHdrHistogram2.1.9HdrHistogram-2.1.9.jar;G:sharp
    epoorglatencyutilsLatencyUtils2.0.3LatencyUtils-2.0.3.jar;G:sharp
    epocomalibabadruid1.1.18druid-1.1.18.jar;G:sharp
    epoorgspringframeworkspring-jdbc5.1.8.RELEASEspring-jdbc-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-beans5.1.8.RELEASEspring-beans-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-tx5.1.8.RELEASEspring-tx-5.1.8.RELEASE.jar;G:sharp
    epomysqlmysql-connector-java8.0.16mysql-connector-java-8.0.16.jar;G:sharp
    epoorgmybatisspringootmybatis-spring-boot-starter1.3.2mybatis-spring-boot-starter-1.3.2.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-jdbc2.1.6.RELEASEspring-boot-starter-jdbc-2.1.6.RELEASE.jar;G:sharp
    epocomzaxxerHikariCP3.2.0HikariCP-3.2.0.jar;G:sharp
    epoorgmybatisspringootmybatis-spring-boot-autoconfigure1.3.2mybatis-spring-boot-autoconfigure-1.3.2.jar;G:sharp
    epoorgmybatismybatis3.4.6mybatis-3.4.6.jar;G:sharp
    epoorgmybatismybatis-spring1.3.2mybatis-spring-1.3.2.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter-alibaba-nacos-discovery.9.0.RELEASEspring-cloud-starter-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-alibaba-nacos-discovery.9.0.RELEASEspring-cloud-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-commons2.1.1.RELEASEspring-cloud-commons-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworksecurityspring-security-crypto5.1.5.RELEASEspring-security-crypto-5.1.5.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-context2.1.1.RELEASEspring-cloud-context-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter-netflix-ribbon2.1.1.RELEASEspring-cloud-starter-netflix-ribbon-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter2.1.1.RELEASEspring-cloud-starter-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworksecurityspring-security-rsa1.0.7.RELEASEspring-security-rsa-1.0.7.RELEASE.jar;G:sharp
    epoorgouncycastlecpkix-jdk15on1.60cpkix-jdk15on-1.60.jar;G:sharp
    epoorgouncycastlecprov-jdk15on1.60cprov-jdk15on-1.60.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-netflix-ribbon2.1.1.RELEASEspring-cloud-netflix-ribbon-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-netflix-archaius2.1.1.RELEASEspring-cloud-netflix-archaius-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter-netflix-archaius2.1.1.RELEASEspring-cloud-starter-netflix-archaius-2.1.1.RELEASE.jar;G:sharp
    epocom
    etflixarchaiusarchaius-core.7.6archaius-core-0.7.6.jar;G:sharp
    epocomgooglecodefindbugsjsr3053.0.1jsr305-3.0.1.jar;G:sharp
    epocommons-configurationcommons-configuration1.8commons-configuration-1.8.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon2.3.0
    ibbon-2.3.0.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-transport2.3.0
    ibbon-transport-2.3.0.jar;G:sharp
    epoio
    eactivex
    xnetty-contexts.4.9
    xnetty-contexts-0.4.9.jar;G:sharp
    epoio
    eactivex
    xnetty-servo.4.9
    xnetty-servo-0.4.9.jar;G:sharp
    epocom
    etflixhystrixhystrix-core1.4.3hystrix-core-1.4.3.jar;G:sharp
    epojavaxinjectjavax.inject1javax.inject-1.jar;G:sharp
    epoio
    eactivex
    xnetty.4.9
    xnetty-0.4.9.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-core2.3.0
    ibbon-core-2.3.0.jar;G:sharp
    epocommons-langcommons-lang2.6commons-lang-2.6.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-httpclient2.3.0
    ibbon-httpclient-2.3.0.jar;G:sharp
    epocommons-collectionscommons-collections3.2.2commons-collections-3.2.2.jar;G:sharp
    epoorgapachehttpcomponentshttpclient4.5.9httpclient-4.5.9.jar;G:sharp
    epoorgapachehttpcomponentshttpcore4.4.11httpcore-4.4.11.jar;G:sharp
    epocomsunjerseyjersey-client1.19.1jersey-client-1.19.1.jar;G:sharp
    epocomsunjerseyjersey-core1.19.1jersey-core-1.19.1.jar;G:sharp
    epojavaxws
    sjsr311-api1.1.1jsr311-api-1.1.1.jar;G:sharp
    epocomsunjerseycontribsjersey-apache-client41.19.1jersey-apache-client4-1.19.1.jar;G:sharp
    epocom
    etflixservoservo-core.10.1servo-core-0.10.1.jar;G:sharp
    epocom
    etflixservoservo-internal.10.1servo-internal-0.10.1.jar;G:sharp
    epocom
    etflix
    etflix-commons
    etflix-commons-util.1.1
    etflix-commons-util-0.1.1.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-loadbalancer2.3.0
    ibbon-loadbalancer-2.3.0.jar;G:sharp
    epocom
    etflix
    etflix-commons
    etflix-statistics.1.1
    etflix-statistics-0.1.1.jar;G:sharp
    epoio
    eactivex
    xjava1.3.8
    xjava-1.3.8.jar;G:sharp
    epocomalibabaootdubbo-spring-boot-starter.2.0dubbo-spring-boot-starter-0.2.0.jar;G:sharp
    epoorgapachezookeeperzookeeper3.4.9zookeeper-3.4.9.jar;G:sharp
    epojlinejline.9.94jline-0.9.94.jar;G:sharp
    epoio
    etty
    etty3.10.5.Final
    etty-3.10.5.Final.jar;G:sharp
    epoorgapachecuratorcurator-framework2.12.0curator-framework-2.12.0.jar;G:sharp
    epoorgapachecuratorcurator-client2.12.0curator-client-2.12.0.jar;G:sharp
    epocomalibabaootdubbo-spring-boot-autoconfigure.2.0dubbo-spring-boot-autoconfigure-0.2.0.jar;G:sharp
    epocomalibabadubbo-registry-nacos.0.1dubbo-registry-nacos-0.0.1.jar;G:sharp
    epocomalibaba
    acos
    acos-client.6.0
    acos-client-0.6.0.jar;G:sharp
    epocomalibaba
    acos
    acos-common.6.0
    acos-common-0.6.0.jar;G:sharp
    epocommons-iocommons-io2.2commons-io-2.2.jar;G:sharp
    epoorgapachecommonscommons-lang33.8.1commons-lang3-3.8.1.jar;G:sharp
    epocomalibaba
    acos
    acos-api.6.0
    acos-api-0.6.0.jar;G:sharp
    epocomalibabafastjson1.2.47fastjson-1.2.47.jar;G:sharp
    epocomgoogleguavaguava19.0guava-19.0.jar;G:sharp
    epocommons-codeccommons-codec1.11commons-codec-1.11.jar;G:sharp
    epoorgcodehausjacksonjackson-mapper-lgpl1.9.6jackson-mapper-lgpl-1.9.6.jar;G:sharp
    epoorgcodehausjacksonjackson-core-lgpl1.9.6jackson-core-lgpl-1.9.6.jar;G:sharp
    epocomalibabadubbo2.6.5dubbo-2.6.5.jar;G:sharp
    epoorgspringframeworkspring-context5.1.8.RELEASEspring-context-5.1.8.RELEASE.jar;G:sharp
    epoorgjavassistjavassist3.20.0-GAjavassist-3.20.0-GA.jar;G:sharp
    epoorgjboss
    etty
    etty3.2.5.Final
    etty-3.2.5.Final.jar;G:sharp
    epocomalibabaspringspring-context-support1.0.2spring-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:drawnbluespringcloud-alibabauser-service	argetclassescomdrawnblueuserserviceimplNacosTestServiceImpl.class]
    17:54:26.309 [main] DEBUG com.alibaba.dubbo.config.spring.context.annotation.DubboClassPathBeanDefinitionScanner - Identified candidate component class: file [G:drawnbluespringcloud-alibabauser-service	argetclassescomdrawnblueuserserviceimplNacosTestServiceImpl.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:drawnbluespringcloud-alibabauser-service	argetclassescomdrawnblueuserserviceimplNacosTestServiceImpl.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&timestamp=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&timestamp=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&registry=nacos&timestamp=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:UsersAdministratorlogs
    Tue Jul 30 17:54:27 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Set nacos log path: C:UsersAdministratorlogs
    acos
    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&timestamp=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&timestamp=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&timestamp=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&timestamp=1564480466829&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
    DemoService provider is starting...
    View Code

    然后登陆nacos控制台查看

    点击详情查看如下:

    至此,服务注册到nacos上了,后面就可以整合spring-cloud-alibaba的其他的功能了。

    在这个过程中刚开始服务总是注册不上,最后还是看官方文档来解决了,所以做示例时,如果出现困难一定看官方文档,认真去看

    https://nacos.io/zh-cn/docs/use-nacos-with-dubbo.html

     消费端项目结构

    pom

      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      3          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4     <modelVersion>4.0.0</modelVersion>
      5     <parent>
      6         <groupId>com.drawnblue</groupId>
      7         <artifactId>pom</artifactId>
      8         <version>0.0.1-SNAPSHOT</version>
      9     </parent>
     10     <groupId>com.drawnblue</groupId>
     11     <artifactId>user</artifactId>
     12     <version>0.0.1-SNAPSHOT</version>
     13     <name>user</name>
     14     <description>Demo project for Spring Boot</description>
     15 
     16     <properties>
     17         <java.version>1.8</java.version>
     18     </properties>
     19 
     20     <dependencies>
     21         <!--local project-->
     22         <dependency>
     23             <groupId>com.drawnblue</groupId>
     24             <artifactId>common</artifactId>
     25             <version>0.0.1-SNAPSHOT</version>
     26         </dependency>
     27         <dependency>
     28             <groupId>com.drawnblue</groupId>
     29             <artifactId>user-service-api</artifactId>
     30             <version>0.0.1-SNAPSHOT</version>
     31         </dependency>
     32         <!--spingboot-->
     33         <dependency>
     34             <groupId>org.springframework.boot</groupId>
     35             <artifactId>spring-boot-starter</artifactId>
     36         </dependency>
     37         <dependency>
     38             <groupId>org.springframework.boot</groupId>
     39             <artifactId>spring-boot-starter-web</artifactId>
     40         </dependency>
     41         <dependency>
     42             <groupId>org.springframework.boot</groupId>
     43             <artifactId>spring-boot-starter-test</artifactId>
     44             <scope>test</scope>
     45         </dependency>
     46         <dependency>
     47             <groupId>org.springframework.boot</groupId>
     48             <artifactId>spring-boot-starter-actuator</artifactId>
     49         </dependency>
     50         <!--nacos config-->
     51         <dependency>
     52             <groupId>org.springframework.cloud</groupId>
     53             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
     54             <version>0.9.0.RELEASE</version>
     55         </dependency>
     56         <!--        <dependency>
     57                     <groupId>com.alibaba.boot</groupId>
     58                     <artifactId>nacos-config-spring-boot-actuator</artifactId>
     59                     <version>0.2.2</version>
     60                 </dependency>-->
     61         <!--以下配置dubbo############################################################################## -->
     62         <!--dubbo config-->
     63         <dependency>
     64             <groupId>com.alibaba.boot</groupId>
     65             <artifactId>dubbo-spring-boot-starter</artifactId>
     66             <version>0.2.0</version>
     67             <exclusions>
     68                 <exclusion>
     69                     <groupId>com.alibaba</groupId>
     70                     <artifactId>dubbo</artifactId>
     71                 </exclusion>
     72             </exclusions>
     73         </dependency>
     74         <dependency>
     75             <groupId>com.alibaba</groupId>
     76             <artifactId>dubbo-registry-nacos</artifactId>
     77             <version>0.0.1</version>
     78         </dependency>
     79         <dependency>
     80             <groupId>com.alibaba</groupId>
     81             <artifactId>dubbo</artifactId>
     82             <version>2.6.5</version>
     83         </dependency>
     84         <!--        <dependency>
     85                     <groupId>com.alibaba.nacos</groupId>
     86                     <artifactId>nacos-client</artifactId>
     87                     <version>0.6.2</version>
     88                 </dependency>-->
     89         <dependency>
     90             <groupId>com.alibaba.spring</groupId>
     91             <artifactId>spring-context-support</artifactId>
     92             <version>1.0.2</version>
     93         </dependency>
     94     </dependencies>
     95     <build>
     96         <plugins>
     97             <plugin>
     98                 <groupId>org.springframework.boot</groupId>
     99                 <artifactId>spring-boot-maven-plugin</artifactId>
    100             </plugin>
    101         </plugins>
    102     </build>
    103 
    104 </project>
    View Code

    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
    View Code

    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

    改造启动类

     1 package com.drawnblue.user;
     2 
     3 import com.alibaba.dubbo.config.annotation.Reference;
     4 import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;
     5 import com.drawnblue.userservice.NacosTestService;
     6 import org.springframework.boot.SpringApplication;
     7 import org.springframework.boot.autoconfigure.SpringBootApplication;
     8 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
     9 import org.springframework.context.annotation.PropertySource;
    10 
    11 import javax.annotation.PostConstruct;
    12 import java.io.IOException;
    13 
    14 //@SpringBootApplication
    15 @EnableDubbo
    16 @PropertySource(value = "classpath:/consumer-config.properties")
    17 public class UserApplication {
    18         @Reference(version = "${demo.service.version}")
    19         private NacosTestService testService;
    20 
    21         @PostConstruct
    22         public void init() {
    23             for (int i = 0; i < 10; i++) {
    24                 System.out.println(testService.sayName("小马哥(mercyblitz)"));
    25             }
    26         }
    27 
    28         public static void main(String[] args) throws IOException{
    29 //            SpringApplication.run(UserApplication.class, args);
    30             AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    31             context.register(UserApplication.class);
    32             context.refresh();
    33             context.close();
    34         }
    35 }

    启动

      1 D:	opbandSoftjavajdk1.8injava.exe "-javaagent:D:IDEAIntelliJ IDEA 2018.2.4libidea_rt.jar=56456:D:IDEAIntelliJ IDEA 2018.2.4in" -Dfile.encoding=UTF-8 -classpath D:	opbandSoftjavajdk1.8jrelibcharsets.jar;D:	opbandSoftjavajdk1.8jrelibdeploy.jar;D:	opbandSoftjavajdk1.8jrelibextaccess-bridge-64.jar;D:	opbandSoftjavajdk1.8jrelibextcldrdata.jar;D:	opbandSoftjavajdk1.8jrelibextdnsns.jar;D:	opbandSoftjavajdk1.8jrelibextjaccess.jar;D:	opbandSoftjavajdk1.8jrelibextjfxrt.jar;D:	opbandSoftjavajdk1.8jrelibextlocaledata.jar;D:	opbandSoftjavajdk1.8jrelibext
    ashorn.jar;D:	opbandSoftjavajdk1.8jrelibextsunec.jar;D:	opbandSoftjavajdk1.8jrelibextsunjce_provider.jar;D:	opbandSoftjavajdk1.8jrelibextsunmscapi.jar;D:	opbandSoftjavajdk1.8jrelibextsunpkcs11.jar;D:	opbandSoftjavajdk1.8jrelibextzipfs.jar;D:	opbandSoftjavajdk1.8jrelibjavaws.jar;D:	opbandSoftjavajdk1.8jrelibjce.jar;D:	opbandSoftjavajdk1.8jrelibjfr.jar;D:	opbandSoftjavajdk1.8jrelibjfxswt.jar;D:	opbandSoftjavajdk1.8jrelibjsse.jar;D:	opbandSoftjavajdk1.8jrelibmanagement-agent.jar;D:	opbandSoftjavajdk1.8jrelibplugin.jar;D:	opbandSoftjavajdk1.8jrelib
    esources.jar;D:	opbandSoftjavajdk1.8jrelib
    t.jar;G:drawnbluespringcloud-alibabauser	argetclasses;G:drawnbluespringcloud-alibabacommon	argetclasses;G:drawnbluespringcloud-alibabauser-service-api	argetclasses;G:sharp
    epoorgspringframeworkootspring-boot-starter2.1.6.RELEASEspring-boot-starter-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot2.1.6.RELEASEspring-boot-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-autoconfigure2.1.6.RELEASEspring-boot-autoconfigure-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-logging2.1.6.RELEASEspring-boot-starter-logging-2.1.6.RELEASE.jar;G:sharp
    epochqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;G:sharp
    epochqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;G:sharp
    epoorgapachelogginglog4jlog4j-to-slf4j2.11.2log4j-to-slf4j-2.11.2.jar;G:sharp
    epoorgapachelogginglog4jlog4j-api2.11.2log4j-api-2.11.2.jar;G:sharp
    epoorgslf4jjul-to-slf4j1.7.26jul-to-slf4j-1.7.26.jar;G:sharp
    epojavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;G:sharp
    epoorgspringframeworkspring-core5.1.8.RELEASEspring-core-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-jcl5.1.8.RELEASEspring-jcl-5.1.8.RELEASE.jar;G:sharp
    epoorgyamlsnakeyaml1.23snakeyaml-1.23.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-web2.1.6.RELEASEspring-boot-starter-web-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-json2.1.6.RELEASEspring-boot-starter-json-2.1.6.RELEASE.jar;G:sharp
    epocomfasterxmljacksoncorejackson-databind2.9.9jackson-databind-2.9.9.jar;G:sharp
    epocomfasterxmljacksoncorejackson-annotations2.9.0jackson-annotations-2.9.0.jar;G:sharp
    epocomfasterxmljacksoncorejackson-core2.9.9jackson-core-2.9.9.jar;G:sharp
    epocomfasterxmljacksondatatypejackson-datatype-jdk82.9.9jackson-datatype-jdk8-2.9.9.jar;G:sharp
    epocomfasterxmljacksondatatypejackson-datatype-jsr3102.9.9jackson-datatype-jsr310-2.9.9.jar;G:sharp
    epocomfasterxmljacksonmodulejackson-module-parameter-names2.9.9jackson-module-parameter-names-2.9.9.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-tomcat2.1.6.RELEASEspring-boot-starter-tomcat-2.1.6.RELEASE.jar;G:sharp
    epoorgapache	omcatembed	omcat-embed-core9.0.21	omcat-embed-core-9.0.21.jar;G:sharp
    epoorgapache	omcatembed	omcat-embed-el9.0.21	omcat-embed-el-9.0.21.jar;G:sharp
    epoorgapache	omcatembed	omcat-embed-websocket9.0.21	omcat-embed-websocket-9.0.21.jar;G:sharp
    epoorghibernatevalidatorhibernate-validator6.0.17.Finalhibernate-validator-6.0.17.Final.jar;G:sharp
    epojavaxvalidationvalidation-api2.0.1.Finalvalidation-api-2.0.1.Final.jar;G:sharp
    epoorgjbossloggingjboss-logging3.3.2.Finaljboss-logging-3.3.2.Final.jar;G:sharp
    epocomfasterxmlclassmate1.4.0classmate-1.4.0.jar;G:sharp
    epoorgspringframeworkspring-web5.1.8.RELEASEspring-web-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-beans5.1.8.RELEASEspring-beans-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-webmvc5.1.8.RELEASEspring-webmvc-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-aop5.1.8.RELEASEspring-aop-5.1.8.RELEASE.jar;G:sharp
    epoorgspringframeworkspring-expression5.1.8.RELEASEspring-expression-5.1.8.RELEASE.jar;G:sharp
    epoorgslf4jslf4j-api1.7.26slf4j-api-1.7.26.jar;G:sharp
    epoorgspringframeworkootspring-boot-starter-actuator2.1.6.RELEASEspring-boot-starter-actuator-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-actuator-autoconfigure2.1.6.RELEASEspring-boot-actuator-autoconfigure-2.1.6.RELEASE.jar;G:sharp
    epoorgspringframeworkootspring-boot-actuator2.1.6.RELEASEspring-boot-actuator-2.1.6.RELEASE.jar;G:sharp
    epoiomicrometermicrometer-core1.1.5micrometer-core-1.1.5.jar;G:sharp
    epoorghdrhistogramHdrHistogram2.1.9HdrHistogram-2.1.9.jar;G:sharp
    epoorglatencyutilsLatencyUtils2.0.3LatencyUtils-2.0.3.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter-alibaba-nacos-discovery.9.0.RELEASEspring-cloud-starter-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-alibaba-nacos-discovery.9.0.RELEASEspring-cloud-alibaba-nacos-discovery-0.9.0.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-commons2.1.1.RELEASEspring-cloud-commons-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworksecurityspring-security-crypto5.1.5.RELEASEspring-security-crypto-5.1.5.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-context2.1.1.RELEASEspring-cloud-context-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter-netflix-ribbon2.1.1.RELEASEspring-cloud-starter-netflix-ribbon-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter2.1.1.RELEASEspring-cloud-starter-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworksecurityspring-security-rsa1.0.7.RELEASEspring-security-rsa-1.0.7.RELEASE.jar;G:sharp
    epoorgouncycastlecpkix-jdk15on1.60cpkix-jdk15on-1.60.jar;G:sharp
    epoorgouncycastlecprov-jdk15on1.60cprov-jdk15on-1.60.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-netflix-ribbon2.1.1.RELEASEspring-cloud-netflix-ribbon-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-netflix-archaius2.1.1.RELEASEspring-cloud-netflix-archaius-2.1.1.RELEASE.jar;G:sharp
    epoorgspringframeworkcloudspring-cloud-starter-netflix-archaius2.1.1.RELEASEspring-cloud-starter-netflix-archaius-2.1.1.RELEASE.jar;G:sharp
    epocom
    etflixarchaiusarchaius-core.7.6archaius-core-0.7.6.jar;G:sharp
    epocomgooglecodefindbugsjsr3053.0.1jsr305-3.0.1.jar;G:sharp
    epocommons-configurationcommons-configuration1.8commons-configuration-1.8.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon2.3.0
    ibbon-2.3.0.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-transport2.3.0
    ibbon-transport-2.3.0.jar;G:sharp
    epoio
    eactivex
    xnetty-contexts.4.9
    xnetty-contexts-0.4.9.jar;G:sharp
    epoio
    eactivex
    xnetty-servo.4.9
    xnetty-servo-0.4.9.jar;G:sharp
    epocom
    etflixhystrixhystrix-core1.4.3hystrix-core-1.4.3.jar;G:sharp
    epojavaxinjectjavax.inject1javax.inject-1.jar;G:sharp
    epoio
    eactivex
    xnetty.4.9
    xnetty-0.4.9.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-core2.3.0
    ibbon-core-2.3.0.jar;G:sharp
    epocommons-langcommons-lang2.6commons-lang-2.6.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-httpclient2.3.0
    ibbon-httpclient-2.3.0.jar;G:sharp
    epocommons-collectionscommons-collections3.2.2commons-collections-3.2.2.jar;G:sharp
    epoorgapachehttpcomponentshttpclient4.5.9httpclient-4.5.9.jar;G:sharp
    epoorgapachehttpcomponentshttpcore4.4.11httpcore-4.4.11.jar;G:sharp
    epocomsunjerseyjersey-client1.19.1jersey-client-1.19.1.jar;G:sharp
    epocomsunjerseyjersey-core1.19.1jersey-core-1.19.1.jar;G:sharp
    epojavaxws
    sjsr311-api1.1.1jsr311-api-1.1.1.jar;G:sharp
    epocomsunjerseycontribsjersey-apache-client41.19.1jersey-apache-client4-1.19.1.jar;G:sharp
    epocom
    etflixservoservo-core.10.1servo-core-0.10.1.jar;G:sharp
    epocom
    etflixservoservo-internal.10.1servo-internal-0.10.1.jar;G:sharp
    epocom
    etflix
    etflix-commons
    etflix-commons-util.1.1
    etflix-commons-util-0.1.1.jar;G:sharp
    epocom
    etflix
    ibbon
    ibbon-loadbalancer2.3.0
    ibbon-loadbalancer-2.3.0.jar;G:sharp
    epocom
    etflix
    etflix-commons
    etflix-statistics.1.1
    etflix-statistics-0.1.1.jar;G:sharp
    epoio
    eactivex
    xjava1.3.8
    xjava-1.3.8.jar;G:sharp
    epocomalibabaootdubbo-spring-boot-starter.2.0dubbo-spring-boot-starter-0.2.0.jar;G:sharp
    epoorgapachezookeeperzookeeper3.4.9zookeeper-3.4.9.jar;G:sharp
    epojlinejline.9.94jline-0.9.94.jar;G:sharp
    epoio
    etty
    etty3.10.5.Final
    etty-3.10.5.Final.jar;G:sharp
    epoorgapachecuratorcurator-framework2.12.0curator-framework-2.12.0.jar;G:sharp
    epoorgapachecuratorcurator-client2.12.0curator-client-2.12.0.jar;G:sharp
    epocomalibabaootdubbo-spring-boot-autoconfigure.2.0dubbo-spring-boot-autoconfigure-0.2.0.jar;G:sharp
    epocomalibabadubbo-registry-nacos.0.1dubbo-registry-nacos-0.0.1.jar;G:sharp
    epocomalibaba
    acos
    acos-client.6.0
    acos-client-0.6.0.jar;G:sharp
    epocomalibaba
    acos
    acos-common.6.0
    acos-common-0.6.0.jar;G:sharp
    epocommons-iocommons-io2.2commons-io-2.2.jar;G:sharp
    epoorgapachecommonscommons-lang33.8.1commons-lang3-3.8.1.jar;G:sharp
    epocomalibaba
    acos
    acos-api.6.0
    acos-api-0.6.0.jar;G:sharp
    epocomalibabafastjson1.2.47fastjson-1.2.47.jar;G:sharp
    epocomgoogleguavaguava19.0guava-19.0.jar;G:sharp
    epocommons-codeccommons-codec1.11commons-codec-1.11.jar;G:sharp
    epoorgcodehausjacksonjackson-mapper-lgpl1.9.6jackson-mapper-lgpl-1.9.6.jar;G:sharp
    epoorgcodehausjacksonjackson-core-lgpl1.9.6jackson-core-lgpl-1.9.6.jar;G:sharp
    epocomalibabadubbo2.6.5dubbo-2.6.5.jar;G:sharp
    epoorgspringframeworkspring-context5.1.8.RELEASEspring-context-5.1.8.RELEASE.jar;G:sharp
    epoorgjavassistjavassist3.20.0-GAjavassist-3.20.0-GA.jar;G:sharp
    epoorgjboss
    etty
    etty3.2.5.Final
    etty-3.2.5.Final.jar;G:sharp
    epocomalibabaspringspring-context-support1.0.2spring-context-support-1.0.2.jar com.drawnblue.user.UserApplication
      2 09:36:00.241 [main] DEBUG org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4f4a7090
      3 09:36:00.260 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
      4 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.
      5 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.
      6 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]
      7 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.
      8 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.
      9 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.
     10 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.
     11 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]
     12 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]
     13 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]
     14 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'
     15 09:36:00.431 [main] INFO com.alibaba.dubbo.common.logger.LoggerFactory - using logger: com.alibaba.dubbo.common.logger.slf4j.Slf4jLoggerAdapter
     16 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
     17 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
     18 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
     19 09:36:00.473 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
     20 09:36:00.475 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
     21 09:36:00.477 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
     22 09:36:00.478 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
     23 09:36:00.481 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'referenceAnnotationBeanPostProcessor'
     24 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'
     25 09:36:00.512 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
     26 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'
     27 09:36:00.514 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
     28 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'
     29 09:36:00.514 [main] DEBUG com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor - DubboConfigBinder Bean can't be found in ApplicationContext.
     30 09:36:00.521 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userApplication'
     31 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
     32 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
     33 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
     34 09:36:00.642 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.rpc;
     35 import com.alibaba.dubbo.common.extension.ExtensionLoader;
     36 public class Protocol$Adaptive implements com.alibaba.dubbo.rpc.Protocol {
     37 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!");
     38 }
     39 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!");
     40 }
     41 public com.alibaba.dubbo.rpc.Exporter export(com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException {
     42 if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
     43 if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
     44 String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
     45 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])");
     46 com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
     47 return extension.export(arg0);
     48 }
     49 public com.alibaba.dubbo.rpc.Invoker refer(java.lang.Class arg0, com.alibaba.dubbo.common.URL arg1) throws com.alibaba.dubbo.rpc.RpcException {
     50 if (arg1 == null) throw new IllegalArgumentException("url == null");
     51 com.alibaba.dubbo.common.URL url = arg1;
     52 String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
     53 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.Protocol) name from url(" + url.toString() + ") use keys([protocol])");
     54 com.alibaba.dubbo.rpc.Protocol extension = (com.alibaba.dubbo.rpc.Protocol)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.Protocol.class).getExtension(extName);
     55 return extension.refer(arg0, arg1);
     56 }
     57 }, dubbo version: 2.6.5, current host: 192.168.26.30
     58 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
     59 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
     60 09:36:00.767 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.rpc.cluster;
     61 import com.alibaba.dubbo.common.extension.ExtensionLoader;
     62 public class Cluster$Adaptive implements com.alibaba.dubbo.rpc.cluster.Cluster {
     63 public com.alibaba.dubbo.rpc.Invoker join(com.alibaba.dubbo.rpc.cluster.Directory arg0) throws com.alibaba.dubbo.rpc.RpcException {
     64 if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directory argument == null");
     65 if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.cluster.Directory argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
     66 String extName = url.getParameter("cluster", "failover");
     67 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.Cluster) name from url(" + url.toString() + ") use keys([cluster])");
     68 com.alibaba.dubbo.rpc.cluster.Cluster extension = (com.alibaba.dubbo.rpc.cluster.Cluster)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.Cluster.class).getExtension(extName);
     69 return extension.join(arg0);
     70 }
     71 }, dubbo version: 2.6.5, current host: 192.168.26.30
     72 09:36:00.791 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.rpc;
     73 import com.alibaba.dubbo.common.extension.ExtensionLoader;
     74 public class ProxyFactory$Adaptive implements com.alibaba.dubbo.rpc.ProxyFactory {
     75 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 {
     76 if (arg2 == null) throw new IllegalArgumentException("url == null");
     77 com.alibaba.dubbo.common.URL url = arg2;
     78 String extName = url.getParameter("proxy", "javassist");
     79 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
     80 com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
     81 return extension.getInvoker(arg0, arg1, arg2);
     82 }
     83 public java.lang.Object getProxy(com.alibaba.dubbo.rpc.Invoker arg0, boolean arg1) throws com.alibaba.dubbo.rpc.RpcException {
     84 if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
     85 if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
     86 String extName = url.getParameter("proxy", "javassist");
     87 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
     88 com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
     89 return extension.getProxy(arg0, arg1);
     90 }
     91 public java.lang.Object getProxy(com.alibaba.dubbo.rpc.Invoker arg0) throws com.alibaba.dubbo.rpc.RpcException {
     92 if (arg0 == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument == null");
     93 if (arg0.getUrl() == null) throw new IllegalArgumentException("com.alibaba.dubbo.rpc.Invoker argument getUrl() == null");com.alibaba.dubbo.common.URL url = arg0.getUrl();
     94 String extName = url.getParameter("proxy", "javassist");
     95 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.ProxyFactory) name from url(" + url.toString() + ") use keys([proxy])");
     96 com.alibaba.dubbo.rpc.ProxyFactory extension = (com.alibaba.dubbo.rpc.ProxyFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.ProxyFactory.class).getExtension(extName);
     97 return extension.getProxy(arg0);
     98 }
     99 }, dubbo version: 2.6.5, current host: 192.168.26.30
    100 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
    101 09:36:00.837 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.ApplicationConfig#0'
    102 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
    103 09:36:00.842 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.RegistryConfig#0'
    104 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
    105 09:36:00.850 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceBeanBuilder - The bean[type:ReferenceBean] has been built.
    106 09:36:00.893 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.registry;
    107 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    108 public class RegistryFactory$Adaptive implements com.alibaba.dubbo.registry.RegistryFactory {
    109 public com.alibaba.dubbo.registry.Registry getRegistry(com.alibaba.dubbo.common.URL arg0) {
    110 if (arg0 == null) throw new IllegalArgumentException("url == null");
    111 com.alibaba.dubbo.common.URL url = arg0;
    112 String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
    113 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.registry.RegistryFactory) name from url(" + url.toString() + ") use keys([protocol])");
    114 com.alibaba.dubbo.registry.RegistryFactory extension = (com.alibaba.dubbo.registry.RegistryFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.registry.RegistryFactory.class).getExtension(extName);
    115 return extension.getRegistry(arg0);
    116 }
    117 }, dubbo version: 2.6.5, current host: 192.168.26.30
    118 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
    119 java.lang.NoClassDefFoundError: io/netty/channel/EventLoopGroup
    120     at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.startQosServer(QosProtocolWrapper.java:95)
    121     at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:68)
    122     at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:106)
    123     at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
    124     at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394)
    125     at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333)
    126     at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163)
    127     at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.init(ReferenceAnnotationBeanPostProcessor.java:163)
    128     at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.access$100(ReferenceAnnotationBeanPostProcessor.java:147)
    129     at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildInvocationHandler(ReferenceAnnotationBeanPostProcessor.java:141)
    130     at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.buildProxy(ReferenceAnnotationBeanPostProcessor.java:123)
    131     at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:117)
    132     at com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor.doGetInjectedBean(ReferenceAnnotationBeanPostProcessor.java:50)
    133     at com.alibaba.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.getInjectedObject(AnnotationInjectedBeanPostProcessor.java:340)
    134     at com.alibaba.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor$AnnotatedFieldElement.inject(AnnotationInjectedBeanPostProcessor.java:520)
    135     at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
    136     at com.alibaba.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:128)
    137     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1416)
    138     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
    139     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
    140     at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
    141     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    142     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
    143     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    144     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
    145     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
    146     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
    147     at com.drawnblue.user.UserApplication.main(UserApplication.java:32)
    148 Caused by: java.lang.ClassNotFoundException: io.netty.channel.EventLoopGroup
    149     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    150     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    151     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
    152     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    153     ... 28 common frames omitted
    154 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
    155 Wed Jul 31 09:36:00 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Log root path: C:UsersAdministratorlogs
    156 Wed Jul 31 09:36:00 CST 2019 sun.misc.Launcher$AppClassLoader@18b4aac2 JM.Log:INFO Set nacos log path: C:UsersAdministratorlogs
    acos
    157 09:36:01.083 [main] INFO com.alibaba.dubbo.registry.nacos.NacosRegistry -  [DUBBO] Load registry store file C:UsersAdministrator.dubbodubbo-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&timestamp=1564533362655&version=1.0.0}, dubbo version: 2.6.5, current host: 192.168.26.30
    158 09:36:01.089 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.rpc.cluster;
    159 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    160 public class RouterFactory$Adaptive implements com.alibaba.dubbo.rpc.cluster.RouterFactory {
    161 public com.alibaba.dubbo.rpc.cluster.Router getRouter(com.alibaba.dubbo.common.URL arg0) {
    162 if (arg0 == null) throw new IllegalArgumentException("url == null");
    163 com.alibaba.dubbo.common.URL url = arg0;
    164 String extName = url.getProtocol();
    165 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.RouterFactory) name from url(" + url.toString() + ") use keys([protocol])");
    166 com.alibaba.dubbo.rpc.cluster.RouterFactory extension = (com.alibaba.dubbo.rpc.cluster.RouterFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.RouterFactory.class).getExtension(extName);
    167 return extension.getRouter(arg0);
    168 }
    169 }, dubbo version: 2.6.5, current host: 192.168.26.30
    170 09:36:01.132 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.rpc.cluster;
    171 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    172 public class ConfiguratorFactory$Adaptive implements com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory {
    173 public com.alibaba.dubbo.rpc.cluster.Configurator getConfigurator(com.alibaba.dubbo.common.URL arg0) {
    174 if (arg0 == null) throw new IllegalArgumentException("url == null");
    175 com.alibaba.dubbo.common.URL url = arg0;
    176 String extName = url.getProtocol();
    177 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory) name from url(" + url.toString() + ") use keys([protocol])");
    178 com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory extension = (com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory.class).getExtension(extName);
    179 return extension.getConfigurator(arg0);
    180 }
    181 }, dubbo version: 2.6.5, current host: 192.168.26.30
    182 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&timestamp=1564536960855&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
    183 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&timestamp=1564536960855&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
    184 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&timestamp=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&timestamp=1564533362655&version=1.0.0], dubbo version: 2.6.5, current host: 192.168.26.30
    185 09:36:01.516 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.remoting;
    186 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    187 public class Transporter$Adaptive implements com.alibaba.dubbo.remoting.Transporter {
    188 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 {
    189 if (arg0 == null) throw new IllegalArgumentException("url == null");
    190 com.alibaba.dubbo.common.URL url = arg0;
    191 String extName = url.getParameter("client", url.getParameter("transporter", "netty"));
    192 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString() + ") use keys([client, transporter])");
    193 com.alibaba.dubbo.remoting.Transporter extension = (com.alibaba.dubbo.remoting.Transporter)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Transporter.class).getExtension(extName);
    194 return extension.connect(arg0, arg1);
    195 }
    196 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 {
    197 if (arg0 == null) throw new IllegalArgumentException("url == null");
    198 com.alibaba.dubbo.common.URL url = arg0;
    199 String extName = url.getParameter("server", url.getParameter("transporter", "netty"));
    200 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.remoting.Transporter) name from url(" + url.toString() + ") use keys([server, transporter])");
    201 com.alibaba.dubbo.remoting.Transporter extension = (com.alibaba.dubbo.remoting.Transporter)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Transporter.class).getExtension(extName);
    202 return extension.bind(arg0, arg1);
    203 }
    204 }, dubbo version: 2.6.5, current host: 192.168.26.30
    205 09:36:01.584 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.remoting;
    206 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    207 public class Dispatcher$Adaptive implements com.alibaba.dubbo.remoting.Dispatcher {
    208 public com.alibaba.dubbo.remoting.ChannelHandler dispatch(com.alibaba.dubbo.remoting.ChannelHandler arg0, com.alibaba.dubbo.common.URL arg1) {
    209 if (arg1 == null) throw new IllegalArgumentException("url == null");
    210 com.alibaba.dubbo.common.URL url = arg1;
    211 String extName = url.getParameter("dispatcher", url.getParameter("dispather", url.getParameter("channel.handler", "all")));
    212 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])");
    213 com.alibaba.dubbo.remoting.Dispatcher extension = (com.alibaba.dubbo.remoting.Dispatcher)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.remoting.Dispatcher.class).getExtension(extName);
    214 return extension.dispatch(arg0, arg1);
    215 }
    216 }, dubbo version: 2.6.5, current host: 192.168.26.30
    217 09:36:01.592 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.common.threadpool;
    218 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    219 public class ThreadPool$Adaptive implements com.alibaba.dubbo.common.threadpool.ThreadPool {
    220 public java.util.concurrent.Executor getExecutor(com.alibaba.dubbo.common.URL arg0) {
    221 if (arg0 == null) throw new IllegalArgumentException("url == null");
    222 com.alibaba.dubbo.common.URL url = arg0;
    223 String extName = url.getParameter("threadpool", "fixed");
    224 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.common.threadpool.ThreadPool) name from url(" + url.toString() + ") use keys([threadpool])");
    225 com.alibaba.dubbo.common.threadpool.ThreadPool extension = (com.alibaba.dubbo.common.threadpool.ThreadPool)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.common.threadpool.ThreadPool.class).getExtension(extName);
    226 return extension.getExecutor(arg0);
    227 }
    228 }, dubbo version: 2.6.5, current host: 192.168.26.30
    229 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
    230 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
    231 09:36:01.656 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.cache;
    232 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    233 public class CacheFactory$Adaptive implements com.alibaba.dubbo.cache.CacheFactory {
    234 public com.alibaba.dubbo.cache.Cache getCache(com.alibaba.dubbo.common.URL arg0, com.alibaba.dubbo.rpc.Invocation arg1) {
    235 if (arg0 == null) throw new IllegalArgumentException("url == null");
    236 com.alibaba.dubbo.common.URL url = arg0;
    237 if (arg1 == null) throw new IllegalArgumentException("invocation == null");
    238 String methodName = arg1.getMethodName();
    239 String extName = url.getMethodParameter(methodName, "cache", "lru");
    240 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.cache.CacheFactory) name from url(" + url.toString() + ") use keys([cache])");
    241 com.alibaba.dubbo.cache.CacheFactory extension = (com.alibaba.dubbo.cache.CacheFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.cache.CacheFactory.class).getExtension(extName);
    242 return extension.getCache(arg0, arg1);
    243 }
    244 }, dubbo version: 2.6.5, current host: 192.168.26.30
    245 09:36:01.665 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.monitor;
    246 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    247 public class MonitorFactory$Adaptive implements com.alibaba.dubbo.monitor.MonitorFactory {
    248 public com.alibaba.dubbo.monitor.Monitor getMonitor(com.alibaba.dubbo.common.URL arg0) {
    249 if (arg0 == null) throw new IllegalArgumentException("url == null");
    250 com.alibaba.dubbo.common.URL url = arg0;
    251 String extName = ( url.getProtocol() == null ? "dubbo" : url.getProtocol() );
    252 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.monitor.MonitorFactory) name from url(" + url.toString() + ") use keys([protocol])");
    253 com.alibaba.dubbo.monitor.MonitorFactory extension = (com.alibaba.dubbo.monitor.MonitorFactory)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.monitor.MonitorFactory.class).getExtension(extName);
    254 return extension.getMonitor(arg0);
    255 }
    256 }, dubbo version: 2.6.5, current host: 192.168.26.30
    257 09:36:01.673 [main] DEBUG com.alibaba.dubbo.common.extension.ExtensionLoader -  [DUBBO] package com.alibaba.dubbo.validation;
    258 import com.alibaba.dubbo.common.extension.ExtensionLoader;
    259 public class Validation$Adaptive implements com.alibaba.dubbo.validation.Validation {
    260 public com.alibaba.dubbo.validation.Validator getValidator(com.alibaba.dubbo.common.URL arg0) {
    261 if (arg0 == null) throw new IllegalArgumentException("url == null");
    262 com.alibaba.dubbo.common.URL url = arg0;
    263 String extName = url.getParameter("validation", "jvalidation");
    264 if(extName == null) throw new IllegalStateException("Fail to get extension(com.alibaba.dubbo.validation.Validation) name from url(" + url.toString() + ") use keys([validation])");
    265 com.alibaba.dubbo.validation.Validation extension = (com.alibaba.dubbo.validation.Validation)ExtensionLoader.getExtensionLoader(com.alibaba.dubbo.validation.Validation.class).getExtension(extName);
    266 return extension.getValidator(arg0);
    267 }
    268 }, dubbo version: 2.6.5, current host: 192.168.26.30
    269 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&register.ip=192.168.26.30&remote.timestamp=1564533362655&revision=1.0.0&side=consumer&timestamp=1564536960855&version=1.0.0, dubbo version: 2.6.5, current host: 192.168.26.30
    270 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
    271 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    272 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&timestamp=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&timestamp=1564533362655&version=1.0.0], dubbo version: 2.6.5, current host: 192.168.26.30
    273 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
    274 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    275 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
    276 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    277 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
    278 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    279 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
    280 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    281 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
    282 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    283 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
    284 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    285 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
    286 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    287 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
    288 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    289 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
    290 Service [name :demoService , port : 20880] sayName("小马哥(mercyblitz)") : Hello,小马哥(mercyblitz)
    291 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'
    292 09:36:01.817 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.dubbo.config.ProtocolConfig#0'
    293 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
    294 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
    295 09:36:01.844 [main] INFO com.alibaba.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor - com.alibaba.dubbo.common.bytecode.proxy0@79c7532f was destroying!
    296 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!
    View Code

    详情

    该整合存在如下问题:

    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"/>

  • 相关阅读:
    由于媒体16摘要天
    vim note (2)
    JEECG 什么是商业版本的功能最近添加的好友?
    图解linux启动过程
    Error: unrecognized flag -version
    基于RDP瘦客户机协议的简要说明
    Android在网络上分析获取图片(支持bmp格式)
    [React] Validate Custom React Component Props with PropTypes
    [Python] Wikipedia Crawler
    [Python] Python list slice syntax fun
  • 原文地址:https://www.cnblogs.com/xiaoyao-001/p/11271583.html
Copyright © 2011-2022 走看看