tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berglas, Anthony" <aberg...@rsasecurity.com>
Subject Jasper compiler crashes
Date Tue, 29 May 2007 06:44:09 GMT
When I try to precompile I get a null pointer exception deep in
.servlet.JasperLoader.loadClass.  Happens for almost all of my .jsps.
They work fine with incremental compile.  

They do use tags defined with JSTL .tag files.  Tags call tags.  

tomcat-6.0.10-src

If anyone knows of decent docs on precompiling Jasper please let me
know.  (I know about jasper-howto.html).

(And there is an underlying problem that Jasper is *extremely* slow to
compile.  I can compile and build all of Tomcat itself from source in
less time than it takes to compile one medium sized JSP (about 30
seconds).  It is difficult to imagine how even the sloppiest code could
run that slowly.  Something is wrong.  100% CPU.)

Ant:-

    <taskdef classname="org.apache.jasper.JspC" name="jasper2" >
      <classpath id="jspc.classpath">
        <fileset dir="${tomcat}/bin">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${tomcat.lib}">
          <include name="*.jar"/>
        </fileset>
      </classpath>
    </taskdef>
<!--         <pathelement location="${java.home}/../lib/tools.jar"/> -->

   <target name="jspc" description="Try prebuilding JSPs">
        <delete dir="${tomcat}/webapps/plain_eg/WEB-INF/src"/>
        <mkdir dir="${tomcat}/webapps/plain_eg/WEB-INF/src"/>
        <jasper2
                 validateXml="false"
                 uriroot="${tomcat}/webapps/plain_eg"
                 webXmlFragment="WEB-INF/generated_web.xml"
                 outputDir="${tomcat}/webapps/plain_eg/WEB-INF/src"
                 failOnError="false"
                />
        <!-- showSuccess="true" -->

Stack trace:-


May 29, 2007 4:20:38 PM org.apache.jasper.JspC processFile
SEVERE: ERROR-the file '\token\autocrudtokentest.jsp' generated the
following general exception:
java.lang.NullPointerException
	at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:160)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:192)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
	at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
	at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
	at
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:
598)
	at
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrappe
r.java:221)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor
.java:576)
	at
org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.
java:50)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(T
agFileProcessor.java:627)
	at
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
	at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcesso
r.java:645)
	at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:190)
	at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
	at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
	at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
	at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
va:566)
	at
org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrappe
r.java:212)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor
.java:576)
	at
org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.
java:50)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(T
agFileProcessor.java:627)
	at
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
	at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
	at
org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(T
agFileProcessor.java:631)
	at
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
	at
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
	at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
	at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
	at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
	at
org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcesso
r.java:645)
	at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:190)
	at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
	at org.apache.jasper.JspC.processFile(JspC.java:994)
	at org.apache.jasper.JspC.execute(JspC.java:1143)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
05)
	at
org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:134)
	at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
05)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
or.java:41)
	at
org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.apache.tools.ant.Main.runBuild(Main.java:698)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:17)

--
Dr Anthony Berglas 
Ph. +61 7 3227 4410
(Mob. +61 42 783 0248)
ABerglas@RSA.com; Anthony@Berglas.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message