on 2022 Nov 16 1:58 AM
Hi Experts,
We have a custom Action which processes an Arrays of requests and sends a response. We are using The Messages API for gathering success and error messages
For a complete successful payload (no errors found) we are get this in the logs. The sap-messages header is obviously too large 😞
Where do we update this setting when running in BAS and when on BTP Foundry???
org.apache.coyote.http11.HeadersTooLargeException: An attempt was made to write more
data to the response headers than there was room available in the buffer.
Increase maxHttpHeaderSize on the connector or write less data into the response headers.<br>
Request clarification before answering.
You can control the maximum HTTP header size by standard Spring configuration, e.g.
server.max-http-header-size: 16KB
to increase header size to 16KB (default is 8KB). Make sure that other components (e.g. AppRouter if existing) does also allow this adapted header size.
You should also consider to reduce amount of written data. Why are the messages that large in case of successful execution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please note that in case you are deploying your app as a WAR file you need to configure the tomcat container. Check this documentation in case you are using the SAP Java Buildpack with a WAR based deployment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I assume your CAP Java application is running with spring-boot and an Apache Tomcat as web engine. In this case you can try to increase the maxHttpHeaderSize as it's suggested in the exception message. The default header size is about 8k, but you are trying to write more data into the response header. For this reason you get the exception.
I found this article about increasing this parameter: https://www.baeldung.com/spring-boot-max-http-header-size#overview-1
You can configure this parameter in the application.yaml of your CAP Java application.
Thanks,
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.