I am getting intermittent java.lang.IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokens error in server application.
The server accepts HTTP and I have checked (scanned) client code and I am not making HTTPS requests anywhere from the client.
My client is a flutter application and makes the request as http://192.168.1.26:8087/sendSmsFromMobileToSmsWeb
Dump of the exception is:
java.lang.IllegalArgumentException: Invalid character found in method name [0x160x030x010x000xee0x010x000x000xea0x030x03j0x820xed0x970xff0xbfr0xc90xaaq0xb70x940xcf0xbbf0x960x0c0xc7\0xa4Cf0xc10x870x0eY28F0xce0x080x11 ].
HTTP method names must be tokens
at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:419) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:269) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.53.jar!/:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.53.jar!/:na]
at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na]
The server application works 99% of the time and all of a sudden even (/normally) without any request from the client service will print this error. The server continues after that without any issue.