项目

一般

简介

V10企业版报: java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens异常

由 李 晓飞 在 将近 3 年 之前添加

完整报错信息:

18-Jan-2022 00:54:35.055 INFO [ApusicConsoleHandler] com.apusic.connector.http11.Http11Processor.service Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.
        java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens
                at com.apusic.connector.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:416)
                at com.apusic.connector.http11.Http11Processor.service(Http11Processor.java:260)
                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.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1685)
                at com.apusic.aas.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
                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:748)

原因:客户一开始访问拿https访问的,所以导致方法名称中发现无效字符。HTTP方法名必须是令牌。

解决办法:将https换成http访问