Does anyone know why the JSPC Jasper compiler would throw a null exception
on the following file. Within Tomcat 4.0,4.1,5.0 it works fine. However,
pre-compiling it causes it to throw a exception as follows. The significant
feature of the JSP file is that it uses a custom taglib.

Do I have to somehow give the japser compiler special options to locate the
taglib, or does it work it out from the normal taglib definitions in the
application's filesystem.

The JSP file:

<%@ taglib prefix="ihook" uri="/ihook" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

<table width="80%" border="0">
  <tr>
    <td><ihook:calendar
baseURL="list.jsp?location=${webApp.webRoomBooking.location}"
                        month="${webApp.webRoomBooking.prevMonth}"
                        highlight="${webApp.webRoomBooking.date}"
                        left="-3"/>
    </td>
    <td><ihook:calendar
baseURL="list.jsp?location=${webApp.webRoomBooking.location}"
                        month="${webApp.webRoomBooking.date}"
                        highlight="${webApp.webRoomBooking.date}"/>
    </td>
    <td><ihook:calendar
baseURL="list.jsp?location=${webApp.webRoomBooking.location}"
                        month="${webApp.webRoomBooking.nextMonth}"
                        highlight="${webApp.webRoomBooking.date}"
                        right="3"/>
    </td>
  </tr>
</table>

The ant build tag is:jspc:

    <target name="jspc" depends="init">
        <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
            <classpath id="jspc.classpath">
                <pathelement location="${java.home}/../lib/tools.jar"/>
                <fileset dir="${TOMCAT}/server/lib">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="${TOMCAT}/common/lib">
                    <include name="*.jar"/>
                </fileset>
            </classpath>
        </taskdef>

        <echo message="Tomcat is ${TOMCAT}"/>
        <jasper2
             validateXml="false"
             uriroot="${SRC}"
             webXmlFragment="${SRC}/WEB-INF/generated_web.xml"
             outputDir="${SRC}/WEB-INF/src" />
      </target>

The verbose output is:
     [echo] Tomcat is F:/Tomcat4.1
  [jasper2] Error in class org.apache.jasper.JspC
2003-12-01 11:06:36 - ERROR-the file '\roombooking\dates.jsp' generated the
following general exception: java.lang.NullPointerException

BUILD FAILED
file:D:/Alex/Release/iHookWeb/build.xml:68:
org.apache.jasper.JasperException: Error compiling \roombooking\dates.jsp
        at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:155)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: org.apache.jasper.JasperException: Error compiling
\roombooking\dates.jsp
        at org.apache.jasper.JspC.processFile(JspC.java:596)
        at org.apache.jasper.JspC.execute(JspC.java:801)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:147)
        ... 9 more
--- Nested Exception ---
org.apache.jasper.JasperException: Error compiling \roombooking\dates.jsp
        at org.apache.jasper.JspC.processFile(JspC.java:596)
        at org.apache.jasper.JspC.execute(JspC.java:801)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:147)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to