记录行程程式:o.s.m.消息传递异常:调度程序没有通道订阅者'应用程序-1 inMemorySwaggerResourcesProvider-out-0'

mlnl4t2r  于 2022-11-23  发布在  其他
关注(0)|答案(2)|浏览(638)

我有一个新项目(Sping Boot 2.4.13),我想为该项目添加一些特色

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.4.13</version>
    <relativePath/>
  </parent>

我刚刚添加了2个依赖项:

<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-boot-starter</artifactId>
  <version>3.0.0</version>
</dependency>
<dependency>
  <groupId>io.springfox</groupId>
  <artifactId>springfox-swagger-ui</artifactId>
  <version>3.0.0</version>
</dependency>

当我启动我的应用程序时,我在日志中看到以下错误:

2022-11-10 11:14:37.459 ERROR 30060 --- [   scheduling-1] o.s.integration.handler.LoggingHandler   : org.springframework.messaging.MessageDeliveryException: Dispatcher has no subscribers for channel 'application-1.inMemorySwaggerResourcesProvider-out-0'.; nested exception is org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers, failedMessage=GenericMessage [payload=byte[90], headers={messageConsumed=true, X-B3-SpanId=febbbdee76288c09, io.opentracing.contrib.spring.integration.messaging.OpenTracingChannelInterceptor.SCOPE=io.opentracing.util.ThreadLocalScope@6ea2e38a, X-B3-ParentSpanId=cf083cc53199901c, X-B3-Sampled=1, X-B3-TraceId=cf083cc53199901c, messageSent=true, id=13817867-f785-2eee-2522-c98a9d95be36, contentType=application/json, timestamp=1668068077459}], failedMessage=GenericMessage [payload=byte[90], headers={messageConsumed=true, X-B3-SpanId=febbbdee76288c09, io.opentracing.contrib.spring.integration.messaging.OpenTracingChannelInterceptor.SCOPE=io.opentracing.util.ThreadLocalScope@6ea2e38a, X-B3-ParentSpanId=cf083cc53199901c, X-B3-Sampled=1, X-B3-TraceId=cf083cc53199901c, messageSent=true, id=13817867-f785-2eee-2522-c98a9d95be36, contentType=application/json, timestamp=1668068077459}]
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:76)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:317)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:272)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:166)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109)
    at org.springframework.integration.router.AbstractMessageRouter.doSend(AbstractMessageRouter.java:213)
    at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:195)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:56)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:133)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:106)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:72)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:317)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:272)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:166)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109)
    at org.springframework.integration.endpoint.SourcePollingChannelAdapter.handleMessage(SourcePollingChannelAdapter.java:196)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.messageReceived(AbstractPollingEndpoint.java:450)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:436)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.pollForMessage(AbstractPollingEndpoint.java:388)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.lambda$null$4(AbstractPollingEndpoint.java:331)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor.lambda$execute$0(ErrorHandlingTaskExecutor.java:57)
    at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
    at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:55)
    at org.springframework.integration.endpoint.AbstractPollingEndpoint.lambda$createPoller$5(AbstractPollingEndpoint.java:328)
    at io.opentracing.contrib.concurrent.TracedRunnable.run(TracedRunnable.java:30)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:95)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.springframework.integration.MessageDispatchingException: Dispatcher has no subscribers, failedMessage=GenericMessage [payload=byte[90], headers={messageConsumed=true, X-B3-SpanId=febbbdee76288c09, io.opentracing.contrib.spring.integration.messaging.OpenTracingChannelInterceptor.SCOPE=io.opentracing.util.ThreadLocalScope@6ea2e38a, X-B3-ParentSpanId=cf083cc53199901c, X-B3-Sampled=1, X-B3-TraceId=cf083cc53199901c, messageSent=true, id=13817867-f785-2eee-2522-c98a9d95be36, contentType=application/json, timestamp=1668068077459}]
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:139)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:106)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:72)
    ... 38 more

根本原因是什么?我如何解决它?

**P.S.**如果没有提及的变更,则不会出现错误

tjrkku2a

tjrkku2a1#

我不知道这有什么帮助但当我加上

function:
      routing-expression:

所以现在它看起来像:

spring:
  cloud:
    function:
      routing-expression:

我不知道怎么回事,但它解决了问题。

l7wslrjt

l7wslrjt2#

我已经删除了所有的swagger依赖项和所有添加的配置,它帮助:

<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-webmvc-core</artifactId>
  <version>${spring-doc.version}</version>
</dependency>
<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-webflux-ui</artifactId>
  <version>${spring-doc.version}</version>
</dependency>
<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-data-rest</artifactId>
  <version>${spring-doc.version}</version>
</dependency>
<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-security</artifactId>
  <version>${spring-doc.version}</version>
</dependency>

相关问题