Advertisement

01.29.2007 at 06:34PM PST, ID: 22141549
[x]
Attachment Details

!!!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.

Asked by mbf-it in Java Programming Language, Java Servlets, New to Java Programming

Tags: , , , ,

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!!!!!!!!!!Start Free Trial
[+][-]01.29.2007 at 06:36PM PST, ID: 18424752

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.29.2007 at 06:37PM PST, ID: 18424755

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.29.2007 at 06:39PM PST, ID: 18424769

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.29.2007 at 06:41PM PST, ID: 18424777

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.29.2007 at 06:43PM PST, ID: 18424783

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Programming Language, Java Servlets, New to Java Programming
Tags: version, wrong, file, class, has
Sign Up Now!
Solution Provided By: objects
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.29.2007 at 06:46PM PST, ID: 18424803

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32