*
The moose likes BEA/Weblogic and the fly likes Increasing the size limit of compiled JSP files to more than 65KB. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Increasing the size limit of compiled JSP files to more than 65KB." Watch "Increasing the size limit of compiled JSP files to more than 65KB." New topic
Author

Increasing the size limit of compiled JSP files to more than 65KB.

Jack Numen
Ranch Hand

Joined: Nov 09, 2011
Posts: 42

Hi,
We are facing an issue regarding JSP compilation .If the file siae is more than 65KB the server is throwing error like maximum file size exceeded.

Lets say files of size <65KB are getting compiled where as files of size >65KB are not being compiled .

1)Is there any configuration parameter which can be changed so that the server compiles files of size atleast 200KB.
2)Also let me know why is this limit on file size kept?


Thanks,
Jack
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 191

This is a limitation of JVM specification and not a WLS issue (and it cannot be modified).

http://docs.oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#36726


http://devwebcl.blogspot.com/
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

I'd suggest you break up your JSP page into chunks (different JSP files included in the main page) to avoid the problem.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61772
    
  67

Deepak Bala wrote:I'd suggest you break up your JSP page into chunks (different JSP files included in the main page) to avoid the problem.

I disagree. That's just a band-aid that increases complexity and masks the real problem.

The major reason that JSPs get this big is because they are chock full of reams of Java scriptlet code. The actual fix is to refactor the JSP to contain no Java code as modern standards dictate. When JSPs only contain view, as they should, it's highly unlikely they'll reach this limit.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5


The major reason that JSPs get this big is because they are chock full of reams of Java scriptlet code. The actual fix is to refactor the JSP to contain no Java code as modern standards dictate. When JSPs only contain view, as they should, it's highly unlikely they'll reach this limit.


The OP never mentioned if the limit was hit due to scriptlets or a page with thousands of JSP tags. If it is due to scriptlets, then yes, using tags would be a good way to avoid the problem. If there are a crazy number of tags in the page itself, the OP has no other option than to break up the page.

Thankfully I've never come across these behemoths at work.
German Gonzalez-Morris
Ranch Hand

Joined: Nov 16, 2009
Posts: 191

Bear Bibeault wrote:
Deepak Bala wrote:I'd suggest you break up your JSP page into chunks (different JSP files included in the main page) to avoid the problem.

I disagree. That's just a band-aid that increases complexity and masks the real problem.

The major reason that JSPs get this big is because they are chock full of reams of Java scriptlet code. The actual fix is to refactor the JSP to contain no Java code as modern standards dictate. When JSPs only contain view, as they should, it's highly unlikely they'll reach this limit.


that's correct for a good design. However there are plenty of legacy code that should be migrated to new application servers, and the final bytecode after recompiling is bigger than old one.
So in these circumstances to divide the code in smaller parts is a helpful band-aid, otherwise the project would be to recreate the whole application and probably that's is more expensive.

In real life, I remember a huge JSP/Struts page with no scriptlet at all, however the final bytecode also was bigger than 64kb. The workaround was to break down into smaller parts.
Just like mentioned this was a design issue (usability indeed)...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Increasing the size limit of compiled JSP files to more than 65KB.