I have some fuzzy memory of somebody reporting the same slow JSP compilation performance problem, trying it myself, and not seeing the problem. I couldn't find anything searching back through email, though (as i say it's a fuzzy memory :). 

You'll need to use the JspC class from repository/org/apache/tomcat/jasper/6.0.14-G614585/jasper-6.0.14-G614585.jar in your Geronimo install. Our pom.xml shows how to do this in maven. I've never done it, but as an Ant task, think you'll just need to set your jspc-classpath.

Lukasz possible that you could suggest some documentation after you fix your problem?

--kevan


On Apr 4, 2008, at 11:01 AM, David Jencks wrote:
I'm not sure what the solution is going to be, but we use a custom version of tomcat and jasper that in particular is incompatible with jsps compiled with earlier versions of jasper (such as all the tomcat 6.0 published ones).

Our console plugins precompile all the jsps using a maven plugin. Can you point the ant jsp compiler stuff at a different jasper version (the one in geronimo)?  Maybe you can look at our build for some ideas?

And I guess we desperately need a bit of documentation on how to do this....

Many thanks
david ejncks

On Apr 4, 2008, at 3:04 AM, Łukasz Budnik wrote:

Hi All!

I'm trying to run a web application that has pre-compiled JSP pages.

I'm doing so because Geronimo's on the fly JSP compilation takes ages
compared to building and deploying whole JEE application from the
scratch :(

For example a JSP page (with JSF: MyFaces + Tomahawk + Tomahawk
Sandbox) takes up to 15-20 seconds to compile!

You must admit that this is insane...

I've integrated Jasper's JSPC tool with my Ant project to pre-compile
JSP to servlets and later on to compile generated servlets classes to
byte codes.

OK this is what I'm doing:

1. run JSPC tool:

<target name="jspc" depends="web-compile">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath refid="jspc-classpath"/>
</taskdef>

<jasper2 verbose="0"
package="org.xh.nuntius.web.jsps"
uriroot="${web-build}/classes"
webXmlFragment="${web-build}/classes/WEB-INF/generated_web.xml"
outputDir="${web-build}/classes/WEB-INF/src" />

</target>

2. compile generated servlets from the 1st step

<target name="jspc-compile" depends="jspc">
<javac srcdir="${web-build}/classes/WEB-INF/src"
destdir="${web-build}/classes/WEB-INF/classes"
classpathref="jspc-classpath" encoding="UTF-8" />
</target>

3. merge generated_web.xml with original web.xml

4. copy compiled jsp-servlets to WEB-INF/classes

I can deploy my application successfully, but when I access any JSP page I get:

java.lang.UnsupportedOperationException: separate instantiation and
injection is not supported
org.apache.geronimo.jasper.JasperServletContextCustomizer$JasperInstanceManager.newInstance(JasperServletContextCustomizer.java:84)
org.xh.nuntius.web.jsps.main.contact_jsp._jspx_meth_f_005fview_005f0(Unknown
Source)
org.xh.nuntius.web.jsps.main.contact_jsp._jspService(Unknown Source)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
org.xh.nuntius.web.filters.SecurityAbuseDetectorFilter.doFilter(Unknown Source)
org.xh.nuntius.web.filters.CharsetFilter.doFilter(Unknown Source)
java.lang.UnsupportedOperationException: separate instantiation and
injection is not supported

Or is there some other way (geronimo-web.xml descriptor?) I can force
Geronimo to pre-compile my JSP pages?

thanks in advance for any hints

best regards
Łukasz