• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

code too large for try statement

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Michael Beck
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

from http://publib.boulder.ibm.com/infocenter/wasinfo/v4r0/index.jsp?topic=/com.ibm.support.was.doc/html/Java_SDK/1177375.html

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.
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic