2 Replies Latest reply: Aug 21, 2009 3:56 AM by 843810 RSS

    Bad version number in .class file

    843810
      Hi guys,

      I'm getting the following error:
      Including /template/html_v1-0/grid/grid_tvguide.jsp resulted in org.apache.jasper.JasperException: Bad version number in .class file
      for a JSP page that I'm working on.

      The target server is running Tomcat with Java version 1.5.0_17 and in my IDE (NetBeans 6.7m2 Build 200902231810) I've set the default JDK to be 1.5. So there shouldn't be any version issues right? But whenever I try to access this page, it breaks and when looking at the logs I see the exception mentioned earlier.

      So far, all solutions point to the obvious scenario of compiling source code with a version higher than that of the target server. But form what I can see, this is not the case in my scenario, and I've gone through many, many checks to rule this out. I've tried cleaning out the .jar file for the project and rebuilding on the server but the error comes back again. I've gone to the Catalina folder within tomcat to check the generated code and ran the hexdump command on what I assume is the compiled JSP page. This also says that the JSP was compiled with version 1.5.

      I'm not sure what else I can check for because this seems to happen to this particular page only. The page has the following java code in it:
      <%
          za.co.avx.tlive.tvguide.DateUtils du = new za.co.avx.tlive.tvguide.DateUtils();
          String[] datesForTheWeek = new String[7];
          datesForTheWeek = du.getDateForDaysOfTheWeek();
      %>
      Any ideas what else could be causing this exception to happen?

      I'd appreciate any help because I'm starting to look like an idiot :(
        • 1. Re: Bad version number in .class file
          jschellSomeoneStoleMyAlias
          >
          I've gone to the Catalina folder within tomcat to check the generated code and ran the hexdump command on what I assume is the compiled JSP page. This also says that the JSP was compiled with version 1.5.

          That probably isn't the file that it is attempting to load.
          • 2. FIXED:Re: Bad version number in .class file
            843810
            That probably isn't the file that it is attempting to load.
            You're right about that. I'm not sure if I'll be able to pinpoint the culprit with any certainty, because I'm building a solution within a third party framework.

            I cleaned up all the jars that were on the server and ran the build again which resolved the issue. The question still remains what could have caused this since the Java version of the code is kept the same on both the server and in the IDE.