tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <mgai...@hotmail.com>
Subject jspc task
Date Thu, 02 Sep 2004 13:01:57 GMT
I am experiencing difficulties using the org.apache.jasper.JspC class within
jasper-compiler.jar
(any version)
Using :
  <taskdef classname="org.apache.jasper.JspC" name="jasper2"
onerror="report">
   <classpath>
    <pathelement location="${java.home}/../lib/tools.jar" />
    <fileset dir="${tomcat_home}/server/lib">
     <include name="*.jar" />
    </fileset>
    <fileset dir="${tomcat_home}/common/lib">
     <include name="*.jar" />
    </fileset>
    <fileset dir="${tomcat_home}/common/lib">
     <include name="commons-el.jar" />
    </fileset>
   </classpath>
  </taskdef>
  <jasper2 classpath="${classpath}" verbose="9" package="jsp"
uriroot="F:/United/jsp" webXmlFragment="${build.dir}/generated_web.xml"
outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package" />
  <echo>After jasper2 has completed..onto evaluation of log file</echo>
  <!--jspc srcdir="${jspdir}" destdir="${jspdir}/java" package="jsp"
failonerror="yes"
classpath="F:\Tomcat\TOMCAT~2.0\JAKART~1.0\common\lib\jasper-compiler.jar;${
jasper}/lib/jaxp/jaxp.jar;${jasper}/lib/servlet-2.2.jar;C:\ORACLE91\jdev\lib
\jdev.jar;C:\ORACLE91\jlib\zrclient.jar;C:\ANT_15\jakarta-ant-1.5\lib\rwrun.
jar;${tomcat_home}\common\lib\jasper-runtime.jar;${classpath};${tomcat_home}
\bin\commons-logging-api.jar"-->
  <!--include name="**/*.jsp" /-->
  <!--/jspc-->

jspc task does not execute as all versions of jasper-compiler.jar
produce -v0 error
downloading the source for JspC.java
and commenting out the offending -v0 code within JspC.java
//                if (tok.startsWith("-")) {
//                    throw new JasperException("Unrecognized option: " +
tok +
//                        ".  Use -help for help.");
//                }

I was able to  get build.xml to accept taskdef which defines the new and
improved JspC.class
the taskdef jasper2 compiler now works and actually attempts to compile jsp
I have identified in srcdir
the problem is that a JasperException is thrown which halts ant
Here is the error-
F:\United\scgdev\WebDev\eFACT\build.xml:166:
org.apache.jasper.JasperException: file:F:/United/jsp/clinicalProd.jsp(16,0)
File "/./includes/header.html" not found
 at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:132)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
 at org.apache.tools.ant.Task.perform(Task.java:364)
 at org.apache.tools.ant.Target.execute(Target.java:301)
 at org.apache.tools.ant.Target.performTasks(Target.java:328)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
 at org.apache.tools.ant.Main.runBuild(Main.java:632)
 at org.apache.tools.ant.Main.startAnt(Main.java:183)
 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: org.apache.jasper.JasperException:
file:F:/United/jsp/clinicalProd.jsp(16,0) File "/./includes/header.html" not
found
 at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:39)
 at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409
)
 at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
 at
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:339)
 at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)
 at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
 at
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:21
2)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:140)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:278)
 at org.apache.jasper.JspC.processFile(JspC.java:779)
 at org.apache.jasper.JspC.execute(JspC.java:908)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:124)
 ... 10 more
--- Nested Exception ---
org.apache.jasper.JasperException: file:F:/United/jsp/clinicalProd.jsp(16,0)
File "/./includes/header.html" not found
 at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:39)
 at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409
)
 at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:90)
 at
org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:339)
 at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:372)
 at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
 at
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:21
2)
 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:140)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:278)
 at org.apache.jasper.JspC.processFile(JspC.java:779)
 at org.apache.jasper.JspC.execute(JspC.java:908)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:124)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
 at org.apache.tools.ant.Task.perform(Task.java:364)
 at org.apache.tools.ant.Target.execute(Target.java:301)
 at org.apache.tools.ant.Target.performTasks(Target.java:328)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
 at org.apache.tools.ant.Main.runBuild(Main.java:632)
 at org.apache.tools.ant.Main.startAnt(Main.java:183)
 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

A)The immediate task is to get JspC.java to not throw -vX errors (where X is
the verbose parm)
*my solution is only a quick and dirty patch*
B)What halt conditions does JasperException throw which halts execution of
build.xml?

Yes I interrogated bugzilla and found no previous bugs on this so I entered
a bug myself-
(my apologies for the long-winded post)

Martin Gainty-
617-852-7822


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


Mime
View raw message