I ran into a baffling problem yesterday with a jsp. Using the struts tag library, I had a logic:iterate over a large block of code that displays a lot of data which also had some iterates in side of it. Upon trying run the page on a WAS server, I got the compile error "unable to compile class for jsp...code too large for try statement..." Apparently the struts logic tag generates a try/catch statement when the java class is compiled. I solved the problem by getting rid of the logic:iterate tag and using a scriptlet to iterate over the code.
Has anyone seen this before, or have any insight into why this is the case?
Thanks in advance.
Joined: Mar 11, 2005
thank for the move, but this isn't a struts issue. after further research, the problem seems to be that the servlet container (WAS) is this instance compiles the jsp into a java file in which all of the code is contained within a try/catch block.
The Java� specification states that there is a 64 K limit on the size of methods in Java. The JVM� does not execute methods that exceed this limit.
It is possible to compile methods larger than 64 K, but the JVM will not run these methods. Consequently, the error occurs during runtime, while attempting to execute Java methods that are greater than 64 K.
A code too large for try statement error can still be issued while compiling a JSP. The compiler limitation does not allow try/catch blocks to have a start or end location greater than 64 K into the method code. Therefore, compiler limitations are usually caught when a try/catch block overlaps the 64 K boundary.