一个JSP编译错误的解决:JAVAC MESSAGE FILE IS BROKEN: key=javac.err.branch.too.big

原创 2006年05月17日 13:33:00
日志中提示如下错误:
[06-5-17 9:09:40:391 CST] 1a9f74ca WebGroup      E SRVE0026E: [Servlet 错误]-[无法编译 JSP 类
D:/IBM/WebSphere/AppServer/temp/zxsjk7/server1/ai_war/ai.war/home/_main.java:14: JAVAC MESSAGE FILE IS BROKEN: key=javac.err.branch.too.big, arguments=null, null, null
public class _main extends com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase {
             ^
1 个错误
]:org.apache.jasper.JasperException: 无法编译 JSP 类
D:/IBM/WebSphere/AppServer/temp/zxsjk7/server1/ai_war/ai.war/home/_main.java:14: JAVAC MESSAGE FILE IS BROKEN: key=javac.err.branch.too.big, arguments=null, null, null
public class _main extends com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase {
             ^
1 个错误

    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:129)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.compile(JspServlet.java:1003)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.loadJSP(JspServlet.java:925)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:287)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:317)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:700)
    at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:798)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java(Compiled Code))
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
    at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
    at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
    at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
    at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
解决方法及相关信息如下:(原文URL:http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q1=1170472&uid=swg21170472&loc=en_US&cs=utf-8&lang=en+en)

Technote (FAQ)
 
Problem
A JavaServer Pages™ (JSP™) page compilation may fail with the error message "JAVAC MESSAGE FILE IS BROKEN: key=javac.err.branch.too.big" or "code too large for try statement". 
 
Cause 
There is a limitation of 65536 bytes (64K) on the amount of code per non-native, non-abstract method in Java® SDK classes. If a JSP page is translated into a Java class in which this limit is exceeded, the Java compiler will issue a "JAVAC MESSAGE FILE IS BROKEN: key=javac.err.branch.too.big" or "code too large for try statement" message, and the JSP compilation will fail. The JVM method size limit of 64K cannot be increased.

Refer to the "4.10 Limitations of Java Virtual Machines" section in http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html

 
 
Solution
Browser-based compilation on WebSphere Application Server V4.0 and V5.0 releases

Set the JVM™ system property com.sun.tools.javac.main.largebranch to true. After setting this property to true, restart the server and request the JSP. If this compilation error persists after correctly setting this property, restarting the server and requesting the JSP, see Best practices for reducing the size of the service method in generated JSP class files

To change the system property in WebSphere Application Server V4.0 releases:
Go to the administrative console.
Select WebSphere Administrative Domain > Nodes > your_node_name > Application Servers > your_application_server
On the right, click JVM Settings.
Under System Properties, click Add.
Under name specify com.sun.tools.javac.main.largebranch without quotes and under value specify true without quotes.
Click Apply.
Restart the Application Server to pickup the changes.

To change the system property in WebSphere Application Server V5.0 releases:
In the administrative console, expand Servers, then click Application Servers.
Select the Application Server.
In the Additional Properties section, click Process Definition.
Click Java Virtual Machine.
Click Custom Properties.
Click New.
Under name specify com.sun.tools.javac.main.largebranch without quotes and under value specify true without quotes.
Click Apply.
At the top of the administrative console, click Save to save your changes.
Stop and restart the Application Server.


Browser-based compilation on WebSphere Application Server V5.1 releases

There is no further optimization that can be done in the Application Server. See Best practices for reducing the size of the service method in generated JSP class files

Batch compilation in WebSphere Application Server V4.0, V5.0 and V5.1 releases

By default, the WebSphere Application Server JSP Batch Compiler is fully optimized. If this compilation error is encountered when using the JSP Batch Compiler, see Best practices for reducing the size of the service method in generated JSP class files 
 

相关文章推荐

mysql导出表到CSV文件方法及提示错误[Err] 1290 - The MySQL server is running with the --secure-file-priv option解决办法

1.导出表到CSV文件方法     select * from table_name     into outfile 'C:/ProgramData/MySQL/MySQL Server 5.7...

maven编译异常错误loading CharSequence class file is broken

在用maven对项目进行编译打包时,遇到了下面奇怪的编译错误 "C:\Program Files\Java\jdk1.8.0\bin\java" "-Dmaven.home=C:\Program...

javac编译时出现“错误:仅当显式请求注释处理时才接受类名称”的解决办法

javac编译时出现“错误:仅当显式请求注释处理时才接受类名称”的解决办法 引起的原因是因为文件名少了.java,通常的javac编译都必须带有.java才可以。 而运行时java命令就可...
  • lao5net
  • lao5net
  • 2012年09月24日 10:43
  • 1578

jetty访问jsp页面出现PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required

Emmbed Jetty JSP PWC6345 rg.apache.jasper.JasperException: PWC6345: There is an error in invoking ja...
  • nuccch
  • nuccch
  • 2014年03月15日 18:59
  • 11790

ant中com.sun.tools.javac.Main is not on the classpath问题的解决方案

以上问题出现在使用eclipse编写ant脚本时使用javac标签时,在网上查询大量资料后都指出是编译器JDK版本设置混乱的原因。本人经过试验后总结如下两点: 1、问题指出JAVA_HOME没有指向j...
  • ws7896
  • ws7896
  • 2015年03月09日 19:01
  • 268

javac编译由于没有添加后缀而导致的错误

出错记录:          使用javac没有添加.java后缀          这时候会显示出如上的错误。         由此引申使用java的时候添加class后缀,实验后出...

javac编译后出现乱码错误

javac编译后出现乱码错误使用sublime简单的写了一个排序算法后,使用javac来编译文件,结果出现了下图的乱码错误, 乱码原因:由于JDK是国际版的,在编译的时候,如果我们没有用-enc...
  • cufelsd
  • cufelsd
  • 2016年01月16日 13:51
  • 2322

VS2010编译错误 #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403的解决方法

下载的一个MFC工程,在VS2010(工程是被转换为VS2010工程的)上编译遇到如下错误: 1>  stdafx.cpp 1>d:\program files\microsoft visual ...

codeblocks进行C++开发 向工程中添加Class 发生编译错误:"No such file or directory" 解决方案

 原文地址:向CodeBlocks的Project中添加class文件时,出现No such file or directory错误的解决方案 我们在CodeBlocks中编写程序时,一般要建...

Openwrt编译:root.squashfs-64k is too big (Max=6488064 , Current=xxxx)

搞了一段时间openwrt编译,由于之前没有路由器的经验,很蛋疼,各种问题。Question折腾好几天,终于把环境配好了,包括软件源、依赖库、版本,以及make menuconfig选择打到固件里面的...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:一个JSP编译错误的解决:JAVAC MESSAGE FILE IS BROKEN: key=javac.err.branch.too.big
举报原因:
原因补充:

(最多只允许输入30个字)