2 Replies Latest reply on Nov 25, 2005 8:27 AM by gedl

    JBoss/Tomcat error

    brudvik

      Hi - I get this strange error when running the sollution on tomcat, while if
      I run it on JBoss it works like a charm. Anyone got an idea?

      error:org.apache.jasper.JasperException: Unable to compile class for JSP
      An error occurred at line: 4 in the jsp file: /webshop_handlekurv.jsp
      Generated servlet error: Syntax error on token "enum", delete this token
      An error occurred at line: 4 in the jsp file: /webshop_handlekurv.jsp
      Generated servlet error: Syntax error on token "enum", invalid Expression
      An error occurred at line: 4 in the jsp file: /webshop_handlekurv.jsp
      Generated servlet error: Syntax error on token "enum", delete this token.
      


      And here is a snippet of that particular code:

      if (strUpdate != null) {
       Enumeration enum = request.getParameterNames();
       while (enum.hasMoreElements()) {
       String parameter = (String)enum.nextElement();
      
       if (parameter.equals("ref") || parameter.equals("getTab") || parameter.equals("getuTab") || ... ) {
       } else {
       :
       :
       .
      


      Thanks in advance!

        • 1. Re: JBoss/Tomcat error
          brudvik

          I figured out the sollution on my own. It appears that the line:

          Enumeration enum = request.getParameterNames();

          Is valid in JBoss while in Tomcat the particular word "enum" will throw
          an exception since it appears that they have reserved that word for their
          own usage (or something like it). Could be others that would have faced
          that same problem, or will face that same problem sometime.

          Cheers!

          • 2. Re: JBoss/Tomcat error
            gedl

             

            "brudvik" wrote:
            I figured out the sollution on my own. It appears that the line:

            Enumeration enum = request.getParameterNames();

            Is valid in JBoss while in Tomcat the particular word "enum" will throw
            an exception since it appears that they have reserved that word for their
            own usage (or something like it). Could be others that would have faced
            that same problem, or will face that same problem sometime.

            Cheers!


            Are you using Java 5.0? If you do, the word "enum" is reserved for the language itself, not for a specific AS.

            Regards,
            Gonçalo.