File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JSP precompilation with Jasper2" Watch "JSP precompilation with Jasper2" New topic

JSP precompilation with Jasper2

Ana Ko

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(
[jasper2] at org.apache.jasper.JspC.processFile(
[jasper2] at org.apache.jasper.JspC.execute(
[jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[jasper2] at sun.reflect.NativeMethodAccessorImpl.invoke(
[jasper2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
[jasper2] at java.lang.reflect.Method.invoke(
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at
[jasper2] at

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 dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
<!-- Application specific jars -->
<fileset dir="${deploydir}/dest">
<include name="*.jar"/>
<fileset dir="${gis.lib.dir}">
<include name="*.jar"/>
<echo message="--------JSP PARSING ENDS----------"/>
<echo message="--------JSP Validation Start----------"/>
<jasper2 validateXml="false"
outputDir="${webinf.dir}/src" />
<echo message="generated_web.xml is ${webinf.dir}/generated_web.xml"/>
<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:
subject: JSP precompilation with Jasper2
It's not a secret anymore!