java.lang.NoSuchMethodError: io.netty.util.internal.PlatformDependent.allocateUninitializedArray(I)[ 我不是女神ヾ 2021-12-21 02:35 602阅读 0赞 FullHttpRequest request = new DefaultFullHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, url.toASCIIString()); request.headers() .set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON) .set(HttpHeaderNames.CONNECTION,HttpHeaderValues.KEEP_ALIVE); 执行url.toASCIIStrin() 方法时: 2019-06-28 09:45:42,695 ------ ERROR [http-nio-8089-exec-1] Caller+0 at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:181) - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: io.netty.util.internal.PlatformDependent.allocateUninitializedArray(I)[B] with root cause java.lang.NoSuchMethodError: io.netty.util.internal.PlatformDependent.allocateUninitializedArray(I)[B at io.netty.util.AsciiString.<init>(AsciiString.java:222) at io.netty.util.AsciiString.<init>(AsciiString.java:209) at io.netty.util.AsciiString.cached(AsciiString.java:1401) at io.netty.util.AsciiString.<clinit>(AsciiString.java:47) at io.netty.handler.codec.http.HttpHeaderNames.<clinit>(HttpHeaderNames.java:31) at com.damai.park.acs.unv.request.TerminalHttpCall.queryLibInfo(TerminalHttpCall.java:107) at com.damai.park.acs.unv.service.LibInfoServiceImpl.query(LibInfoServiceImpl.java:39) at com.damai.park.acs.controller.FeignController.queryLibInfo(FeignController.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) pom.xml 中引入的包是: <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.36.Final</version> </dependency> 初步查看报错的原因,就是方法找不到,那就可能是jar包依赖问题。google之后发现解决办法,就是加入依赖 <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.36.Final</version> </dependency> <dependency> <groupId>com.corundumstudio.socketio</groupId> <artifactId>netty-socketio</artifactId> <version>1.7.17</version> </dependency> 然后就不报这个错了,就是jar的依赖问题 参考: [https://github.com/mrniko/netty-socketio/issues/496][https_github.com_mrniko_netty-socketio_issues_496] [https_github.com_mrniko_netty-socketio_issues_496]: https://github.com/mrniko/netty-socketio/issues/496
还没有评论,来说两句吧...