Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java RestTemplate请求标头对于spring 4.1.3来说太大时出错_Java_Spring_Spring Resttemplate - Fatal编程技术网

Java RestTemplate请求标头对于spring 4.1.3来说太大时出错

Java RestTemplate请求标头对于spring 4.1.3来说太大时出错,java,spring,spring-resttemplate,Java,Spring,Spring Resttemplate,如何在SpringWeb应用程序中解决这个问题?它在JDK 1.7、Spring 4.1.3版本和WebLogic 10中工作,但当我们升级JDK 1.8、Spring 4.1.3版本和WebLogic 12.2时,它失败了。 我们可以在restemplate中增加标题大小吗。请让我知道 请查找以下错误 **<h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre&

如何在SpringWeb应用程序中解决这个问题?它在JDK 1.7、Spring 4.1.3版本和WebLogic 10中工作,但当我们升级JDK 1.8、Spring 4.1.3版本和WebLogic 12.2时,它失败了。 我们可以在
restemplate
中增加标题大小吗。请让我知道

请查找以下错误

**<h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>"
2020-11-10 12:06:05.574 headers [DEBUG] http-outgoing-0 << HTTP/1.1 431 Request Header Fields Too Large
2020-11-10 12:06:05.574 headers [DEBUG] http-outgoing-0 << Content-Type: text/html;charset=iso-8859-1
2020-11-10 12:06:05.574 headers [DEBUG] http-outgoing-0 << Content-Length: 74
2020-11-10 12:06:05.590 headers [DEBUG] http-outgoing-0 << nnCoection: close
2020-11-10 12:06:05.590 MainClientExec [DEBUG] Connection can be kept alive indefinitely
2020-11-10 12:06:05.590 PoolingHttpClientConnectionManager [DEBUG] Connection [id: 0][route: {s}-> can be kept alive indefinitely
2020-11-10 12:06:05.590 DefaultManagedHttpClientConnection [DEBUG] http-outgoing-0: set socket timeout to 0
2020-11-10 12:06:05.590 PoolingHttpClientConnectionManager [DEBUG] Connection released: [id: 0][route: {s}->][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
2020-11-10 12:06:05.605 ServiceImpl [ERROR] ValidateToken Service failed with this exception: <h1>Bad Message 431</h1><pre>reason: Request Header Fields Too Large</pre>
2020-11-10 12:06:05.637 ExceptionControllerAdvice [ERROR] Unhandled exception.
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at com.agreement.rest.domain.Exception.fromJsonToException(Exception.java:78)**
**错误消息431原因:请求标头字段太大”

2020-11-10 12:06:05.574标题[调试]http-outgoing-0我已经用HTTPURLConnection解决了这个问题

我已经用HTTPURLConnection解决了这个问题

你从服务器上得到了一个错误,所以即使你可以,服务器也会出错。我们正在使用weblogic12我们是否可以在服务器端而不是你的服务器上增加其他应用程序正在运行的服务器。你可能还想检查他在你发送大标题时发送了标题,这可能是错误所在。例如,发送太多Cookie或太大的Refer标题。感谢你的回复Deinum。它在JDK 1.7、Spring 4.1.3版本和WebLogic 10中工作,但在JDK 1.8、Spring 4.1.3版本和Weblogic12中失败。这是我们发送令牌的重定向URLh很大,我们希望按照项目要求发送此令牌。这是您决定不考虑的关键信息。请将此信息添加到问题中。您没有提到它在升级之前工作。您从服务器收到一个错误,因此即使您可以,服务器也会出错。我们正在使用weblogic12我们可以在服务器端增加吗?不是您的服务器,其他应用程序正在运行的服务器。另外,您可能希望在发送大标题时检查标题,这可能是错误所在。例如,发送太多Cookie或太大的Refer标题。感谢您的回复Deinum。它在JDK 1.7 Spring 4.1.3 R中工作ELEASE和WebLogic 10,但JDK 1.8、Spring 4.1.3版本和Weblogic12中的失败这是重定向URL我们正在发送令牌,这是一个很大的令牌,我们希望根据项目要求发送此令牌现在这是一个关键信息,您决定将其排除在问题之外。请将其添加到问题中。您没有提到它是在升级之前,它正在工作!。