I'm using the Debian packaged version of Tomcat 4.1.31 and 
running into some issues with JSP precompilation.  I've created 
tasks in my ant build file for the webapp I want to precompile:

  <taskdef classname="org.apache.jasper.JspC" name="jasper2" > 
      <classpath id="jspc.classpath"> 
        <pathelement location="/usr/local/jdk/lib/tools.jar"/> 
        <fileset dir="/usr/share/tomcat4/server/lib"> 
          <include name="*.jar"/> 
        </fileset> 
        <fileset dir="/usr/share/tomcat4/common/lib"> 
          <include name="*.jar"/> 
        </fileset> 
      </classpath> 
    </taskdef> 

When I call that task, I get:

     [echo] JSPC compilation of commerce JSP pages running...
  [jasper2] 2005-08-31 10:59:41 - ERROR-the file 
'/login-error.jsp' generated the following general exception: 
java.lang.NullPointerException

I've seen reports that NPEs from this step are often classpath 
related, but I've tried all the classpath variations that I can 
think of to no avail.  

I've used a <record> tag to record more details (appended 
below), but that output isn't very useful; line 596 in the 
JspC.java file doesn't appear to correspond to anything that 
could throw an NPE, and it's not even in the right function.  
Normally I'd suspect a modification in the Debian package, but 
the diff file included in the Debian source package doesn't 
include any changes to JspC.java.  

One thing that the Debian package does do is restructure the 
server/lib and common/lib jar files with symlinks to other 
packages.  I've tried building a single directory with physical 
copies of all the jar files; no change.

Note that the JSPs compile and run properly when dynamically 
loaded, and I had used a different precompile task earlier to 
test the JSP compilation stage.  That worked properly, but didn't 
generate the appropriate web.xml fragments to actually load the 
compiled JSPs, so I know that the JSPs are OK.

Is there any way to get better error reporting, so I can find out 
what's actually wrong?  Does anyone recognize this problem?

/apache/hosts/avguide.com/classes/build.xml:105: 
org.apache.jasper.JasperException: Error compiling 
/login-error.jsp
        at 
org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at 
org.apache.tools.ant.Target.performTasks(Target.java:369)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at 
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at 
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at 
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at 
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: org.apache.jasper.JasperException: Error compiling 
/login-error.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:123)
        ... 12 more
--- Nested Exception ---
org.apache.jasper.JasperException: Error compiling 
/login-error.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:123)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:341)
        at 
org.apache.tools.ant.Target.performTasks(Target.java:369)
        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
        at 
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
        at 
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
        at org.apache.tools.ant.Main.runBuild(Main.java:668)
        at org.apache.tools.ant.Main.startAnt(Main.java:187)
        at 
org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
        at 
org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)


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

Reply via email to