昨天碰到一个问题:同一个请求页面,页面经过匹配后调用http的post协议接口,部署在linux环境的没问题,本地Eclipse启动的tomcat也没问题,直接启动本地tomcat却报错了:
18:45:20.644 INFO cn.migu.newportal.pg.async.pool.ExecutorServiceManager 124 getResult - responseBody<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Request processing failed; nested exception is com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Root Cause</b></p><pre>com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1
com.google.gson.internal.Streams.parse(Streams.java:62)
com.google.gson.JsonParser.parse(JsonParser.java:84)
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1053)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:286)
cn.migu.wheat.service.ServiceProvider.buildParamter(ServiceProvider.java:150)
cn.migu.wheat.service.ServiceProvider.servletInvoke(ServiceProvider.java:190)
org.ms.selection.controller.ServiceController.invoke(ServiceController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Root Cause</b></p><pre>java.nio.charset.MalformedInputException: Input length = 1
java.nio.charset.CoderResult.throwException(CoderResult.java:281)
org.apache.tomcat.util.buf.B2CConverter.convert(B2CConverter.java:259)
org.apache.catalina.connector.InputBuffer.realReadChars(InputBuffer.java:413)
org.apache.catalina.connector.InputBuffer.checkCharBufferEof(InputBuffer.java:637)
org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:455)
org.apache.catalina.connector.CoyoteReader.read(CoyoteReader.java:108)
com.google.gson.stream.JsonReader.fillBuffer(JsonReader.java:1287)
com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1325)
com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1567)
com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
com.google.gson.internal.Streams.parse(Streams.java:46)
com.google.gson.JsonParser.parse(JsonParser.java:84)
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1053)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:286)
cn.migu.wheat.service.ServiceProvider.buildParamter(ServiceProvider.java:150)
cn.migu.wheat.service.ServiceProvider.servletInvoke(ServiceProvider.java:190)
org.ms.selection.controller.ServiceController.invoke(ServiceController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/8.5.13</h3></body></html>
responseBody<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Request processing failed; nested exception is com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Root Cause</b></p><pre>com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1
com.google.gson.internal.Streams.parse(Streams.java:62)
com.google.gson.JsonParser.parse(JsonParser.java:84)
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1053)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:286)
cn.migu.wheat.service.ServiceProvider.buildParamter(ServiceProvider.java:150)
cn.migu.wheat.service.ServiceProvider.servletInvoke(ServiceProvider.java:190)
org.ms.selection.controller.ServiceController.invoke(ServiceController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Root Cause</b></p><pre>java.nio.charset.MalformedInputException: Input length = 1
java.nio.charset.CoderResult.throwException(CoderResult.java:281)
org.apache.tomcat.util.buf.B2CConverter.convert(B2CConverter.java:259)
org.apache.catalina.connector.InputBuffer.realReadChars(InputBuffer.java:413)
org.apache.catalina.connector.InputBuffer.checkCharBufferEof(InputBuffer.java:637)
org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:455)
org.apache.catalina.connector.CoyoteReader.read(CoyoteReader.java:108)
com.google.gson.stream.JsonReader.fillBuffer(JsonReader.java:1287)
com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1325)
com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1567)
com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
com.google.gson.internal.Streams.parse(Streams.java:46)
com.google.gson.JsonParser.parse(JsonParser.java:84)
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1053)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:286)
cn.migu.wheat.service.ServiceProvider.buildParamter(ServiceProvider.java:150)
cn.migu.wheat.service.ServiceProvider.servletInvoke(ServiceProvider.java:190)
org.ms.selection.controller.ServiceController.invoke(ServiceController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/8.5.13</h3></body></html>
18:45:20.674 INFO cn.migu.newportal.pg.async.pool.ExecutorServiceManager 165 getResult - json 解析失败net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of <!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Request processing failed; nested exception is com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:979)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Root Cause</b></p><pre>com.google.gson.JsonIOException: java.nio.charset.MalformedInputException: Input length = 1
com.google.gson.internal.Streams.parse(Streams.java:62)
com.google.gson.JsonParser.parse(JsonParser.java:84)
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1053)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:286)
cn.migu.wheat.service.ServiceProvider.buildParamter(ServiceProvider.java:150)
cn.migu.wheat.service.ServiceProvider.servletInvoke(ServiceProvider.java:190)
org.ms.selection.controller.ServiceController.invoke(ServiceController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Root Cause</b></p><pre>java.nio.charset.MalformedInputException: Input length = 1
java.nio.charset.CoderResult.throwException(CoderResult.java:281)
org.apache.tomcat.util.buf.B2CConverter.convert(B2CConverter.java:259)
org.apache.catalina.connector.InputBuffer.realReadChars(InputBuffer.java:413)
org.apache.catalina.connector.InputBuffer.checkCharBufferEof(InputBuffer.java:637)
org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:455)
org.apache.catalina.connector.CoyoteReader.read(CoyoteReader.java:108)
com.google.gson.stream.JsonReader.fillBuffer(JsonReader.java:1287)
com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1325)
com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1567)
com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
com.google.gson.internal.Streams.parse(Streams.java:46)
com.google.gson.JsonParser.parse(JsonParser.java:84)
com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1053)
com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:286)
cn.migu.wheat.service.ServiceProvider.buildParamter(ServiceProvider.java:150)
cn.migu.wheat.service.ServiceProvider.servletInvoke(ServiceProvider.java:190)
org.ms.selection.controller.ServiceController.invoke(ServiceController.java:53)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)
</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/8.5.13</h3></body></html>
18:45:20.735 INFO cn.migu.newportal.pg.async.pool.ResultCallable 119 call - isVisiable is 1
经过调试发现匹配后的post请求中存在中文,因此怀疑是中文编码问题。在linux下是utf-8
[pguser1@ZJHZ-CMREAD-TEST126 ~]$ echo $LANG
en_US.UTF-8
Eclipse工具里配置的也是utf-8
而本地tomcat默认是GBK,需要改为utf-8,在tomcat的bin/catalina.bat加入如下设置即可
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -Dfile.encoding=UTF-8"
重新启动tomcat后问题解决