项目

一般

简介

适配spring cloud gateway的jar包后报错

由 黄 俊睿 在 超过一年 之前添加

异常信息:

java.lang.NoSuchMethodError: org.springframework.http.server.reactive.ServletServerHttpRequest.<init>(Lorg/springframework/http/HttpHeaders;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/AsyncContext;Ljava/lang/String;Lorg/springframework/core/io/buffer/DataBufferFactory;I)V
    at org.springframework.http.server.reactive.AasHttpHandlerAdapter$AasServerHttpRequest.<init>(AasHttpHandlerAdapter.java:79)
    at org.springframework.http.server.reactive.AasHttpHandlerAdapter.createRequest(AasHttpHandlerAdapter.java:48)
    at org.springframework.http.server.reactive.ServletHttpHandlerAdapter.service(ServletHttpHandlerAdapter.java:173)
    at com.apusic.ams.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at com.apusic.ams.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.apusic.ams.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at com.apusic.ams.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at com.apusic.ams.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at com.apusic.ams.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at com.apusic.ams.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at com.apusic.ams.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at com.apusic.ams.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at com.apusic.connector.http11.Http11Processor.service(Http11Processor.java:367)
    at com.apusic.connector.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:50.568 [http-nio2-8080-exec-4] ERROR c.a.c.h.Http11Nio2Protocol - [log,175] - Error reading request, ignored
java.lang.IllegalStateException: Calling [asyncPostProcess()] is not valid for a request with Async state [MUST_ERROR]
    at com.apusic.connector.AsyncStateMachine.asyncPostProcess(AsyncStateMachine.java:290)
    at com.apusic.connector.AbstractProcessor.asyncPostProcess(AbstractProcessor.java:191)
    at com.apusic.connector.AbstractProcessorLight.process(AbstractProcessorLight.java:81)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:50.572 [http-nio2-8080-exec-4] INFO  c.a.a.c.CoyoteAdapter - [log,175] - Encountered a non-recycled request and recycled it forcedly.
com.apusic.ams.connector.CoyoteAdapter$RecycleRequiredException: null
    at com.apusic.ams.connector.CoyoteAdapter.checkRecycled(CoyoteAdapter.java:525)
    at com.apusic.connector.http11.Http11Processor.recycle(Http11Processor.java:1314)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.release(AbstractProtocol.java:1071)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:1031)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:52.127 [http-nio2-8080-exec-5] ERROR c.a.a.c.C.[.[.[.[httpHandlerServlet] - [log,175] - Servlet.service() for servlet [httpHandlerServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
java.lang.NoSuchMethodError: org.springframework.http.server.reactive.ServletServerHttpRequest.<init>(Lorg/springframework/http/HttpHeaders;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/AsyncContext;Ljava/lang/String;Lorg/springframework/core/io/buffer/DataBufferFactory;I)V
    at org.springframework.http.server.reactive.AasHttpHandlerAdapter$AasServerHttpRequest.<init>(AasHttpHandlerAdapter.java:79)
    at org.springframework.http.server.reactive.AasHttpHandlerAdapter.createRequest(AasHttpHandlerAdapter.java:48)
    at org.springframework.http.server.reactive.ServletHttpHandlerAdapter.service(ServletHttpHandlerAdapter.java:173)
    at com.apusic.ams.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at com.apusic.ams.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.apusic.ams.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at com.apusic.ams.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at com.apusic.ams.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at com.apusic.ams.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at com.apusic.ams.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at com.apusic.ams.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at com.apusic.ams.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at com.apusic.connector.http11.Http11Processor.service(Http11Processor.java:367)
    at com.apusic.connector.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:52.129 [http-nio2-8080-exec-5] ERROR c.a.c.h.Http11Nio2Protocol - [log,175] - Error reading request, ignored
java.lang.IllegalStateException: Calling [asyncPostProcess()] is not valid for a request with Async state [MUST_ERROR]
    at com.apusic.connector.AsyncStateMachine.asyncPostProcess(AsyncStateMachine.java:290)
    at com.apusic.connector.AbstractProcessor.asyncPostProcess(AbstractProcessor.java:191)
    at com.apusic.connector.AbstractProcessorLight.process(AbstractProcessorLight.java:81)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:52.130 [http-nio2-8080-exec-5] INFO  c.a.a.c.CoyoteAdapter - [log,175] - Encountered a non-recycled request and recycled it forcedly.
com.apusic.ams.connector.CoyoteAdapter$RecycleRequiredException: null
    at com.apusic.ams.connector.CoyoteAdapter.checkRecycled(CoyoteAdapter.java:525)
    at com.apusic.connector.http11.Http11Processor.recycle(Http11Processor.java:1314)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.release(AbstractProtocol.java:1071)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:1031)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:57.153 [http-nio2-8080-exec-10] ERROR c.a.a.c.C.[.[.[.[httpHandlerServlet] - [log,175] - Servlet.service() for servlet [httpHandlerServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
java.lang.NoSuchMethodError: org.springframework.http.server.reactive.ServletServerHttpRequest.<init>(Lorg/springframework/http/HttpHeaders;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/AsyncContext;Ljava/lang/String;Lorg/springframework/core/io/buffer/DataBufferFactory;I)V
    at org.springframework.http.server.reactive.AasHttpHandlerAdapter$AasServerHttpRequest.<init>(AasHttpHandlerAdapter.java:79)
    at org.springframework.http.server.reactive.AasHttpHandlerAdapter.createRequest(AasHttpHandlerAdapter.java:48)
    at org.springframework.http.server.reactive.ServletHttpHandlerAdapter.service(ServletHttpHandlerAdapter.java:173)
    at com.apusic.ams.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at com.apusic.ams.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.apusic.ams.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at com.apusic.ams.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at com.apusic.ams.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at com.apusic.ams.core.StandardHostValve.invoke(StandardHostValve.java:139)
    at com.apusic.ams.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at com.apusic.ams.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
    at com.apusic.ams.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    at com.apusic.connector.http11.Http11Processor.service(Http11Processor.java:367)
    at com.apusic.connector.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:57.153 [http-nio2-8080-exec-10] ERROR c.a.c.h.Http11Nio2Protocol - [log,175] - Error reading request, ignored
java.lang.IllegalStateException: Calling [asyncPostProcess()] is not valid for a request with Async state [MUST_ERROR]
    at com.apusic.connector.AsyncStateMachine.asyncPostProcess(AsyncStateMachine.java:290)
    at com.apusic.connector.AbstractProcessor.asyncPostProcess(AbstractProcessor.java:191)
    at com.apusic.connector.AbstractProcessorLight.process(AbstractProcessorLight.java:81)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
15:09:57.154 [http-nio2-8080-exec-10] INFO  c.a.a.c.CoyoteAdapter - [log,175] - Encountered a non-recycled request and recycled it forcedly.
com.apusic.ams.connector.CoyoteAdapter$RecycleRequiredException: null
    at com.apusic.ams.connector.CoyoteAdapter.checkRecycled(CoyoteAdapter.java:525)
    at com.apusic.connector.http11.Http11Processor.recycle(Http11Processor.java:1314)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.release(AbstractProtocol.java:1071)
    at com.apusic.connector.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:1031)
    at com.apusic.aas.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1684)
    at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at com.apusic.aas.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:1105)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:599)
    at com.apusic.aas.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:577)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at com.apusic.aas.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:750)
 

springboot版本号:2.7.3

解决时间:2023-05-05

解决方案:mvn install附件的aams-spring-boot-starter-2.1.7.RELEASE.jar和aams-spring-boot-web-starter-2.4.0.jar,如果已有重新instsall 覆盖

界面现象:

日志截图:

解决操作: