Tomcat - java.lang.InternalError: name is too long to represent

I've got the aforementioned exception  when I was trying to load a jsp page on Tomcat 6 running in a debug mode. Turns out the problem occurs when a jsp page grows big. It's a known JVM issue described by bugs 39089 and 6294277. Here is how to solve it without touching the jsp.

Open conf/web.xml In your Tomcat install directory and add a supressSmap parameter to the jsp servlet:
 <servlet>  
  <servlet-name>jsp</servlet-name>  
  <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>  
  ..  
  <init-param>  
   <param-name>suppressSmap</param-name>  
   <param-value>true</param-value>  
  </init-param>  
  ..   
 </servlet>  
SMAP stands for a source map generator (see Javadoc - SmapGenerator). Suppressing it will prevent the jsp be generated into the associated .class file. For full details, see JSR45 - Debugging Support for Other Languages