title: AntClassLoader cannot be cast to URLClassLoader
body: <p>I have an Ant task to compile jsp files with Jasper. The first step is generate the java files:</p>
  
  <pre><code>&lt;java classname="org.apache.jasper.JspC" fork="no" failonerror="true"&gt;
      &lt;classpath refid="my.class.path" /&gt;
      &lt;arg value="-uriroot" /&gt;
      &lt;arg value="${apps}" /&gt;
      &lt;arg value="-d" /&gt;
      &lt;arg value="${jsp}" /&gt;
      &lt;arg value="-p" /&gt;
      &lt;arg value="my.package.jsp" /&gt;
      &lt;arg value="-webinc" /&gt;
      &lt;arg value="${apps}/META-INF/gen-mappings.xml" /&gt;
      &lt;arg value="-webapp" /&gt;
      &lt;arg value="${apps}" /&gt;
  &lt;/java&gt;
  </code></pre>
  
  <p>When I launch this task I get:</p>
  
  <pre><code>BUILD FAILED
  java.lang.ClassCastException: org.apache.tools.ant.AntClassLoader cannot be cast
   to java.net.URLClassLoader
          at org.apache.jasper.compiler.JspRuntimeContext.&lt;init&gt;(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)
          ...
  </code></pre>
  
  <p>How can I manage this problem?
  Thanks!</p>
  
  <p>Claudio</p>