You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex Kowalenko <al...@5dservices.com.au> on 2003/12/01 01:18:55 UTC

JSPC Jasper compiler crash.

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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Garbage Collection issues

Posted by Neal <ne...@yahoo.com>.
My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent months
with crashing due to unavailable free RAM.  Specifically I get a
java.error.outOfMemory exception.  If check the RAM available
(Runtime.getRuntime().totalMemory()), I can see it ticking down through
the week.  If explicitly run garbage collection however my RAM totally
frees up and all is well (Runtime.getRuntime().gc();).

Why would this happen?  Surely this isn't due to a programming error on
my part, otherwise, the resources should automatically released whenever
the JRE performs periodic garbage collection. Isn't that correct?
Anyone have any theories as to what this may mean and what the best
solution would be?

Thanks.
Neal



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Possible custom tag incompatibility between 4.1.27 and 4.0.3

Posted by Ely Eshel <el...@acm.org>.
Hi!
I developed a custom tag on Tomcat 4.1.27 and tried to deploy it on 4.0.3.
I get the following error:
org.apache.jasper.JasperException: XML parsing error on file
/WEB-INF/tlds/testtaglib.tld: Internal Error: File
/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd not found

My web.xml entry is:
<taglib>
	<taglib-uri>/WEB-INF/tlds/testtaglib.tld</taglib-uri>
	<taglib-location>/WEB-INF/tlds/testtaglib.tld</taglib-location>
</taglib>

My testtaglib.tld file is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib
	PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
	"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
	<tlib-version>1.0</tlib-version>
	<jsp-version>2.0</jsp-version>
	<short-name>testtaglibs</short-name>
	<uri>/WEB-INF/tlds/testtaglib.tld</uri>
	<tag>
	  <name>getWebServer</name>
	  <tag-class>
	     taglibs.testtaglib.GetWebServerTag
	  </tag-class>
	  <body-content>empty</body-content>
	</tag>
</taglib>

My taglib directive in the JSP is:
<%@ taglib prefix="testtag" uri="/WEB-INF/tlds/testtaglib.tld"%>

I am not sure that the problem is with Tomcat versions, but I cannot figure
out what else is wrong. I have no control over the 4.0.3 environment, so I
cannot experiment with it at all.
Thanks,
-- Ely



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org