wood burning stoves 2.0*
The moose likes Tomcat and the fly likes JSP precompilation with Jasper2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP precompilation with Jasper2" Watch "JSP precompilation with Jasper2" New topic
Author

JSP precompilation with Jasper2

Ana Ko
Greenhorn

Joined: Apr 06, 2006
Posts: 1
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!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP precompilation with Jasper2
 
Similar Threads
include directive
Precompiling JSP's in Tomcat
Pre Compiling jsp
JSP Compilation using ANT
Need help in build applications using ant : getting exception