While loading a jsp page in Tomcat , I get this error:
Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSP Generated servlet error:
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit"
Anyone tell me how to overcome this:
Plz consider this things
a)this is the problem with tomcat,since weblogic is able to load the same page
b)the jsp file is generated dynamically from other server.So size varies,unpredictable ::
c)if u tell me to split the jsp file,plz anyone tell me how to do it(consider that jsp file is dynamic)
well the reason weblogic dont crash is that it might have set that limit to a larger number.
If my memory is still ok then I think there could be a jvm flag to set to not inforce jsp compiled size limit. You will have to dig veeeeeery deep into tomcat documentation.
Second if you can split jsp page, then look for the sections where you create html code in loops, and try to create separate jsp pages for such sections and just import them into your main jsp.
Hope this helps
Thanks for the post... But I would like to know,how to set the JVM options.. i explored over the web.. I found one "by Configuring the command line parameters of OC4J Instance" ..
-reduceTagCode
boolean to specify further reduction in the size of generated code for custom tag usage
-extres external_resource
boolean to direct ojspc to generate an external resource file for static text from the .jsp file
But I suspect it is oracle related and has nothing to do much in tomcat..
please tell me if that can be applicable in tomcat..
But I suspect it is oracle related and has nothing to do much in tomcat..
.....
Thats correct. The setting that I was referring to has to do with JVM for tomcat. If that is not an option then you will have to look into my second suggestion of breaking your jsp into several parts (<jsp:include>)and import them into the main page
Last edited by Khalid Ali; 07-25-2007 at 06:51 PM.
If there is no option except to split the jsp ....can u please tell me more about that ..
The complexity here arises from splitting a dynamic JSP file ... I have identifed a few things from this jsp here..I suspect few lines like this cause the jsp file size to increase
Array Name -- Start Line -- End line -- No of lines
var xArray=new Array(" ") -- 1380 -- 3525 -- 2145
var yArray=new Array(" ") -- 3525 -- 12302 -- 8777
var zArray=new Array(" ") -- 12415 -- 21186 -- 8771
var mArray=new Array(" ") -- 21192 -- 22697 -- 1505 ---------
Total No of lines ( for arrray declaration only) -- 21198
So the arrary declaration itself spans a total of ~ 22K lines of code which is pretty large...
At this point ...How to split the method ???array declaration wise (or) some x no of lines wise ..
It ll be helpful if someone can give more ideas and if possible the code segment..
Thanks
Last edited by sakthi.abdullah; 07-26-2007 at 04:16 AM.
Bookmarks