问题:springboot 1.5.9 + nacos 服务注册中心与配置中心 兼容配置
org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'nacosAutoServiceRegistration' defined in classpath resource[org/springframework/cloud/alibaba/nacos/NacosDiscoveryAutoConfiguration.class]:Bean instantiation via factory method failed; nested exception isorg.springframework.beans.BeanInstantiationException: Failed to instantiate[org.springframework.cloud.alibaba.nacos.registry.NacosAutoServiceRegistration]:Factory method 'nacosAutoServiceRegistration' threw exception; nested exceptionis java.lang.NoSuchMethodError:org.springframework.cloud.client.serviceregistry.AbstractAutoServiceRegistration.(Lorg/springframework/cloud/client/serviceregistry/ServiceRegistry;Lorg/springframework/cloud/client/serviceregistry/AutoServiceRegistrationProperties;)V
解决方案:将spring-cloud-commons版本升级
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>1.5.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>1.5.0.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
<version>1.3.5.RELEASE</version>
</dependency>