Author Topic: [SOLVED] 12.10.1 frontPage.jsp "generics are not supported in -source 1.3" error  (Read 3169 times)

emilec

  • Newbie
  • *
  • Posts: 43
  • Karma: 4
    • View Profile
    • Email
With a recent upgrade to QueueMetrics 12.10.1 I've picked up this error at a few sites.

Code: [Select]
Nov 1, 2012 11:26:58 PM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Error compiling file: /srv/www/tomcat5/base/work/Catalina/localhost/QueueMetrics//org/apache/jsp/frontPageNew_jsp.java     [javac] Compiling 1 source file

/srv/www/tomcat5/base/work/Catalina/localhost/QueueMetrics/org/apache/jsp/frontPageNew_jsp.java:1177: generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
      TreeSet<Integer> validLabels = new TreeSet<Integer>();
             ^
1 error
Nov 1, 2012 11:26:58 PM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Javac exception
Compile failed; see the compiler error output for details.
[SNIP]

This problem seems specific to Tomcat 5.0. The solution is to edit TOMCAT_HOME/conf/web.xml to set the compiler to 1.5
Code: [Select]
    <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
            <param-name>fork</param-name>
            <param-value>false</param-value>
        </init-param>
       <init-param>
            <param-name>compilerSourceVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>compilerTargetVM</param-name>
            <param-value>1.5</param-value>
        </init-param>
        <init-param>
            <param-name>xpoweredBy</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
    </servlet>

More info: http://tech.gaeatimes.com/index.php/archive/how-to-run-javac-15-or-beyond-compiler-for-jsp-compilation-in-tomcat-55-with-generics-enabled-and-other-15-only-features/2/

« Last Edit: November 07, 2012, 11:40:33 by emilec »