File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes 'code too large for try statement'-error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark " Watch " New topic

'code too large for try statement'-error message

Peter Karbusicky

Joined: Feb 16, 2005
Posts: 1
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

Joined: Feb 09, 2004
Posts: 160
What Web/App Server you are running with.

If its Weblogic 8.1 please look at the below URL.

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

3. Try the solution suggested at

Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
Sumit Deshpande
Ranch Hand

Joined: Jan 10, 2005
Posts: 38

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

Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
1500 lines in a try block???

maybe you should submit some of that here
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Refactoring is my best bet.
Sumit Deshpande
Ranch Hand

Joined: Jan 10, 2005
Posts: 38
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.

I agree. Here's the link:
subject: 'code too large for try statement'-error message
jQuery in Action, 3rd edition