I have an Ant task to compile jsp files with Jasper. The first step is generate the java files:
<java classname="org.apache.jasper.JspC" fork="no" failonerror="true">
<classpath refid="my.class.path" />
<arg value="-uriroot" />
<arg value="${apps}" />
<arg value="-d" />
<arg value="${jsp}" />
<arg value="-p" />
<arg value="my.package.jsp" />
<arg value="-webinc" />
<arg value="${apps}/META-INF/gen-mappings.xml" />
<arg value="-webapp" />
<arg value="${apps}" />
</java>
When I launch this task I get:
BUILD FAILED
java.lang.ClassCastException: org.apache.tools.ant.AntClassLoader cannot be cast
to java.net.URLClassLoader
at org.apache.jasper.compiler.JspRuntimeContext.<init>(JspRuntimeContext
.java:113)
at org.apache.jasper.JspC.initServletContext(JspC.java:1257)
at org.apache.jasper.JspC.execute(JspC.java:1118)
at org.apache.jasper.JspC.main(JspC.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
How can I manage this problem?
Thanks!
Claudio
Found the problem.
For a wrong dependency chain between the Ant tasks, the web application folder was empty, without any JSP.
Corrected the chain and launched the jasper task with some JSP, all is ok.
Thanks for help.
Claudio