You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Johannes Fiala <an...@fwd.at> on 2003/05/03 13:07:52 UTC

SOLVED: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem

I'm happy to report that this issue has been resolved with TC 4.1.24:

Hi there,

I just want to let you know that the bug of JSPC: generating duplicate 
names of classes, which causes compile to fail has been resolved with 
Tomcat 4.1.24. The reason why I didn't notice immediately was that it 
didn't overwrite my old generated source-files. After deleting them, 
Jasper generated them from scratch and now it rocks!

JSPC will now generate the jsps with a new package name:
package directory.subdirectory....;
instead of
package org.apache.jsp;

This bugfix helps a lot, as my JSPs now perform best as they can, 
immediately after deploying the app.

Johannes





Johannes Fiala/Johannes Fiala
07.04.2003 21:35

To
"Ant Users List" <us...@ant.apache.org>
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem





Hi Steve,

Thx alot for posting your configuration details, unfortunately it hasn't 
worked out yet for me and I have to repost in this issue!
I tried using JSPC now, but it seems that the same problem happens with 
the webapp option activated. It seems the webapp option only helps if 
duplicate names occur in different webapps, not within the same webapp 
(?).

jspc task definition:
====================
<target name="jspc">

    <jspc  compiler="jasper41" destdir="src" uriroot="/jsp"
        webinc="${basedir}/webinc.xml" >
        <classpath id="jspc.classpath">
        <pathelement location="${java.home}/../lib/tools.jar"/>
        <fileset dir="${catalina.home}/server/lib">
          <include name="*.jar"/>
        </fileset>
        <fileset dir="${catalina.home}/common/lib">
          <include name="*.jar"/>
        </fileset>
        <!-- include all JARs in lib-directory -->
        <fileset dir="${build.home}/WEB-INF/lib/">
                <include name="*.jar"/>
        </fileset>

      </classpath>

           <webapp  basedir="jsp" />

    </jspc>

  </target>
====================

and here are my compile results:
====================
    [javac] Compiling 16 source files to 
E:\develop\devapp\forms\build\WEB-INF\classes
    [javac] E:\develop\forms\src\kbgverzicht\final_jsp.java:11: duplicate 
class: org.apache.jsp.final_jsp
    [javac] public class final_jsp extends HttpJspBase {
====================

Since the problem always occurs during compile, maybe should I use 
different compiler options? 
==========================================
<javac srcdir="${src.home}"
          destdir="${build.home}/WEB-INF/classes"
            debug="${compile.debug}"
      deprecation="${compile.deprecation}"
         optimize="${compile.optimize}"
       (I also tried: fork="yes" / include="mypath1" / exclude="mypath2") 
>
==========================================
*) I tried setting fork to "yes", but it didn't help. (since all *.java 
are still compiled together at a time).
*) Using "include="mydir/"" works, but I'd have to specify each directory 
separately and define a separate JSP-Task for this, which would be quite 
inconvenient? 

==>
*) Is there any standard way to loop through all subdirectories and 
compile each subdirectory separately (that would solve the problem)? Or do 
I have to write a custom task for this (which would be a general bugfix of 
the whole problem as it appears to me)?

thx alot
Johannes





"Steve Loughran" <st...@iseran.com> 
07.04.2003 08:07
Please respond to
"Ant Users List" <us...@ant.apache.org>


To
"Ant Users List" <us...@ant.apache.org>
cc

Subject
Re: Tomcat JSPC Precompile using Ant - unique jsp name problem







----- Original Message -----
From: <jo...@fwd.at>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Sunday, April 06, 2003 13:54
Subject: Re: Tomcat JSPC Precompile using Ant - unique jsp name problem


> Hi Steve,
>
> Does the jspc-task also work for compiling JSPs using Jasper (and solve
> the problem of similarly named JSPs)?

no, it has the same bug (which is part of jasper) unless you use the
<webapp> feature

> If yes, could you post a brief sample of your working ant 
taskdefinition?

I already have

> > <jspc destdir="build/jspc" compiler="jasper41" >
> >   <webapp basedir="src/webapp" />
> > </jspc>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org