Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP precompilation with Jasper2

 
Ana Ko
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to precompile the Jsps with the jars which are shipped with Tomcat5.5.16. But i am getting follwing exception.
[jasper2] java.lang.IllegalStateException: No Java compiler available
[jasper2] at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilationContext.java:224)
[jasper2] at org.apache.jasper.JspC.processFile(JspC.java:946)
[jasper2] at org.apache.jasper.JspC.execute(JspC.java:1094)
[jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jasper2] at java.lang.reflect.Method.invoke(Method.java:585)
[jasper2] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:124)
[jasper2] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
[jasper2] at org.apache.tools.ant.Task.perform(Task.java:364)
[jasper2] at org.apache.tools.ant.Target.execute(Target.java:301)
[jasper2] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[jasper2] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[jasper2] at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
[jasper2] at org.apache.tools.ant.Main.runBuild(Main.java:632)
[jasper2] at org.apache.tools.ant.Main.startAnt(Main.java:183)
[jasper2] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
[jasper2] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

Here is the ant script which i am using
<!-- setup jsp files for precompile -->
<target name="jspc" depends="init">
<echo message="--------JSP PARSING STARTS(JSP-->>JAVA)----------"/>
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<!-- Application specific jars -->
<fileset dir="${deploydir}/dest">
<include name="*.jar"/>
</fileset>
<fileset dir="${gis.lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<echo message="--------JSP PARSING ENDS----------"/>
<echo message="--------JSP Validation Start----------"/>
<jasper2 validateXml="false"
uriroot="${webapp.path}"
webXmlFragment="${webinf.dir}/generated_web.xml"
outputDir="${webinf.dir}/src" />
<echo message="generated_web.xml is ${webinf.dir}/generated_web.xml"/>
</target>
<echo message="--------JSP Validation End----------"/>

where tomcat.home=${root_drive}/Tomcat5.5 and java.home=${root_drive}/Program Files/Java/jdk1.5.0_04/bin

Am i missing any jar file?Please help.
Thanks in advance!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic