Springboot with SpringWeb and Webflux Not working

1

I am trying to use WebClient in my existing Springboot APP , so Added spring-boot-starter-webflux dependency with spring-boot-starter-web . While calling a rest endpoint and using the block() or subscribe() method, tomcat server is getting stopped and creating a heap dump.

I am running my application in Windows 10 machine in Eclipse IDE.

I have deployed the code in kubernetes and its working there. Is there any settings I have to do to run in locally.

# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffe117f87b0, pid=13068, tid=0x0000000000003538
#
# JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  0x00007ffe117f87b0
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.


Stack: [0x0000000022f80000,0x0000000023080000],  sp=0x000000002307a3f8,  free space=1000k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x00007ffe117f87b0

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  io.netty.internal.tcnative.Library.aprMajorVersion()I+0
j  io.netty.internal.tcnative.Library.initialize(Ljava/lang/String;Ljava/lang/String;)Z+31
j  io.netty.handler.ssl.OpenSsl.initializeTcNative(Ljava/lang/String;)Z+3
j  io.netty.handler.ssl.OpenSsl.<clinit>()V+225
v  ~StubRoutines::call_stub
j  reactor.netty.tcp.SslProvider.updateDefaultConfiguration()V+110
j  reactor.netty.tcp.SslProvider.<init>(Lreactor/netty/tcp/SslProvider$Build;)V+42
j  reactor.netty.tcp.SslProvider$Build.build()Lreactor/netty/tcp/SslProvider;+5
j  reactor.netty.tcp.TcpClientSecure.<clinit>()V+19
v  ~StubRoutines::call_stub
j  reactor.netty.tcp.SslProvider.defaultClientProvider()Lreactor/netty/tcp/SslProvider;+0
j  reactor.netty.http.client.HttpClientSecure.<clinit>()V+8
v  ~StubRoutines::call_stub
j  reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(Lreactor/netty/http/client/HttpClientConnect$HttpClientHandler;Lio/netty/bootstrap/Bootstrap;Lreactor/core/publisher/MonoSink;)V+50
j  reactor.netty.http.client.HttpClientConnect$MonoHttpConnect$$Lambda$800.accept(Ljava/lang/Object;)V+16
j  reactor.core.publisher.MonoCreate.subscribe(Lreactor/core/CoreSubscriber;)V+21
j  reactor.core.publisher.FluxRetryPredicate$RetryPredicateSubscriber.resubscribe()V+44
j  reactor.core.publisher.MonoRetryPredicate.subscribeOrReturn(Lreactor/core/CoreSubscriber;)Lreactor/core/CoreSubscriber;+32
j  reactor.core.publisher.InternalMonoOperator.subscribe(Lreactor/core/CoreSubscriber;)V+4
j  reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(Lreactor/core/CoreSubscriber;)V+205
j  reactor.core.publisher.InternalMonoOperator.subscribe(Lreactor/core/CoreSubscriber;)V+33
j  reactor.core.publisher.MonoDefer.subscribe(Lreactor/core/CoreSubscriber;)V+39
j  reactor.core.publisher.Mono.subscribe(Lorg/reactivestreams/Subscriber;)V+71
j  reactor.core.publisher.Mono.block()Ljava/lang/Object;+10
j  com.example.demo.service.InfragatewayService.getClli(Lcom/verizon/connect/infra/gateway/model/OrderRequest;)Ljava/util/List;+156
j  com.example.demo.controller.InfraGatewayServiceControllerImpl.sendMsgToPulserTopic(Lcom/verizon/connect/infra/gateway/model/OrderRequest;)Lorg/springframework/http/ResponseEntity;+29
j  com.example.demo.controller.InfraGatewayServiceControllerImpl$$FastClassBySpringCGLIB$$a95c7e85.invoke(ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+42
j  org.springframework.cglib.proxy.MethodProxy.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+19
j  org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint()Ljava/lang/Object;+19
j  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;+19
j  org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed()Ljava/lang/Object;+1
j  org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object;+139
j  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;+120
j  org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed()Ljava/lang/Object;+1
j  org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;Lorg/springframework/cglib/proxy/MethodProxy;)Ljava/lang/Object;+133
j  com.example.demo.controller.InfraGatewayServiceControllerImpl$$EnhancerBySpringCGLIB$$69eb2a70.sendMsgToPulserTopic(Lcom/verizon/connect/infra/gateway/model/OrderRequest;)Lorg/springframework/http/ResponseEntity;+36
v  ~StubRoutines::call_stub
J 2136  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (0 bytes) @ 0x0000000002ef55bf [0x0000000002ef5540+0x7f]
J 2135 C1 sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (104 bytes) @ 0x0000000002ef5d64 [0x0000000002ef59a0+0x3c4]
J 1756 C1 sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (10 bytes) @ 0x0000000002e49e24 [0x0000000002e49de0+0x44]
J 1755 C1 java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (62 bytes) @ 0x0000000002e49a24 [0x0000000002e49920+0x104]
j  org.springframework.web.method.support.InvocableHandlerMethod.doInvoke([Ljava/lang/Object;)Ljava/lang/Object;+16
j  org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(Lorg/springframework/web/context/request/NativeWebRequest;Lorg/springframework/web/method/support/ModelAndViewContainer;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(Lorg/springframework/web/context/request/ServletWebRequest;Lorg/springframework/web/method/support/ModelAndViewContainer;[Ljava/lang/Object;)V+4
j  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/springframework/web/method/HandlerMethod;)Lorg/springframework/web/servlet/ModelAndView;+244
j  org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/springframework/web/method/HandlerMethod;)Lorg/springframework/web/servlet/ModelAndView;+81
j  org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView;+7
j  org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+257
j  org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+212
j  org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+71
j  org.springframework.web.servlet.FrameworkServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+3
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+149
j  org.springframework.web.servlet.FrameworkServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+33
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+36
j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+304

Spring Boot Versions:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.0.RELEASE</version>
</parent>

JAVA Code:

List<String> clliList = new ArrayList<>();
    webClientBuilder.build()
            .get()
            .uri(builder.toUriString())
            .retrieve()
            .bodyToMono(ClliInfoResponse.class)
            .doOnSuccess(res ->{    
                System.out.println("I am here - 2" + System.currentTimeMillis());
                clliList.addAll(res.getClliInfoList());
                })
            .doOnError(ex -> ex.printStackTrace())
            .block();
eclipse
spring-boot
tomcat
webclient
asked on Stack Overflow Jan 17, 2020 by P.Das • edited Jan 21, 2020 by Puce

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0