相关链接:
http://topic.csdn.net/t/20041111/20/3544983.htmlhttp://www.iteye.com/post/57265http://www.javaworld.com.tw/jute/post/view?bid=6&id=34678&sty=3http://marc.info/?l=struts-user&m=98512887614286&w=2具体问题:
我的JSP文件太大有300多K,这个主要是因为系统一直在维护,很多人因为各种功能需求对这个JSP做了修改,本来编译和运行都是没有问题的,但奇怪的是我只多加了一段HTML代码就出现了这个问题,说了大家可能不信,我只多加了一个<td>kkkee</td>,就出问题了,代码如下:注释的部分是我加的,加了后就出问题:
- <tr>
-
<tdwidth=""CLASS="fmkey"valign="top">BuCode:</td>
-
<tdwidth=""class="fmvalue"align="left">
-
<INPUTTYPE="TEXT"NAME="BuCode"SIZE="23"CLASS="<%=sStyle%>">
- </span>
- </td>
- <td>
-
<INPUTTYPE="BUTTON"NAME=""VALUE="..."CLASS="btnLook"onClick="openLookupGen(arrSetBuCode,arrGetBuCode,'<%=EusUtil.getPage("lookup.generic.bucode.s")%>',arrBuCodeParam,640,480,'yes')">
- sfsfsf
- </td>
- <!--<td>kkkee</td>-->
- </tr>
具体问题如下:
- <<2008-12-1110:19:57.750>>(HttpUtil)ErrorMsg:callpage
-
ExceptionMsg:org.apache.jasper.JasperException:UnabletocompileclassforJSP
-
Anerroroccurredatline:-1inthejspfile:null
- Generatedservleterror:
- [javac]Compiling1sourcefile
-
C:\DOCUME~1\WEIFEN~1\LOCALS~1\Temp\Jetty_0_0_0_0_8080__GeTSmart\Tdec_jsp.java:147:codetoolargefortrystatement
-
try{
- ^
- 1error
- atorg.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
- atorg.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
- atorg.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
- atorg.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
- atorg.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
- atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
- atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
- atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:192)
- atorg.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:129)
- atcom.gobusiness.eus.util.HttpUtil.callPage(HttpUtil.java:225)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doPost(CreateDocServlet.java:365)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doGet(CreateDocServlet.java:76)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:740)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1714)
- atorg.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1664)
- atorg.mortbay.http.HttpServer.service(HttpServer.java:863)
- atorg.jboss.jetty.Jetty.service(Jetty.java:460)
- atorg.mortbay.http.HttpConnection.service(HttpConnection.java:775)
- atorg.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
- atorg.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
- atorg.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
- atorg.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
- atorg.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
也有出现这个问题:
(Codeofamethodlongerthan65535bytes)
- ExceptionMsg:javax.servlet.ServletException:org/apache/jsp/Tdec_jsp(Codeofamethodlongerthan65535bytes)
- atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:192)
- atorg.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:129)
- atcom.gobusiness.eus.util.HttpUtil.callPage(HttpUtil.java:225)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doPost(CreateDocServlet.java:365)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doGet(CreateDocServlet.java:76)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:740)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1714)
- atorg.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1664)
- atorg.mortbay.http.HttpServer.service(HttpServer.java:863)
- atorg.jboss.jetty.Jetty.service(Jetty.java:460)
- atorg.mortbay.http.HttpConnection.service(HttpConnection.java:775)
- atorg.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
- atorg.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
- atorg.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
- atorg.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
- atorg.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
查了相关的资料:
http://marc.info/?l=struts-user&m=98512887614286&w=2这个帖子解释的比较清楚,还提供了相关的办法
-
Theproblemisthatthereisalimitonthesizeofacompiledmethodina
-
Javaclassfile,andthatlimitiswhatwe'rerunningupagainst.Recall
-
thataJSPpageiscompiledintoaservlet,andintoessentiallyonlyone
-
methodinthatservlet.Hence,ifyourpagecontainsmany,manytags,that
- methodbecomestoobig,andupcomestheexceptionthatyou'reseeing.
主要原因是JAVA文件中对方法有一个大小限制,最大不超过64K,而我的JSP中编译成SERVLET代码的时候就变成了service方法,
这个方法的大小不能超过64K,当JSP文件太大的时候编译成的serviece方法自然就超过了,所以会提供
codetoolargefortrystatement,解决方法有:
- Thereareacoupleof(partial)solutions.
- 1)Breakyourgiantpageupintomultiplesmallerpagesandbringthem
-
togetheratruntimeusing<jsp:include>.Notethat<%@include>won'twork,
-
becausethat'sacompile-timeinclude,whichwillgetyoustraightbackto
- theoriginalproblem.
-
2)Lookforplacestosaveontags.Forexample,the<html:option>tagwas
- recentlyextendedtoallowthespecificationofthetexttodisplay,so
-
thatyoucanreplacethis:
-
<html:option...><bean:messagekey="foo"/></html:option>
-
withthis:
-
<html:option...key="foo"/>
主要有两个解决方法:一个是拆分成多个JSP文件,使用JSP:INCLUDE命令而不是使用<%@INCLUDE%>命令。
第二个是针对使用JSTL或自定义标签的情况,尽量使用产生代码少一些的标签。
在帖子:http://www.iteye.com/post/57265
提到WEBLOG解决了这个问题:- weblogic9解决了这个问题,发布在他上面就不会有任何问题了。我试过了。这个问题也困扰了我们项目组很久。
这个我没有试过。
分享到:
相关推荐
在Linux环境下进行文件操作时,可能会遇到一个名为“Value too large for defined data type”的错误。这一问题通常发生在使用`ls`或`find`命令来查看大于2GB(即2^31字节)的文件时。虽然现代操作系统理论上支持...
delphi7编译慢 或linking阶段会出错 经常会出现内存泄漏或不足 或RLink32.DLL访问出错 直接把bolndmm.dll与rlink32.dll拷贝至delphi7下的bin目录中可以调试了 按网友的说法 新版的内存管理器或连接器 bolndmm.dll...
《E-Code Explorer 0.86正式版:易语言反编译利器解析》 在IT领域,软件开发工具的多样性使得程序员们能够更高效地完成工作。其中,易语言作为一款面向中国用户的编程语言,以其简洁易懂的语法赢得了众多开发者喜爱...
将JSP与MySQL相结合,可以构建出高效且可扩展的Web应用程序。本篇文章将深入讲解如何使用JDBC(Java Database Connectivity)驱动程序5.1版本在JSP中连接到MySQL数据库。 首先,我们要了解JDBC驱动程序的作用。JDBC...
### 5个方法解决Keil全部编译的问题 在嵌入式系统开发过程中,使用Keil作为集成开发环境(IDE)是非常常见的选择。然而,在实际使用过程中,有时会遇到一个令人头疼的问题——无论何时编译工程,Keil总是执行全部...
所以在下载来的,不能完成反编译出源码,要看源码的最好是在网站编译,下面有链接链接: http://www.remotesoft.com/salamander/ http://www.remotesoft.com/salamander/obfuscator/try.html Remotesoft .NET Explorer ...
CodeWarrior Development Studio for S12(X) V5.1.
解决"jsp页面加载时提示loading"的问题需要从多方面进行排查和优化,包括页面内容优化、服务器性能提升、网络条件改善、代码错误检查、缓存策略调整、服务器配置优化、数据库性能优化、AJAX请求优化、JavaScript脚本...
在进行JSP培训时,通常会涵盖以下几个方面: 1. **基础概念**:讲解JSP的原理、结构以及与其他Web技术的关系。 2. **JSP语法**:深入理解JSP的各种元素和指令,以及如何使用它们来创建动态页面。 3. **EL和JSTL**:...
Telerik kendo ui for JSP Demo。Kendo UI的for JSP版本,整个B/S工程,后台技术是spring+hibernate。 如果用kendo ui做前台js呈现,这个非常值得一看。因为JSP标签库,最终编译后还是生成了js的代码,有利于调试...
《现代编译原理》(通常被称为“虎书”),是由著名计算机科学家Alfred V. Aho、Monica S. Lam、Ravi Sethi和Jeffrey D. Ullman合著的经典教材,它深入浅出地介绍了编译器设计的各个方面。这本书是许多计算机科学...
《全面解析JSP+MySQL构建图书管理系统》 在IT领域,构建信息管理系统是常见的实践,尤其对于初学者来说,图书管理系统是一个很好的学习项目。本文将深入探讨如何利用JSP(JavaServer Pages)技术和MySQL数据库来...
Python反编译是将已经编译过的Python字节码(.pyc文件)转换回源代码(.py文件)的过程,这对于理解闭源代码、学习他人代码或逆向工程等场景非常有用。以下是一些关于Python反编译工具的知识点: 1. **什么是Python...
10. **法律问题**:在进行APK反编译时,必须确保遵循版权法和用户协议。未经授权访问或修改他人的应用代码可能涉及侵权行为,因此在进行此类操作前应谨慎行事。 综上所述,APK反编译工具是Android生态系统中重要的...
4. **性能优化**:通过预编译JSP页面,可以减少服务器端的解析时间,提高响应速度。 **四、实际应用** 在实际开发中,JSP模板常用于构建企业级Web应用,如电子商务平台、内容管理系统、在线教育系统等。例如,...
2. **交叉编译:** - 描述:在一个平台上编译生成另一个平台上的可执行代码。 - 用途:适用于不同架构间的目标代码生成。 3. **自展:** - 描述:逐步扩展核心语言的过程,从简单的语言开始,逐步添加新特性,...
此外,使用预编译的`PreparedStatement`代替`Statement`可以防止SQL注入攻击。 总结: 通过JSP将数据库中的数据显示到网页上,主要涉及以下几个关键步骤: 1. 配置JDBC连接,包括数据库URL、用户名和密码。 2. 使用...
在C#编程环境中,动态编译是通过System.CodeDom.Compiler命名空间提供的类来实现的,这使得我们可以在程序运行时动态地创建、编译和执行源代码。这种能力对于构建小型编译器或者代码解释器非常有用,尤其适用于需要...
在C#编程中,动态编译是一个非常有用的特性,它允许程序在运行时生成和编译代码。这种技术主要用于各种场景,例如插件系统、代码生成、自动化测试等。本篇将详细介绍两种C#中实现动态编译的方法,并通过一个名为`...
当使用Smali工具(如baksmali)反编译`classes.dex`时,它会将字节码转换为人类可读的Smali代码。 4. **baksmali.jar**:这是Smali反编译器的二进制版本。它能将`classes.dex`文件分解为一系列Smali源代码文件,...