鲁大师是你无法升到的高度
2018-04-03 10:14
采纳率: 75%
浏览 6.8k
已采纳

springcloud:访问/bus/refresh地址后出现错误,,client端出现以下错误

springcloud config-server rabbitmq
配置自动刷新,在访问/bus/refresh地址后,client端出现以下错误

client-config

org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener threw exception

at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.wrapToListenerExecutionFailedExceptionIfNeeded(AbstractMessageListenerContainer.java:1506) ~[spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1417) ~[spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener(AbstractMessageListenerContainer.java:1337) ~[spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:1324) ~[spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:1303) ~[spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:785) [spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:769) [spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$700(SimpleMessageListenerContainer.java:77) [spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1010) [spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]

Caused by: org.springframework.messaging.converter.MessageConversionException:
Cannot convert from [java.lang.String] to
[org.springframework.cloud.bus.event.RemoteApplicationEvent]
for GenericMessage [payload={"type":"RefreshRemoteApplicationEvent","timestamp":1522749739659,"originService":"config-server:8888","destinationService":"**","id":"202be12a-7597-45a9-8731-bb4454e4da4f"},
headers={amqp_receivedDeliveryMode=PERSISTENT,
amqp_receivedExchange=springCloudBus, amqp_deliveryTag=1,
deliveryAttempt=3,
amqp_consumerQueue=springCloudBus.anonymous.9cLCAd4QRVCfurGMHUDmrg,
X-B3-ParentSpanId=c5f8bad949d06b94,
amqp_redelivered=false, messageSent=true,
spanTraceId=5daa65f9b6124b03, spanId=3e738e68342e56ad, spanParentSpanId=c5f8bad949d06b94,
amqp_receivedRoutingKey=springCloudBus, nativeHeaders={spanTraceId=[5daa65f9b6124b03], spanId=[3e738e68342e56ad], spanParentSpanId=[c5f8bad949d06b94], spanSampled=[0]}, X-B3-SpanId=3e738e68342e56ad, X-B3-Sampled=0, X-B3-TraceId=5daa65f9b6124b03, id=d01f292e-7a7f-dec5-c49b-50fc36e6b1b3, spanSampled=0, amqp_consumerTag=amq.ctag-HJJsrtYoTr5gc-g7fUQFkA, contentType=text/plain}]

at org.springframework.messaging.handler.annotation.support.PayloadArgumentResolver.resolveArgument(PayloadArgumentResolver.java:144) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:116) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:137) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:109) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.cloud.stream.binding.StreamListenerMessageHandler.handleRequestMessage(StreamListenerMessageHandler.java:55) ~[spring-cloud-stream-2.0.0.RC3.jar:2.0.0.RC3]
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:164) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:132) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:105) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:73) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:463) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:407) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:181) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:160) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:108) ~[spring-messaging-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:203) ~[spring-integration-core-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.access$1100(AmqpInboundChannelAdapter.java:59) ~[spring-integration-amqp-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.lambda$onMessage$0(AmqpInboundChannelAdapter.java:217) ~[spring-integration-amqp-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:287) ~[spring-retry-1.2.2.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:180) ~[spring-retry-1.2.2.RELEASE.jar:na]
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.onMessage(AmqpInboundChannelAdapter.java:214) ~[spring-integration-amqp-5.0.3.RELEASE.jar:5.0.3.RELEASE]
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:1414) ~[spring-rabbit-2.0.2.RELEASE.jar:2.0.2.RELEASE]
... 8 common frames omitted

2018-04-03 18:02:22.789 WARN [user-service,,,] 9428 --- [VCfurGMHUDmrg-1] ingErrorHandler$DefaultExceptionStrategy : Fatal message conversion error; message rejected; it will be dropped or routed to a dead letter exchange, if so configured: (Body:'{"type":"RefreshRemoteApplicationEvent","timestamp":1522749739659,"originService":"config-server:8888","destinationService":"**","id":"202be12a-7597-45a9-8731-bb4454e4da4f"}' MessageProperties [headers={spanTraceId=5daa65f9b6124b03, spanId=8e507c0a47a5fd86, nativeHeaders={spanTraceId=[5daa65f9b6124b03], spanId=[3e738e68342e56ad], spanParentSpanId=[c5f8bad949d06b94], spanSampled=[0]}, messageSent=true, spanSampled=0, contentType=text/plain, originalContentType=application/json;charset=UTF-8}, contentType=text/plain, contentLength=0, receivedDeliveryMode=PERSISTENT, priority=0, redelivered=false, receivedExchange=springCloudBus, receivedRoutingKey=springCloudBus, deliveryTag=1, consumerTag=amq.ctag-HJJsrtYoTr5gc-g7fUQFkA, consumerQueue=springCloudBus.anonymous.9cLCAd4QRVCfurGMHUDmrg])
2018-04-03 18:02:25.803 WARN [user-service,,,] 9428 --- [VCfurGMHUDmrg-1] s.a.r.l.ConditionalRejectingErrorHandler : Execution of Rabbit message listener failed.

图片说明

==================================已解决===================================
==================================已解决===================================
==================================已解决===================================
==================================已解决===================================
Spring boot 2.0的改动较大,/bus/refresh全部整合到actuador里面了,所以之前1.x的management.security.enabled全部失效,不适用于2.0
适用于2.0的配置是这样的:

 management:
  endpoints:
    web:
      exposure:
        include: bus-refresh

另外注解

 @RefreshScope 

需要在配置的页面加上,就是说附带@Value的页面加上此注解

请求刷新的页面由原来1.5.x的localhost:8888/bus/refresh
变成:http://localhost:8888/actuator/bus-refresh

注意:config-server和config-client的配置都得加上

 management:
  endpoints:
    web:
      exposure:
        include: bus-refresh

配置
整合被折腾了好几天,实在是大坑

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

6条回答 默认 最新

  • 新时代的程序猿 2018-04-03 10:25
    已采纳

    异常信息不完整,截个全的来看看

    点赞 评论
  • 白萝卜blb 2018-04-03 10:20

    Cannot convert from [java.lang.String] to
    [org.springframework.cloud.bus.event.RemoteApplicationEvent]
    这个String 是你自己写的?你反查下代码看看

    点赞 评论
  • Spring boot 2.0的改动较大,/bus/refresh全部整合到actuador里面了,所以之前1.x的management.security.enabled全部失效,不适用于2.0
    适用于2.0的配置是这样的:

    management:
    endpoints:
    web:
    exposure:
    include: bus-refresh
    另外注解

    @RefreshScope
    需要在配置的页面加上,就是说附带@Value的页面加上此注解

    请求刷新的页面由原来1.5.x的localhost:8888/bus/refresh
    变成:http://localhost:8888/actuator/bus-refresh

    注意:config-server和config-client的配置都得加上

    management:
    endpoints:
    web:
    exposure:
    include: bus-refresh
    配置
    整合被折腾了好几天,实在是大坑

    点赞 评论
  • Spring boot 2.0的改动较大,/bus/refresh全部整合到actuador里面了,所以之前1.x的management.security.enabled全部失效,不适用于2.0
    适用于2.0的配置是这样的:

    
     management:
      endpoints:
        web:
          exposure:
            include: bus-refresh
    

    另外注解

      @RefreshScope 
    

    需要在配置的页面加上,就是说附带@Value的页面加上此注解

    请求刷新的页面由原来1.5.x的localhost:8888/bus/refresh
    变成:http://localhost:8888/actuator/bus-refresh

    注意:config-server和config-client的配置都得加上

      management:
      endpoints:
        web:
          exposure:
            include: bus-refresh
    

    配置
    整合被折腾了好几天,实在是大坑

    点赞 评论
  • qq_15367727 2018-07-20 03:21

    为啥不行呢jar也加了 直接也赔了你说的这两个在配置文件离也配置了 但是还是404啊啊

    点赞 评论
  • kesai2008 2018-08-25 08:55

    改端口服务不能重启啊,郁闷

    点赞 评论

相关推荐 更多相似问题