Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

!!!URGENT!!! class file has wrong version 49.0, should be 48.0 - Please remove or make sure it appears in the correct subdirectory of the classpath.

Avatar of mbf-it
mbf-it asked on
JavaJava EE
6 Comments1 Solution7303 ViewsLast Modified:
Hi all,

I am trying to get a simple data access and display .jsp page working but I have run into difficulties.

I am running:
--- JDK 1.4.2 (C:\j2sdk1.4.2_13)
--- JRE 1.4.2 (C:\Program Files\Java\j2re1.4.2_13)
--- Apache Ant 1.6.2 (C:\apache-ant-1.6.2)
--- Jakarta Tomcat (C:\jakarta-tomcat-5.0.28)

I have the following environment variables
--- CATALINA_HOME=C:\jakarta-tomcat-5.0.28
--- JAVA_HOME=C:\j2sdk1.4.2_13
--- PATH=C:\Program Files\Java\j2re1.4.2_13\lib;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\system32\nls;%SystemRoot%\system32\nls\ENGLISH;C:\Program Files\Novell\ZENworks\;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\QuickTime\QTSystem\

------------------------------------------------------------------------------------------------------------------------

Here is my build file:

<project name="VMF" default="all" basedir=".">
       <description>
          Ant build file (see http://jakarta.apache.org/ant).
        </description>

       <!-- set global properties for this build -->
        <property name="src" location="src"/>
       <property name="build" location="build"/>
       <property name="lib" location="lib"/>
      <!-- <property name="tomcat.home" value="C:/Program Files/Apache Software Foundation/apache-tomcat-5.5.20"/>  -->
      <property name="tomcat.home" value="C:\jakarta-tomcat-5.0.28"/>

      <property name="tomcat.deploy" location="${tomcat.home}/webapps"/>
      <property name="deploy" location="C:\VMF"/>
       <property file="${src}/resources/General.properties"/>

        <path id="classpath">
          <fileset dir="${lib}">
                  <include name="*.jar"/>
          </fileset>
        </path>

  <target name="init">
    <tstamp/>
        <delete dir="${deploy}"/>
    <mkdir dir="${build}"/>
    <mkdir dir="${lib}"/>
    <mkdir dir="${deploy}"/>
        <!--mkdir dir="${deploy}/WEB-INF/lib"/-->
        <!--delete file="${deploy}/CashManager.war"/-->
  </target>

  <target name="compile" depends="init"
        description="compile the source" >
    <javac srcdir="${src}" destdir="${build}">
      <classpath refid="classpath"/>
          <!-- exclude junit test cases-->
          <exclude name = "test/*.*"/>

    </javac>
        <copy todir="${build}/resources">
                <fileset dir="${src}/resources"/>
            </copy>
  </target>

  <target name="jar" depends="compile">
    <!-- generate manifest -->
    <dirname property="project.dir" file="build.xml"/>
    <pathconvert property="classpath.mf"
                 dirsep="/"
                 pathsep=" "
                 refid="classpath">
      <map from="${project.dir}/lib/" to=""/>
      <map from="${project.dir}\lib\" to=""/>
    </pathconvert>
    <copy file="Manifest"
          tofile="Manifest.build"
          overwrite="yes">
      <filterset>
        <filter token="CLASSPATH" value="${classpath.mf}"/>
      </filterset>
    </copy>

    <jar jarfile="${lib}/vmf.jar" basedir="${build}" manifest="Manifest.build"/>

  </target>


      <target name="war" depends = "jar">
            <copy todir="${deploy}">
                  <fileset dir="VMF-WEB"/>
            </copy>
            <copy todir="${deploy}/WEB-INF/lib">
                  <fileset dir="${lib}"/>
            </copy>

            <war
                    basedir="${deploy}/"
                    warfile="${deploy}/VMF.war"
                        webxml="${deploy}/WEB-INF/web.xml">
                    <exclude name="${deploy}/VMF.war"/>
                  </war>
                  <copy
                        file="${deploy}/VMF.war"
                        todir="${tomcat.deploy}"/>
      </target>


<target name="all" depends="init,compile,jar,war">
</target>

</project>


-------------------------------------------------

Here is the error I get when I try to access this page...

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
C:\jakarta-tomcat-5.0.28\work\Catalina\localhost\VMF\org\apache\jsp\jsp\greenbook_005ftech_005flist_jsp.java:6: cannot access core.Tech_List_Query


Generated servlet error:
bad class file: C:\jakarta-tomcat-5.0.28\webapps\VMF\WEB-INF\lib\vmf.jar(core/Tech_List_Query.class)
class file has wrong version 49.0, should be 48.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
import core.Tech_List_Query;
            ^
1 error

      org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
      org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
      org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

---------------------- YOU'RE HELP WOULD BE GREATLY APPRECIATED!!!!!!!!!!
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick BarryFlag of Australia imageJava Developer
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers