Skip to content

Native version of webflux/r2dbc failed #29582

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

Closed
operrin opened this issue Nov 25, 2022 · 3 comments
Closed

Native version of webflux/r2dbc failed #29582

operrin opened this issue Nov 25, 2022 · 3 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Milestone

Comments

@operrin
Copy link

operrin commented Nov 25, 2022

Hello,

my setup is:

  • java:
    openjdk 17.0.5 2022-10-18
    OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
    OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08, mixed mode, sharing)
  • platform:
    Mac M1
  • os:
    12.6.1

the following fresh new SB3 project [1] compiles and runs without any problems when produced with
gradle bootJar.

When compiled with gradle nativeCompile, it fails for the following route: http:8082/intervenants.
POST, DELETE, PUT or GET intervenants/{id} work fine.

I'm not sure if the probem is related to SB3 or to a GraalVM problem (last line of the exception report):

...
2022-11-25T16:29:17.053+01:00 ERROR 78917 --- [ctor-http-nio-2] a.w.r.e.AbstractErrorWebExceptionHandler : [0e55f725-1]  500 Server Error for HTTP GET "/intervenants"

java.lang.NullPointerException: null
...
...
at [email protected]/java.lang.Thread.run(Thread.java:833) ~[intervenant-service:na]
		at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[intervenant-service:na]
		at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]

Thanks,

[1] https://github.com/operrin/sb3-native

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 25, 2022
@wilkinsona
Copy link
Member

Complete stacktrace:

java.lang.NullPointerException: null
	at org.springframework.aop.framework.AdvisedSupport$MethodCacheKey.<init>(AdvisedSupport.java:578) ~[intervenant-service:6.0.2]
	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
Error has been observed at the following site(s):
	*__checkpoint ⇢ HTTP GET "/intervenants" [ExceptionHandlingWebHandler]
Original Stack Trace:
		at org.springframework.aop.framework.AdvisedSupport$MethodCacheKey.<init>(AdvisedSupport.java:578) ~[intervenant-service:6.0.2]
		at org.springframework.aop.framework.AdvisedSupport.getInterceptorsAndDynamicInterceptionAdvice(AdvisedSupport.java:470) ~[intervenant-service:6.0.2]
		at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[na:na]
		at org.miage.intervenantservice.boundary.IntervenantHandler$$SpringCGLIB$$0.getAllIntervenants(<generated>) ~[intervenant-service:na]
		at org.springframework.web.reactive.function.server.support.HandlerFunctionAdapter.handle(HandlerFunctionAdapter.java:61) ~[intervenant-service:6.0.2]
		at org.springframework.web.reactive.DispatcherHandler.handleRequestWith(DispatcherHandler.java:183) ~[intervenant-service:6.0.2]
		at org.springframework.web.reactive.DispatcherHandler.lambda$handle$2(DispatcherHandler.java:154) ~[intervenant-service:6.0.2]
		at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:132) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[na:na]
		at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74) ~[na:na]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.innerNext(FluxConcatMapNoPrefetch.java:258) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:863) ~[na:na]
		at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122) ~[na:na]
		at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:200) ~[na:na]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:82) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:201) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2508) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.request(FluxConcatArray.java:276) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.request(FluxConcatArray.java:276) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.request(FluxConcatArray.java:276) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.request(FluxConcatArray.java:276) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.request(FluxConcatArray.java:276) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxPeek$PeekSubscriber.request(FluxPeek.java:138) ~[na:na]
		at reactor.core.publisher.FluxMap$MapSubscriber.request(FluxMap.java:164) ~[na:na]
		at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:2268) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.request(FluxConcatMapNoPrefetch.java:338) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.request(MonoNext.java:108) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2304) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2178) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoNext$NextSubscriber.onSubscribe(MonoNext.java:70) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxConcatMapNoPrefetch$FluxConcatMapNoPrefetchSubscriber.onSubscribe(FluxConcatMapNoPrefetch.java:164) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:165) ~[na:na]
		at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:87) ~[na:na]
		at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[na:na]
		at reactor.core.publisher.Mono.subscribe(Mono.java:4444) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:263) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51) ~[na:na]
		at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[intervenant-service:3.5.0]
		at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[na:na]
		at reactor.netty.http.server.HttpServer$HttpServerHandle.onStateChange(HttpServer.java:997) ~[na:na]
		at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:680) ~[na:na]
		at reactor.netty.transport.ServerTransport$ChildObserver.onStateChange(ServerTransport.java:477) ~[na:na]
		at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:573) ~[intervenant-service:1.1.0]
		at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:113) ~[intervenant-service:1.1.0]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[intervenant-service:4.1.85.Final]
		at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:220) ~[intervenant-service:1.1.0]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[intervenant-service:4.1.85.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[intervenant-service:4.1.85.Final]
		at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[intervenant-service:4.1.85.Final]
		at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[na:na]
		at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[na:na]
		at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[na:na]
		at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[na:na]
		at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[na:na]
		at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[na:na]
		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[na:na]
		at [email protected]/java.lang.Thread.run(Thread.java:833) ~[intervenant-service:na]
		at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775) ~[intervenant-service:na]
		at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203) ~[na:na]

@wilkinsona
Copy link
Member

wilkinsona commented Nov 25, 2022

It looks like a bug in the proxying that's necessary to honour the use of @Transactional on IntervenantHandler. We'll ask the Framework team to take a look.

@bclozel bclozel transferred this issue from spring-projects/spring-boot Nov 25, 2022
@operrin
Copy link
Author

operrin commented Dec 23, 2022

Hi,

the problem is still reproducible with the new 3.0.2.

Thanks

@rstoyanchev rstoyanchev added the theme: aot An issue related to Ahead-of-time processing label Jan 25, 2023
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Jan 31, 2023
@sdeleuze sdeleuze self-assigned this Feb 9, 2023
@sdeleuze sdeleuze added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 9, 2023
@sdeleuze sdeleuze added this to the 6.0.6 milestone Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants