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

Document requirements and supported modes for mutable and immutable types [DATACMNS-1374] #1810

Closed
spring-projects-issues opened this issue Jul 28, 2018 · 12 comments
Assignees
Labels
type: enhancement

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Jul 28, 2018

Juergen Zimmermann opened DATACMNS-1374 and commented

I'm getting the stacktrace below with Lovelace-RC1, but not with Lovelace-M3. The declaration of org.springframework.security.core.userdetails.User.accountNonExpired is "private final boolean" as it was in Spring Security 5.0.6.RELEASE and 5.1.0.M1.

The Stacktrace:

java.lang.UnsupportedOperationException: No accessor to set property private final boolean org.springframework.security.core.userdetails.User.accountNonExpired!
    at de.hska.kunde.config.security.CustomUserDetails_Accessor_qjtmn6.setProperty(Unknown Source) ~[main/:na]
    at org.springframework.data.mapping.model.ConvertingPropertyAccessor.setProperty(ConvertingPropertyAccessor.java:60) ~[spring-data-commons-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readProperties(MappingMongoConverter.java:354) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:284) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:245) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:194) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:190) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:78) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at org.springframework.data.mongodb.core.ReactiveMongoTemplate$ProjectingReadCallback.doWith(ReactiveMongoTemplate.java:2967) ~[spring-data-mongodb-2.1.0.RC1.jar:2.1.0.RC1]
    at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100) ~[reactor-core-3.2.0.M3.jar:3.2.0.M3]
    at com.mongodb.reactivestreams.client.internal.ObservableToPublisher$1.onNext(ObservableToPublisher.java:68) ~[mongodb-driver-reactivestreams-1.9.0.jar:na]
    at com.mongodb.async.client.AbstractSubscription.onNext(AbstractSubscription.java:137) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.AbstractSubscription.processResultsQueue(AbstractSubscription.java:205) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.AbstractSubscription.tryProcessResultsQueue(AbstractSubscription.java:161) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.AbstractSubscription.addToQueue(AbstractSubscription.java:119) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.MongoIterableSubscription$2.onResult(MongoIterableSubscription.java:99) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.MongoIterableSubscription$2.onResult(MongoIterableSubscription.java:85) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.operation.AsyncQueryBatchCursor.next(AsyncQueryBatchCursor.java:136) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.operation.AsyncQueryBatchCursor.next(AsyncQueryBatchCursor.java:100) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.async.client.MongoIterableSubscription.requestMoreData(MongoIterableSubscription.java:85) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.MongoIterableSubscription$1.onResult(MongoIterableSubscription.java:53) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.async.client.MongoIterableSubscription$1.onResult(MongoIterableSubscription.java:46) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.async.client.OperationExecutorImpl$1$1.onResult(OperationExecutorImpl.java:82) ~[mongodb-driver-async-3.8.0.jar:na]
    at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.operation.FindOperation$3.onResult(FindOperation.java:806) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.operation.OperationHelper$ReferenceCountedReleasingWrappedCallback.onResult(OperationHelper.java:359) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.operation.CommandOperationHelper$2.onResult(CommandOperationHelper.java:405) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor$2.onResult(DefaultServer.java:227) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.CommandProtocolImpl$1.onResult(CommandProtocolImpl.java:85) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection$1.onResult(DefaultConnectionPool.java:461) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.UsageTrackingInternalConnection$2.onResult(UsageTrackingInternalConnection.java:111) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.async.ErrorHandlingResultCallback.onResult(ErrorHandlingResultCallback.java:49) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:379) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$2$1.onResult(InternalStreamConnection.java:356) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:651) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback$MessageCallback.onResult(InternalStreamConnection.java:618) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:494) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:491) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:236) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection.readAsync(InternalStreamConnection.java:491) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection.access$1000(InternalStreamConnection.java:74) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:608) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$MessageHeaderCallback.onResult(InternalStreamConnection.java:593) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:494) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.internal.connection.InternalStreamConnection$5.completed(InternalStreamConnection.java:491) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.connection.netty.NettyStream.readAsync(NettyStream.java:236) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.connection.netty.NettyStream.handleReadResponse(NettyStream.java:266) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.connection.netty.NettyStream.access$600(NettyStream.java:66) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:325) ~[mongodb-driver-core-3.8.0.jar:na]
    at com.mongodb.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:322) ~[mongodb-driver-core-3.8.0.jar:na]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:547) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:501) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461) ~[netty-transport-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[netty-common-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.25.Final.jar:4.1.25.Final]
    at java.base/java.lang.Thread.run(Thread.java:844) ~[na:na]
    Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
  Assembly trace from producer [reactor.core.publisher.FluxLift] :
    reactor.core.publisher.Flux.map(Flux.java:5604)
    org.springframework.data.mongodb.core.ReactiveMongoTemplate.lambda$executeFindMultiInternal$66(ReactiveMongoTemplate.java:2536)
    reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:153)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1429)
    reactor.core.publisher.MonoCallable.subscribe(MonoCallable.java:61)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFlatMapMany.subscribe(MonoFlatMapMany.java:49)
    reactor.core.publisher.FluxLift.subscribe(FluxLift.java:46)
    reactor.core.publisher.FluxOnErrorResume.subscribe(FluxOnErrorResume.java:47)
    reactor.core.publisher.FluxLift.subscribe(FluxLift.java:46)
    reactor.core.publisher.MonoCollectList.subscribe(MonoCollectList.java:59)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoPublishOn.subscribe(MonoPublishOn.java:45)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFilterFuseable.subscribe(MonoFilterFuseable.java:47)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1429)
    reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:241)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1993)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:69)
    reactor.core.publisher.MonoFlatMap$FlatMapInner.onSubscribe(MonoFlatMap.java:230)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:63)
    reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:113)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1993)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:69)
    reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.request(FluxFilterFuseable.java:185)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:69)
    reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:103)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:63)
    reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onSubscribe(FluxFilterFuseable.java:82)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:63)
    reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFilterFuseable.subscribe(MonoFilterFuseable.java:47)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoSubscriberContext.subscribe(MonoSubscriberContext.java:47)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:121)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:121)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1429)
    reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:241)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1429)
    reactor.core.publisher.MonoCollectList$MonoBufferAllSubscriber.onComplete(MonoCollectList.java:117)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onComplete(ScopePassingSpanSubscriber.java:90)
    reactor.core.publisher.FluxIterable$IterableSubscription.fastPath(FluxIterable.java:333)
    reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:198)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:69)
    reactor.core.publisher.MonoCollectList$MonoBufferAllSubscriber.onSubscribe(MonoCollectList.java:90)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:63)
    reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:139)
    reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:63)
    reactor.core.publisher.FluxLiftFuseable.subscribe(FluxLiftFuseable.java:70)
    reactor.core.publisher.MonoCollectList.subscribe(MonoCollectList.java:59)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.drain(FluxFilterWhen.java:295)
    reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.onNext(FluxFilterWhen.java:134)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onNext(ScopePassingSpanSubscriber.java:81)
    reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:243)
    reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:201)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.request(ScopePassingSpanSubscriber.java:69)
    reactor.core.publisher.FluxFilterWhen$FluxFilterWhenSubscriber.onSubscribe(FluxFilterWhen.java:194)
    org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onSubscribe(ScopePassingSpanSubscriber.java:63)
    reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:139)
    reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:63)
    reactor.core.publisher.FluxLiftFuseable.subscribe(FluxLiftFuseable.java:70)
    reactor.core.publisher.FluxFilterWhen.subscribe(FluxFilterWhen.java:69)
    reactor.core.publisher.FluxLift.subscribe(FluxLift.java:46)
    reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.Mono.subscribe(Mono.java:3555)
    reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)
    reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoSubscriberContext.subscribe(MonoSubscriberContext.java:47)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.MonoPeekTerminal.subscribe(MonoPeekTerminal.java:61)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44)
    reactor.core.publisher.MonoLift.subscribe(MonoLift.java:45)
    reactor.core.publisher.Mono.subscribe(Mono.java:3555)
    reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:172)
    reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)
    reactor.core.publisher.MonoLiftFuseable.subscribe(MonoLiftFuseable.java:55)
    reactor.core.publisher.Mono.subscribe(Mono.java:3555)
    org.springframework.http.server.reactive.ServletHttpHandlerAdapter.service(ServletHttpHandlerAdapter.java:194)
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764)
 Error has been observed by the following operator(s):
    |_ Flux.map ⇢ org.springframework.data.mongodb.core.ReactiveMongoTemplate.lambda$executeFindMultiInternal$66(ReactiveMongoTemplate.java:2536)
    |_ Mono.flatMapMany ⇢ org.springframework.data.mongodb.core.ReactiveMongoTemplate.createFlux(ReactiveMongoTemplate.java:577)
    |_ FluxOnErrorResume$ResumeSubscriber.onError ⇢ org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:86)
    |_ Flux.onErrorMap ⇢ org.springframework.data.mongodb.core.ReactiveMongoTemplate.createFlux(ReactiveMongoTemplate.java:577)
    |_ Flux.collectList ⇢ org.springframework.data.mongodb.core.ReactiveFindOperationSupport$ReactiveFindSupport.one(ReactiveFindOperationSupport.java:148)
    |_ Mono.flatMap ⇢ org.springframework.data.mongodb.core.ReactiveFindOperationSupport$ReactiveFindSupport.one(ReactiveFindOperationSupport.java:148)
    |_ Mono.publishOn ⇢ org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager.authenticate(UserDetailsRepositoryReactiveAuthenticationManager.java:56)
    |_ Mono.filter ⇢ org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager.authenticate(UserDetailsRepositoryReactiveAuthenticationManager.java:57)
    |_ Mono.switchIfEmpty ⇢ org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager.authenticate(UserDetailsRepositoryReactiveAuthenticationManager.java:58)
    |_ Mono.flatMap ⇢ org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager.authenticate(UserDetailsRepositoryReactiveAuthenticationManager.java:59)
    |_ Mono.map ⇢ org.springframework.security.authentication.UserDetailsRepositoryReactiveAuthenticationManager.authenticate(UserDetailsRepositoryReactiveAuthenticationManager.java:68)
    |_ Mono.switchIfEmpty ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter.authenticate(AuthenticationWebFilter.java:100)
    |_ Mono.flatMap ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter.authenticate(AuthenticationWebFilter.java:101)
    |_ FluxOnErrorResume$ResumeSubscriber.onError ⇢ org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:86)
    |_ Mono.onErrorResume ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter.authenticate(AuthenticationWebFilter.java:102)
    |_ Mono.flatMap ⇢ org.springframework.security.web.server.authentication.AuthenticationWebFilter.filter(AuthenticationWebFilter.java:93)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)
    |_ Mono.flatMap ⇢ org.springframework.security.web.server.WebFilterChainProxy.filter(WebFilterChainProxy.java:58)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)
    |_ Mono.then ⇢ org.springframework.cloud.sleuth.instrument.web.TraceWebFilter.lambda$filter$4(TraceWebFilter.java:131)
    |_ Mono.error ⇢ org.springframework.cloud.sleuth.instrument.web.TraceWebFilter.lambda$null$2(TraceWebFilter.java:141)
    |_ Mono.flatMap ⇢ org.springframework.cloud.sleuth.instrument.web.TraceWebFilter.lambda$filter$4(TraceWebFilter.java:134)
    |_ Mono.compose ⇢ org.springframework.cloud.sleuth.instrument.web.TraceWebFilter.filter(TraceWebFilter.java:131)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)
    |_ Mono.doOnSuccess ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter.filter(MetricsWebFilter.java:64)
    |_ Mono.doOnError ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter.filter(MetricsWebFilter.java:64)
    |_ Mono.compose ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter.filter(MetricsWebFilter.java:58)
    |_ Mono.defer ⇢ org.springframework.web.server.handler.DefaultWebFilterChain.filter(DefaultWebFilterChain.java:72)

Affects: 2.1 RC1 (Lovelace)

Issue Links:

  • DATACASS-596 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • DATACOUCH-405 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • DATAGEODE-146 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • DATAJDBC-265 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • DATAMONGO-2090 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • DATAREDIS-868 Include documentation about Repository Object Mapping Fundamentals
    ("is depended on by")
  • DATASOLR-482 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • SGF-788 Include documentation about Object Mapping Fundamentals
    ("is depended on by")
  • DATAMONGO-2066 MongoTemplate cannot read immutable Objects that compute properties in constructor

Referenced from: pull request #306

0 votes, 8 watchers

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jul 28, 2018

Mark Paluch commented

Thanks for the report. What is the functionality that causes this issue? Do you reference org.springframework.security.core.userdetails.User in your code or do you use a MongoDB-based user repository plugin for Spring Security?

The trace you're seeing originates in our support for immutable objects. The field accountNonExpired of User is immutable and has no mutator (setter, wither method like withAccountNonExpired(…)), therefore we cannot set the property.

Previously, we changed fields using reflection regardless of their final flag.

 

Looking at the stack trace, it seems you're using a customized UserDetails object. Care to add a full constructor and add @PersistenceConstructor to create the immutable part of the object?

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jul 29, 2018

Juergen Zimmermann commented

  1. In a demo app I have a (Kotlin) class CustomUserDetails which is derived from org.springframework.security.core.userdetails.User.

  2. After I added a secondary constructor with @PersistenceConstructor the stacktrace is gone when I read/fetch the document.

Maybe this is should be emphazied the release notes

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jul 29, 2018

Mark Paluch commented

Thanks a lot for your timely response. We will add some notes in the documentation about the changed behavior

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jan 21, 2019

runjia1987 commented

I think this exception: "No accessor to set property private final" still exists in spring-data 2.1.x releases now.

Adding @PersistenceConstructor constructor should not be the advocated solution.

I expect spring-data 2.1.x releases acts similar like former releases here.

 

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jan 25, 2019

Julien May commented

i agree, the exception still exists in spring-data 2.1 SR2

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jan 25, 2019

Mark Paluch commented

Sorry if the description is not expressive enough. This exception won't go away without changing your entity. We removed support to set values of final fields to embrace and not break the usage of immutable classes. You can do the following to mitigate the issue:
 

  1. Add a @PersistenceConstructor to construct the entity that sets immutable fields.
  2. Add wither methods (MyEntity withXxx(…)) to create a new instance that contains the changed property value.
  3. Alternatively: Use Kotlin's data class feature. This will basically do the same as wither methods

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jan 30, 2019

runjia1987 commented

Deserialization should always allow change the final fields of an object, just like JVM serialization, Jackson, spring-data former releases.

This breaking change makes no sense, and causes too many issues in github and stackoverflow

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jan 30, 2019

Mark Paluch commented

This assumption might work out for cases in which it is convenient to change final properties because the underlying code cannot be changed or similar scenarios. The constellation in which this works is more by accident because of a single-threaded behavior.

When using immutable objects, you don't want any component to update your final properties. In such cases, modifying final properties causes harm to applications as you expect to not change immutable properties

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jun 26, 2019

Wei Wei commented

Unfortunately, even with just one constructor, which is also annotated with PersistenceConstructor, we still get "No Accessor" exception. The affected field is annotated with Version.

 

Can anybody help here? Many thanks

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jul 31, 2019

AffanHasan commented

Even after using  @PersistenceConstructor still having following error:

org.springframework.http.converter.HttpMessageNotReadableException: Could not read payload!; nested exception is java.lang.UnsupportedOperationException: No accessor to set property @org.hibernate.validator.constraints.NotBlank(message=name is required, payload=[], groups=[]) @org.springframework.data.mongodb.core.index.Indexed(expireAfterSeconds=-1, dropDups=false, sparse=false, useGeneratedName=false, background=false, unique=true, name=, direction=ASCENDING)private final java.lang.String com.etilize.burraq.unit.Unit.name!","cause":null,"code":0}

I am using spring-data-commons version 2.1.8.RELEASE

 

I am using following entity

@Document(collection = COLLECTION_NAME)
public class Unit extends AbstractMongoEntity<ObjectId> {

 @NotBlank(message = "name is required")
 @Indexed(unique = true)
 private final String name;

@JsonCreator

@PersistenceConstructor
 public Unit(@JsonProperty("name") final String name) {
 this.name = name;
}

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Feb 2, 2020

faseidl commented

You can do the following to mitigate the issue:
 

  1. Add a @PersistenceConstructor to construct the entity that sets immutable fields.
  2. Add wither methods (MyEntity withXxx(…)) to create a new instance that contains the changed property value.
  3. Alternatively: Use Kotlin's data class feature. This will basically do the same as wither methods.

None of these approaches work if you are unable to modify the document class (or a data type used in a document class).

Are there any recommended approaches in such circumstances?

 

 

@p-prasad87
Copy link

p-prasad87 commented Jul 19, 2022

Above suggestions may work for Custom entity types. What about facing issue for out of box components like org.bson.types.BSONTimestamp from bson.jar. " No accessor to set property private final int org.bson.types.BSONTimestamp.inc!". we can customize these components right. how would we resolve these. Please suggest exact solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement
Projects
None yet
Development

No branches or pull requests

3 participants