users@glassfish.java.net

JspC not working as Ant task

From: <glassfish_at_javadesktop.org>
Date: Tue, 15 Jul 2008 10:04:49 PDT

Using glassfish v2ur2-b04 on fedora 8 with jdk 1.5.0_15.

Trying to compile jsp's using an ant task throws "The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application". Using the command line jspc binary in ${APPSRV_HOME}/bin works, but calling it using the ant taskdef fails. Any help is appreciated.

    <path id="CP">
        <pathelement location="${CLS}" />
        <pathelement location="${LIB}/${LOG4J_JAR}" />
        <pathelement location="${JAVAEE_JAR}" />
        <pathelement location="${LIB}/Utility.jar" />
        <pathelement location="${LIB}/StdTags.jar" />
        <pathelement location="${LIB}/WSTags.jar" />
        <pathelement location="${LIB}/WSHandler.jar" />
        <pathelement location="${LIB}/EmailHandler.jar" />
    </path>

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

    <target name="compile_jsps"
            depends="compile">

        <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
            <classpath>
                <path refid="JSPC_CP" />
                <path refid="CP" />
            </classpath>
        </taskdef>

        <mkdir dir="${GEN}" />
        <mkdir dir="${GEN}/src" />
        <mkdir dir="${GEN}/WEB-INF" />
        <mkdir dir="${GEN}/WEB-INF/lib" />

        <copy todir="${GEN}/WEB-INF">
            <fileset dir="${ETC}">
                <include name="web.xml" />
                <include name="**/*.tld" />
            </fileset>
        </copy>

        <copy todir="${GEN}">
            <fileset dir="${WEB}" includes="**/*.jsp" />
            <fileset dir="${WEB}" includes="**/*.jspf" />
        </copy>

        <copy todir="${GEN}/WEB-INF/lib">
            <fileset dir="${LIB}" includes="StdTags.jar" />
            <fileset dir="${LIB}" includes="WSTags.jar" />
            <fileset dir="${APPSRV_HOME}/lib" includes="**/*.jar" />
        </copy>

        <jasper2 validateXml="false"
                 uriroot="${GEN}"
                 addWebXmlMappings="true"
                 webXmlFragment="${GEN}/WEB-INF/generated_web.xml"
                 compilerSourceVM="1.5"
                 compilerTargetVM="1.5"
                 outputDir="${GEN}/src"
                 verbose="9" />

        <javac fork="true"
              debug="true"
              deprecation="true"
              destdir="${CLS}"
              nowarn="false"
              source="1.5"
              target="1.5">
           <src path="${GEN}/src" />
           <classpath>
               <path refid="CP" />
               <path refid="JSPC_CP" />
           </classpath>
        </javac>
    </target>
[Message sent by forum member 'travbow' (travbow)]

http://forums.java.net/jive/thread.jspa?messageID=286805