1 Reply Latest reply on Jun 28, 2007 3:31 AM by Dean Pullen

    Tomcat Java 5.0  problem, on a 6.0 JDK...

    Dean Pullen Novice

      Hi...
      Using jboss-4.2.0.GA on Windows and Sun JDK jdk1.6.0_01.
      No other instances of Java are on the machine, nor have they ever been installed.

      I'm getting this back when trying to use generics in a JSP:
      javax.servlet.ServletException: org.apache.jasper.JasperException: Unable to compile class for JSP:

      An error occurred at line: 153 in the jsp file: /lms/dealer_comms.jsp
      The type List is not generic; it cannot be parameterized with arguments
      150:
      151:
      152: <%
      153: List beans = (List) request.getAttribute("beans");
      154: %>
      155: <%= beans.get(0).getDealerName() %>
      156: <!--


      An error occurred at line: 153 in the jsp file: /lms/dealer_comms.jsp
      Syntax error, parameterized types are only available if source level is 5.0


      The main error of importance, I guess is the above line.
      Is there a setting somewhere to force 5.0 compatibility etc?

        • 1. Re: Tomcat Java 5.0  problem, on a 6.0 JDK...
          Dean Pullen Novice

          For those getting the above problem (which should actually show the error that 5.0 generics can't be used )

          change Tomcat's web.xml to read:

          <init-param>
           <param-name>compilerTargetVM</param-name>
           <param-value>1.5</param-value>
           </init-param>
           <init-param>
           <param-name>compilerSourceVM</param-name>
           <param-value>1.5</param-value>
           </init-param>


          Under the JSP servlet def.