-
Bug
-
Resolution: Done
-
Minor
-
JWS 3.1.0 SP1 CR2, JWS 4.0.0 DR2
-
None
When reading the Tomcat Documentation, the maxCookieCount says: "... A value of less than zero means no limit. ..." However, when setting the value to -1 in server.xml and send a request with cookies, I get the following error:
19-Sep-2017 13:21:14.318 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 766 ms 19-Sep-2017 13:21:46.590 SEVERE [http-nio-8080-exec-1] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NegativeArraySizeException at org.apache.tomcat.util.http.ServerCookies.addCookie(ServerCookies.java:53) at org.apache.tomcat.util.http.parser.Cookie.parseCookieRfc6265(Cookie.java:235) at org.apache.tomcat.util.http.parser.Cookie.parseCookie(Cookie.java:122) at org.apache.tomcat.util.http.Rfc6265CookieProcessor.parseCookieHeader(Rfc6265CookieProcessor.java:90) at org.apache.catalina.connector.Request.parseCookies(Request.java:3099) at org.apache.catalina.connector.Request.getServerCookies(Request.java:2169) at org.apache.catalina.connector.CoyoteAdapter.parseSessionCookiesId(CoyoteAdapter.java:1007) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:714) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
This happens on:
- JWS 3.1, Tomcat 7 and 8
- JWS 4 DR2
This is likely caused in ServerCookies.java, the following line of code:
ServerCookie scookiesTmp[] = new ServerCookie[newSize];
- is caused by
-
JWS-501 Add a limit (default 200) for the number of cookies allowed per request
- Closed
- links to