Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

net::ERR_INCOMPLETE_CHUNKED_ENCODING SPRING MVC application using JSP

I have developed a web application using SPRING MVC and JSP, now these applications work perfectly fine locally, but when I deployed on the server I am receiving this error. And nothing gets loaded.

This happens with all the page, except login page. Only login page gets displayed successfully. I have monitored the tomcat logs, but no exception there.

Googled whole day but still not able to figure out the root cause for that, please suggest me if you know about this.

chorome network info, show status faul

like image 234
mahesh Avatar asked Jul 19 '15 17:07

mahesh


1 Answers

The remote Tomcat could possibly have a smaller default write buffer size, direct buffer partially configured, or more likely the server may just may have more data it wants to return in a request.

Anyway to see what the values are, temporarily, stick the following tag at the bottom of the body of your login pages JSP, and one broken page.

<% out.println("<p>bufferSize: " + out.getBufferSize() + " remaining: " + out.getRemaining() + " used: " + (out.getBufferSize() - out.getRemaining()) + " autoFlush: " + out.isAutoFlush() + "</p><br>"); %>

You should see something like:

bufferSize: 8192 remaining: 1509 used: 6683 autoFlush: true

As a potential quick fix, see if the non working page will render with no buffer, by say sticking the following tag at the top of JSP page:

<%@ page buffer="none" %>

If still no luck pick a large number, say 8MB (vs 8KB), and see if that's enough for your page to render, by adding a:

<%@ page buffer="8192kb" %>

If that solves the issue, then simply note the used bufferSize on page, add a bit and tweak, so for:

bufferSize: 8380416 remaining: 8321883 used:58533 autoFlush: true

You'd probably get away with:

<%@ page buffer="64kb" %>

If still no luck I suspect you have a broken loop in your JSP.

Note: Don't leave the page buffer at a silly number, as there's a single pool that's shared between all connections.

like image 72
arober11 Avatar answered Sep 23 '22 00:09

arober11