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-t
omcat-5.0.
28
--- JAVA_HOME=C:\j2sdk1.4.2_13
--- PATH=C:\Program Files\Java\j2re1.4.2_13\li
b;%SystemR
oot%\syste
m32;%Syste
mRoot%;%Sy
stemRoot%\
System32\W
bem;%Syste
mRoot%\sys
tem32\nls;
%SystemRoo
t%\system3
2\nls\ENGL
ISH;C:\Pro
gram 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}/w
ebapps"/>
<property name="deploy" location="C:\VMF"/>
<property file="${src}/resources/Gen
eral.prope
rties"/>
<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}/CashManage
r.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/l
ib">
<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.JasperEx
ception: Unable to compile class for JSP
Generated servlet error:
C:\jakarta-tomcat-5.0.28\w
ork\Catali
na\localho
st\VMF\org
\apache\js
p\jsp\gree
nbook_005f
tech_005fl
ist_jsp.ja
va:6: cannot access core.Tech_List_Query
Generated servlet error:
bad class file: C:\jakarta-tomcat-5.0.28\w
ebapps\VMF
\WEB-INF\l
ib\vmf.jar
(core/Tech
_List_Quer
y.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
.DefaultEr
rorHandler
.javacErro
r(DefaultE
rrorHandle
r.java:84)
org.apache.jasper.compiler
.ErrorDisp
atcher.jav
acError(Er
rorDispatc
her.java:3
32)
org.apache.jasper.compiler
.Compiler.
generateCl
ass(Compil
er.java:41
2)
org.apache.jasper.compiler
.Compiler.
compile(Co
mpiler.jav
a:472)
org.apache.jasper.compiler
.Compiler.
compile(Co
mpiler.jav
a:451)
org.apache.jasper.compiler
.Compiler.
compile(Co
mpiler.jav
a:439)
org.apache.jasper.JspCompi
lationCont
ext.compil
e(JspCompi
lationCont
ext.java:5
11)
org.apache.jasper.servlet.
JspServlet
Wrapper.se
rvice(JspS
ervletWrap
per.java:2
95)
org.apache.jasper.servlet.
JspServlet
.serviceJs
pFile(JspS
ervlet.jav
a:292)
org.apache.jasper.servlet.
JspServlet
.service(J
spServlet.
java:236)
javax.servlet.http.HttpSer
vlet.servi
ce(HttpSer
vlet.java:
802)
---------------------- YOU'RE HELP WOULD BE GREATLY APPRECIATED!!!!!!!!!!
Start Free Trial