SAP / SapMachine

An OpenJDK release maintained and supported by SAP
https://sapmachine.io
GNU General Public License v2.0
504 stars 92 forks source link

Getting error after upgrading to Tomcat 10 #1776

Closed chaitrahp closed 1 month ago

chaitrahp commented 1 month ago

Hello Team,

We are getting the below error in our application when we try to spawn the thread. This is occurring for tomcat 10.

java.lang.IllegalStateException: The request object has been recycled and is no longer associated with this facade at org.apache.catalina.connector.RequestFacade.checkFacade(RequestFacade.java:856) ~[tomcat-embed-core-10.1.8.jar:10.1.8] at org.apache.catalina.connector.RequestFacade.getQueryString(RequestFacade.java:578) ~[tomcat-embed-core-10.1.8.jar:10.1.8] at jakarta.servlet.http.HttpServletRequestWrapper.getQueryString(HttpServletRequestWrapper.java:157) ~[tomcat-embed-core-10.1.8.jar:6.0]

We tried adding the below configuration in yaml file, but this is not solving the issue.

JAVA_OPTS: '-XX:MaxMetaspaceSize=400m -XX:MaxDirectMemorySize=400m -XX:ReservedCodeCacheSize=240m -Xshare:off -Dspring.security.strategy=MODE_INHERITABLETHREADLOCAL -Dorg.apache.catalina.connector.RECYCLE_FACADES=false'

JBP_CONFIG_JAVA_OPTS: "[java_opts: '-XX:MaxMetaspaceSize=400m -XX:MaxDirectMemorySize=400m -XX:ReservedCodeCacheSize=240m -Xshare:off -Dspring.security.strategy=MODE_INHERITABLETHREADLOCAL -Dorg.apache.catalina.connector.RECYCLE_FACADES=false']" JBP_CONFIG_JAVA_OPTS: "[java_opts: '-Dorg.apache.catalina.connector.RECYCLE_FACADES=false']"

JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomcat/conf/server.xml': {'connector.maxHttpHeaderSize': 32768 , 'connector.compression':'on', 'connector.discardFacades':'false'}]"

Please let us know the correct way of handling this issue.

Thanks, Chaitra H P

MBaesken commented 1 month ago

Most likely not a JVM/SapMachine issue. From what I read here https://stackoverflow.com/questions/78360804/the-request-object-has-been-recycled-and-is-no-longer-associated-with-this-facad Tomcat 10 recycles objects more aggressively (compared to version 9) and that's why you see this. But I am not a Tomcat expert, maybe some others have seen this as well and can confirm some workaround.