Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sam E
Error in jsp execution: exceeding the 65535 bytes limit
October 18, 2009 5:22 AM
Answer

Sam E

Rank: Liferay Master

Posts: 660

Join Date: March 2, 2009

Recent Posts

Hi,

I dont' kown whether this is memory issue or my jsp file is too large to be delt with by the java compiler.
Here is the error I got when the jsp pages executed:

 1
 223:13:07,401 ERROR [IncludeTag:79] Current URL /web/guest generates exception: Unable to compile class for JSP:
 3
 4An error occurred at line: 417 in the generated java file
 5The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
 6
 7Stacktrace:
 823:13:07,471 ERROR [IncludeTag:165] org.apache.jasper.JasperException: Unable to compile class for JSP:
 9
10An error occurred at line: 417 in the generated java file
11The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
12
13Stacktrace:
14        at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
15        at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
16        at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
17        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
18        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
19        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
20        at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
21        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
22        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
23        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
24        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
25        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
26        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
27        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
28        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
29        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
30        at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:67)
31        at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3516)
32        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
33        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


My server has only not enough 1GB memory. Is this the problem?

Thanks
Sam
Sam E
RE: Error in jsp execution: exceeding the 65535 bytes limit
October 19, 2009 12:41 AM
Answer

Sam E

Rank: Liferay Master

Posts: 660

Join Date: March 2, 2009

Recent Posts

Had anyone solved the similar problem?
I would very appreciate for any suggestion and help.

Thanks
Sam
Tarun S. Kayasth
RE: Error in jsp execution: exceeding the 65535 bytes limit
February 16, 2010 5:59 AM
Answer

Tarun S. Kayasth

Rank: Regular Member

Posts: 159

Join Date: June 8, 2007

Recent Posts

Hi Sam,

I am facing same problem. Did you get any solution for it?

Thanks,

Tarun Kayasth
Amos Fong
RE: Error in jsp execution: exceeding the 65535 bytes limit
February 17, 2010 9:38 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1844

Join Date: October 7, 2008

Recent Posts

Hi Guys,

This looks like a bug that was fixed here:

http://issues.liferay.com/browse/LPS-7003

The fix is to change the .jspf file to a .jsp file (and changing some variables).
Tarun S. Kayasth
RE: Error in jsp execution: exceeding the 65535 bytes limit
February 18, 2010 8:29 PM
Answer

Tarun S. Kayasth

Rank: Regular Member

Posts: 159

Join Date: June 8, 2007

Recent Posts

Thanks Amos, will try this...
Gnaniyar Zubair
RE: Error in jsp execution: exceeding the 65535 bytes limit
February 19, 2010 11:15 PM
Answer

Gnaniyar Zubair

Rank: Liferay Master

Posts: 602

Join Date: December 19, 2007

Recent Posts

Hi Tarun and Sam,


Hope content size of jsp file is exceeded. just split that jsp file and include one inside another.


- Gnaniyar Zubair
Olaf Kock
RE: Error in jsp execution: exceeding the 65535 bytes limit
February 20, 2010 2:14 AM
Answer

Olaf Kock

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1855

Join Date: September 23, 2008

Recent Posts

Even without the fix - keep in mind, that a jsp is compiled into a java servlet class that outputs all the HTML code that you had in your jsp and also contains all the code that you wrote in the scriptlets on that jsp.

This servlet class will be compiled by javac to bytecode, loaded by the classloader and executed as if you wrote a servlet with loads of
1pageContext.getOut().write("<div>some HTML stuff</div>");


There's a java limit for a single method to contain only 2^16 bytes. So if you hit this limit you almost always have too a very complicated jsp and can work around this by externalizing parts of it to proper java classes and just call them from the jsp, shrinking your jsp dramatically. I've seen this more with generated jsps than hand written ones, as writing (and maintaining) such a beast will be a lot of pain...

Now that you understand the root cause, you might be able to work around it without applying a patch. Note: I've not taken a deeper look at the linked (fixed) issue - might be that you need the patch nevertheless, but you'll figure that out...
Qin Dou
RE: Error in jsp execution: exceeding the 65535 bytes limit
September 6, 2012 2:21 AM
Answer

Qin Dou

Rank: New Member

Posts: 1

Join Date: September 6, 2012

Recent Posts

can we use dynamic include to replace static includeemoticon
Bill Hillston
RE: Error in jsp execution: exceeding the 65535 bytes limit
September 6, 2012 3:48 AM
Answer

Bill Hillston

Rank: New Member

Posts: 4

Join Date: September 6, 2012

Recent Posts

>10000 Views now emoticon