我尝试将Spring Boot应用程序连接到Cloud配置服务器。我有' bootstrap.properties'中定义的云配置服务器的名称。文件
spring.application.name=eis-account
spring.profiles.active=default
spring.cloud.config,uri=http://localhost:8001
...但是在启动Spring Boot应用程序时,它只是忽略了这一点并寻找
017-12-02 17:06:22.070 INFO 6516 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888
2017-12-02 17:06:23.187 WARN 6516 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/eis-account/default": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
2017-12-02 17:06:23.189 INFO 6516 --- [ main] com.eis.account.EisAccountApplication : The following profiles are active: default
2017-12-02 17:06:23.211 INFO 6516 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@2c1156a7: startup date [Sat Dec 02 17:06:23 GMT 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@7880cdf3
2017-12-02 17:06:24.001 INFO 6516 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=cf9b218d-4afe-3a28-b0b8-7c49b6339bdf
2017-12-02 17:06:24.135 INFO 6516 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$7f6e4cf3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
201
我的pom文件如下所示。有什么想法吗?
http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0
<groupId>com.eis.account</groupId>
<artifactId>eis-account</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>eis-account</name>
<description>EIS Account micro service</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
答案 0 :(得分:-1)
更改
spring.cloud.config,uri=http://localhost:8001
为
spring.cloud.config.uri=http://localhost:8001
(DOT是您的错误)