2016-05-31 204 views
1

我有三個應用程序,一個是spring-cloud-config服務器點,另一個是spring-cloud-config客戶端點。我在對方配置彈簧雲總線,使我的客戶點自動刷新改變,但在我的應用程序運行時,我得到了像問題spring-cloud-config和spring-cloud-bus

c.netflix.discovery.TimedSupervisorTask : task supervisor rejected the task 

java.util.concurrent.RejectedExecutionException: Task [email protected] rejected from [email protected][Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] 
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047) ~[na:1.8.0_92] 
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823) [na:1.8.0_92] 
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369) [na:1.8.0_92] 
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) ~[na:1.8.0_92] 
    at com.netflix.discovery.TimedSupervisorTask.run(TimedSupervisorTask.java:62) ~[eureka-client-1.4.6.jar:1.4.6] 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_92] 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_92] 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_92] 
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_92] 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_92] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_92] 
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92] 

一個例外,這是我的春天,雲服務器配置

#git config 
spring.cloud.config.server.git.uri = ### 
spring.cloud.config.server.git.username=### 
spring.cloud.config.server.git.password=### 
spring.cloud.config.server.git.search-paths = puhui-cloud-config-client 

#spring.active.profile 
spring.profiles.active=dev 

#spring-cloud-bus-amqp config 
spring.rabbitmq.host=localhost 
spring.rabbitmq.port=5672 
spring.rabbitmq.virtual-host=/ 

這是我的春天,雲配置服務器POM

<dependencies> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-config-server</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-eureka</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-stream-rabbit</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-config-monitor</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-bus-amqp</artifactId> 
     </dependency> 

    </dependencies> 

這是我的春天,雲配置客戶端配置

#spring-cloud-config 
spring.cloud.config.discovery.serviceId = PUHUI-CLOUD-CONFIG-SERVER 
spring.cloud.config.name = @[email protected] 
spring.cloud.config.profile = @[email protected] 
spring.cloud.config.label= master 

spring.rabbitmq.host = localhost 
spring.rabbitmq.port = 5672 

這是我的春天,雲配置客戶端點POM

<dependencies> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-config</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-bus-amqp</artifactId> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-configuration-processor</artifactId> 
      <optional>true</optional> 
     </dependency> 

     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-eureka</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-hystrix</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>org.springframework.cloud</groupId> 
      <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> 
     </dependency> 
</dependencies> 

此異常不會影響操作的應用程序,但我想知道爲什麼應用程序引發異常

+0

似乎與[彈簧雲Netflix的#1055](https://github.com/spring-相關雲/彈簧雲的Netflix /問題/ 1055)。 –

+0

你有沒有找到這個解決方案? –

回答

0

我認爲錯誤日誌與Eureka相關。你在運行Eureka服務器嗎?您已經在您的pom文件中添加了Eureka依賴項,但是在屬性文件中沒有看到與Eureka相關的配置。嘗試沒有這些依賴關係或建立一個尤里卡服務器,並與他們一起運行。或者至少在配置文件中添加以下屬性。

eureka.client.enabled=false 
+0

哦,真的,我有一個尤里卡服務器,尤里卡配置是eureka.client.serviceUrl.defaultZone = @ eureka.defaultZone @ eureka.instance.hostname = $ {spring.cloud.client.ipAddress} eureka.instance.preferIpAddress = true – ming

2

試圖啓用寄存器並獲取註冊表客戶端在發現服務器

eureka.client.registerWithEureka=true 

eureka.client.fetchRegistry=true 
+0

我試過這些配置,並沒有擺脫那個異常。 –