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