Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thymeleaf-extras-springsecurity5 bug #65

Open
fuyong859050943 opened this issue Mar 8, 2019 · 0 comments
Open

thymeleaf-extras-springsecurity5 bug #65

fuyong859050943 opened this issue Mar 8, 2019 · 0 comments

Comments

@fuyong859050943
Copy link

fuyong859050943 commented Mar 8, 2019

  • spring-boot.version: 2.1.3.RELEASE
  • thymeleaf-extras-springsecurity5.version: 3.0.4.RELEASE

this is my code, just render a thymeleaf html

public Mono<ServerResponse> detail(ServerRequest request) {
        return request.queryParam("id")
                .map(Mono::just)
                .orElseThrow(() -> {
                    log.error("id is null");
                    return new CrmIllegalArgumentException(ErrorCodeEnum.BAD_REQUEST, "id can not be null");
                })
                .flatMap(id -> engineService.findById(id))
                .flatMap(engine -> ok()
                        .render("engine/detail", new ConcurrentModel()
                                .addAttribute("eng", engine )));
}

throw a exception

java.lang.UnsupportedOperationException: null
	at java.util.Collections$UnmodifiableMap.put(Collections.java:1457) ~[na:1.8.0_91]
	at org.thymeleaf.spring5.view.reactive.ThymeleafReactiveView.render(ThymeleafReactiveView.java:361) ~[thymeleaf-spring5-3.0.10.RELEASE.jar:3.0.10.RELEASE]
	at org.springframework.web.reactive.function.server.DefaultRenderingResponseBuilder$DefaultRenderingResponse.lambda$writeToInternal$2(DefaultRenderingResponseBuilder.java:201) ~[spring-webflux-5.0.10.RELEASE.jar:5.0.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:398) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:210) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:140) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxStream.subscribe(FluxStream.java:68) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1083) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:241) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1083) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:241) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1640) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:156) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap$FlatMapInner.onSubscribe(MonoFlatMap.java:230) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:90) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:127) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73) [reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:127) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:108) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) ~[reactor-core-3.1.10.RELEASE.jar:3.1.10.RELEASE]
	at com.mongodb.reactivestreams.client.internal.ObservableToPublisher$1.onNext(ObservableToPublisher.java:68) ~[mongodb-driver-reactivestreams-1.7.1.jar:na]
	at com.mongodb.async.client.AbstractSubscription.onNext(AbstractSubscription.java:135) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.AbstractSubscription.processResultsQueue(AbstractSubscription.java:203) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.AbstractSubscription.tryProcessResultsQueue(AbstractSubscription.java:159) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.AbstractSubscription.addToQueue(AbstractSubscription.java:110) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.SingleResultCallbackSubscription$1.onResult(SingleResultCallbackSubscription.java:47) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.FindIterableImpl$1$1.onResult(FindIterableImpl.java:218) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.FindIterableImpl$1$1.onResult(FindIterableImpl.java:209) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.operation.AsyncQueryBatchCursor.next(AsyncQueryBatchCursor.java:135) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.operation.AsyncQueryBatchCursor.next(AsyncQueryBatchCursor.java:99) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.async.client.FindIterableImpl$1.onResult(FindIterableImpl.java:209) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.async.client.FindIterableImpl$1.onResult(FindIterableImpl.java:203) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.async.client.AsyncOperationExecutorImpl$1$1.onResult(AsyncOperationExecutorImpl.java:70) ~[mongodb-driver-async-3.6.4.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.operation.FindOperation$3.onResult(FindOperation.java:822) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.operation.OperationHelper$ReferenceCountedReleasingWrappedCallback.onResult(OperationHelper.java:353) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.operation.CommandOperationHelper$1.onResult(CommandOperationHelper.java:389) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:207) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:102) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:458) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:110) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:381) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:359) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:651) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:618) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:487) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:484) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:236) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection.readAsync(InternalStreamConnection.java:484) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection.access$1100(InternalStreamConnection.java:74) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:608) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:593) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:487) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:484) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:236) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:266) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.netty.NettyStream.access$600(NettyStream.java:66) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:325) ~[mongodb-driver-core-3.6.4.jar:na]
	at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:322) ~[mongodb-driver-core-3.6.4.jar:na]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) ~[netty-transport-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[netty-common-4.1.29.Final.jar:4.1.29.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.29.Final.jar:4.1.29.Final]
	at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]

when write like this, it's work well

    @GetMapping("user/edit")
    public Mono<String> userDetail(Model model, @NotBlank(message = "userId can not be null") @RequestParam String userId) {
        model.addAttribute("user", userService.findById(userId));
        return Mono.just("user/detail");
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant