Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'code too large for try statement'-error message

 
Peter Karbusicky
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am involved in supervising a JavaServer-Pages-Application.
Everything worked out perfectly since about 2 years, but now we suddenly
get the following error message when our jsp-files are being compiled :

'code too large for try statement'

I've read somewhere, that actually there is a limit of 64K for such a try-code-segment, but however - is there an opportunity of increasing this limit up to a higher boundary ?
Maybe some configuration-parameter within the compiler or something like that ?
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Web/App Server you are running with.

If its Weblogic 8.1 please look at the below URL.

http://www.theserverside.com/discussions/thread.tss?thread_id=28758

Few suggested Solutions over there are:

1. Refactor the JSP page into smaller page and use include directive

2.Use the -noTryBlocks switch for JSPC, see
http://e-docs.bea.com/wls/docs61/jsp/reference.html

3. Try the solution suggested at
http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_solution&answerpage=solution&page=wls/S-26541.htm
 
Sumit Deshpande
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Pls let me know if this is specifically related to WebLogic 8.1 ... I have a file with around 1500 lines inside a try block and its working fine on 7.1

Regards,
Sumit.
 
Steven Bell
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1500 lines in a try block???

maybe you should submit some of that here
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refactoring is my best bet.
 
Sumit Deshpande
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do agree that this jsp file with 1500 lines inside a try block is totally against the norms ...
Just to complete the discussion, this problem arises on WL 8.1 SP3.
It seems to be working fine with SP1 and SP2.

Regards,
Swapnil.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic