|
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 |
|
|
|
|
|
|
|