2

I am migrating a JDK 1.4/JBoss 4.0.2 (yes, it's that old!) application to JDK 8/JBoss 6.4 EAP and am having an issue with one JSP page that is producing the error:

*The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit*

I understand why this is happening and have been working for the last two days on pulling code out of the JSP file with custom tags but it's still happening.

In this midst of this I decided to compare the Java code generated by the old environment that doesn't have this issue with the new environment and I'm seeing that the generated Java file is at least TWICE as large as the old one. A closer look shows that much of the extra is what I'd consider to be very poor optimization of the out.write() method call.

Case in point, I have the following simple code in the JSP:

<html>                  
<head>
<title>

Nothing special there. In the old generated Java I see:

out.write("\r\n<html>                  \r\n<head>\r\n<title>");

I think there are some extra spaces after the tag. But when I look at the new file generated by JBoss I see:

out.write("\r\n");
out.write("<html>                  \r\n");
out.write("<head>\r\n");
out.write("<title>");

So we have 4 out.write calls where only one was needed before. Looking through the code I see this pattern over and over.

I'm looking for any suggestions here. The custom tags are reducing the size of the code but the easy-pickins are gone and I'd rather not completely re-write all 4000 lines of this JSP since, of course, there is no time in the project for that even though it's badly needed.

Any ideas on why the JSP compiling I'm seeing is so terrible and is there any way to swap out the default JBoss 6.4 EAP JSP compiler with a better one?

jwh20
  • 646
  • 1
  • 5
  • 15
  • You could consider butchering the JSP to put ` ` all on one line. – user207421 Aug 19 '16 at 00:20
  • Yes, I could but that involves a lot of editing to make any headway. – jwh20 Aug 19 '16 at 01:07
  • Did you see ideas at http://stackoverflow.com/questions/5484253/jspservice-is-exceeding-the-65535-bytes-limit?rq=1 – rickz Aug 19 '16 at 01:17
  • I didn't find that particular posting but the method suggested, , is only partially useful. The markup is peppered with <%= %> tags that reference variables in <% %> code. So the can't be used for the bulk of the code since these variables are not available in the included context. – jwh20 Aug 19 '16 at 01:28
  • Any progress? Got the same issue. – Thomas Sep 19 '16 at 13:40
  • Not really. I gave up on this and went back to the old JSP compiler. It generates "better" code. – jwh20 Mar 27 '17 at 17:03

0 Answers0