2021-03-29 17:19:39.338 DEBUG [TID: N/A] 25924 --- [undedElastic-17] reactor.core.publisher.Operators : Duplicate Subscription has been detected
java.lang.IllegalStateException: Spec. Rule 2.12 - Subscriber.onSubscribe MUST NOT be called more than once (based on object equality)
at reactor.core.Exceptions.duplicateOnSubscribeException(Exceptions.java:181)
at reactor.core.publisher.Operators.reportSubscriptionSet(Operators.java:1082)
at reactor.core.publisher.Operators.setOnce(Operators.java:1171)
at reactor.core.publisher.FluxSubscribeOnSubscribeOnSubscriber.run(FluxSubscribeOn.java:187)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-03-29 17:19:39.338 DEBUG [TID: N/A] 25924 --- [undedElastic-18] reactor.core.publisher.Operators : Duplicate Subscription has been detected
java.lang.IllegalStateException: Spec. Rule 2.12 - Subscriber.onSubscribe MUST NOT be called more than once (based on object equality)
at reactor.core.Exceptions.duplicateOnSubscribeException(Exceptions.java:181)
at reactor.core.publisher.Operators.reportSubscriptionSet(Operators.java:1082)
at reactor.core.publisher.Operators.setOnce(Operators.java:1171)
at reactor.core.publisher.FluxSubscribeOnSubscribeOnSubscriber.run(FluxSubscribeOn.java:187)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-03-29 17:19:39.338 DEBUG [TID: N/A] 25924 --- [undedElastic-17] reactor.core.publisher.Operators : Duplicate Subscription has been detected
java.lang.IllegalStateException: Spec. Rule 2.12 - Subscriber.onSubscribe MUST NOT be called more than once (based on object equality)
at reactor.core.Exceptions.duplicateOnSubscribeException(Exceptions.java:181)
at reactor.core.publisher.Operators.reportSubscriptionSet(Operators.java:1082)
at reactor.core.publisher.Operators.setOnce(Operators.java:1171)
at reactor.core.publisher.FluxSubscribeOnSubscribeOnSubscriber.run(FluxSubscribeOn.java:187)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-03-29 17:19:39.338 DEBUG [TID: N/A] 25924 --- [undedElastic-18] reactor.core.publisher.Operators : Duplicate Subscription has been detected
java.lang.IllegalStateException: Spec. Rule 2.12 - Subscriber.onSubscribe MUST NOT be called more than once (based on object equality)
at reactor.core.Exceptions.duplicateOnSubscribeException(Exceptions.java:181)
at reactor.core.publisher.Operators.reportSubscriptionSet(Operators.java:1082)
at reactor.core.publisher.Operators.setOnce(Operators.java:1171)
at reactor.core.publisher.FluxSubscribeOnSubscribeOnSubscriber.run(FluxSubscribeOn.java:187)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-03-29 17:19:39.339 ERROR [TID: N/A] 25924 --- [undedElastic-17] reactor.core.scheduler.Schedulers : Scheduler worker in group main failed with an uncaught exception
reactor.core.ExceptionsTokenConfig
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to com.qsc.ebao.gateway.gatewayfilter.gatewayfilterfactory.TokenVerificationGatewayFilterFactoryMapSubscriber.onNext(FluxMap.java:100)
at reactor.core.publisher.FluxFlatMapFlatMapMain.onNext(FluxFlatMap.java:413)
at reactor.core.publisher.FluxMergeSequentialMergeSequentialMain.innerComplete(FluxMergeSequential.java:321)
at reactor.core.publisher.FluxMergeSequentialMapSubscriber.onComplete(FluxMap.java:136)
at reactor.core.publisher.FluxFilterMapConditionalSubscriber.onComplete(FluxMap.java:262)
at reactor.core.publisher.FluxFilterFlatMapMain.checkTerminated(FluxFlatMap.java:838)
at reactor.core.publisher.FluxFlatMapFlatMapMain.innerComplete(FluxFlatMap.java:909)
at reactor.core.publisher.FluxFlatMapMonoSubscriber.complete(Operators.java:1765)
at reactor.core.publisher.MonoCollectListFirstNonEmptyEmittingSubscriber.onComplete(FluxFirstNonEmptyEmitting.java:333)
at reactor.core.publisher.FluxSubscribeOnIterableSubscription.fastPath(FluxIterable.java:357)
at reactor.core.publisher.FluxIterableSubscribeOnSubscriber.requestUpstream(FluxSubscribeOn.java:124)
at reactor.core.publisher.FluxSubscribeOnSubscribeOnSubscriber.run(FluxSubscribeOn.java:187)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-03-29 17:19:39.339 ERROR [TID: N/A] 25924 --- [undedElastic-18] reactor.core.scheduler.Schedulers : Scheduler worker in group main failed with an uncaught exception
reactor.core.ExceptionsTokenConfig
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to com.qsc.ebao.gateway.gatewayfilter.gatewayfilterfactory.TokenVerificationGatewayFilterFactoryMapSubscriber.onNext(FluxMap.java:100)
at reactor.core.publisher.FluxFlatMapFlatMapMain.onNext(FluxFlatMap.java:413)
at reactor.core.publisher.FluxMergeSequentialMergeSequentialMain.innerComplete(FluxMergeSequential.java:321)
at reactor.core.publisher.FluxMergeSequentialMapSubscriber.onComplete(FluxMap.java:136)
at reactor.core.publisher.FluxFilterMapConditionalSubscriber.onComplete(FluxMap.java:262)
at reactor.core.publisher.FluxFilterFlatMapMain.checkTerminated(FluxFlatMap.java:838)
at reactor.core.publisher.FluxFlatMapFlatMapMain.innerComplete(FluxFlatMap.java:909)
at reactor.core.publisher.FluxFlatMapMonoSubscriber.complete(Operators.java:1765)
at reactor.core.publisher.MonoCollectListFirstNonEmptyEmittingSubscriber.onComplete(FluxFirstNonEmptyEmitting.java:333)
at reactor.core.publisher.FluxSubscribeOnIterableSubscription.fastPath(FluxIterable.java:357)
at reactor.core.publisher.FluxIterableSubscribeOnSubscriber.requestUpstream(FluxSubscribeOn.java:124)
at reactor.core.publisher.FluxSubscribeOnSubscribeOnSubscriber.run(FluxSubscribeOn.java:187)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
at java.util.concurrent.FutureTask.run(FutureTask.java)
at java.util.concurrent.ScheduledThreadPoolExecutor201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
版本:
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.2.5.RELEASE</version>
<relativePath>..</relativePath>
问题 创建的自动filter 必须声明一个构造函数
image.png
因为AbstractGatewayFilterFactory 构造默认是一个Object.class的强转:
image.png
网友评论