You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/04/03 23:41:35 UTC

DO NOT REPLY [Bug 53032] New: Ant Jasper task fails to run when using XML namespaces; no output; no errors

https://issues.apache.org/bugzilla/show_bug.cgi?id=53032

             Bug #: 53032
           Summary: Ant Jasper task fails to run when using XML
                    namespaces; no output; no errors
           Product: Tomcat 6
           Version: 6.0.35
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: nicholas@nicholaswilliams.net
    Classification: Unclassified


One way to use bulk task definitions in Ant is to use XML namespaces:


<project name="teamcity"
         xmlns:tomcat6="http://tomcat.apache.org/ant/tomcat/6">

...


    <path id="tomcat.6.ant.classpath">
        <fileset dir="${my.path.library.build}/tomcat-6.0.35">
            <include name="*.jar" />
        </fileset>
        <path refid="my.path.compile.jsp" />
    </path>

    <typedef resource="org/apache/catalina/ant/antlib.xml"
             uri="http://tomcat.apache.org/ant/tomcat/6"
             classpathref="tomcat.6.ant.classpath" />

...

    <target>
        <tomcat6:list ... />
        <tomcat6:deploy ... />
    </target>

...
</project>

This works great for list, deploy, etc. In fact, it works great for every other
Ant task as far as I can tell. But it doesn't work for the jasper/jasper2 tasks
(which both point to the same class).

<tomcat6:jasper ... />

This does nothing. And by “nothing” I mean that I use `ant -verbose` when
running Ant, verbose=”1” within the Jasper task, and there’s no output from the
Jasper task, not a single line of output/logging, and the build completes in 0
seconds with no compiled JSPs output.

However, if I define the Jasper task explicitly, using the exact same paths (as
you can clearly see):

    <taskdef classname="org.apache.jasper.JspC" name="tomcat6-jsp-compile">
        <classpath>
            <path refid="tomcat.6.ant.classpath" />
        </classpath>
    </taskdef>

And call the Jasper task using the exact same options:

<tomcat6-jsp-compile ... />

Everything works. It compiles 2,487 JSPs in 275s, and outputs exactly what I
expect, including 2,487 compiled JSPs and two logging messages. From what I
understand about Ant, there should be absolutely no difference, and yet there
apparently is, because they behave differently.

The jasper task should support namespaces like the other Tomcat Ant tasks, and
like other Ant tasks in general.

(Note: I have confirmed at http://ant.apache.org/faq.html that a separate
classloader IS used for the taskdef, and that Jspc will not have access to
conflicting classes loaded by other namespaces.)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53032] Ant Jasper task fails to run when using XML namespaces; no output; no errors

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53032

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Confirmed. Extending Task does fix this.

I'm not convinced that it makes sense to separate the Ant task and JspC. While
the current approach isn't the one I'd select if starting from a clean sheet, I
don't see a compelling argument to change it now.

Fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.

Proposed for 6.0.x

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 53032] Ant Jasper task fails to run when using XML namespaces; no output; no errors

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53032

--- Comment #2 from Nick Williams <ni...@nicholaswilliams.net> 2012-04-04 15:18:54 UTC ---
Since JspC is the only Tomcat Ant task that doesn't work with namespaces, and
JspC is also the only Tomcat Ant task that /doesn't/ extend o.a.tools.ant.Task,
it seems likely that is the culprit. I don't know this for sure, but from my
initial examination of all of the code involved, it appears that is the case.

JspC doesn't extend or implement /any/ Ant classes. As far as Ant goes, it
appears to purely be a hacked-together class that just happens to implement the
minimum methods that Ant expects a task to implement, and this can run as a
task. But it is not, as for as Ant is concerned, an actual Task. It seems very
unlikely that something other than this fact is causing this issue.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 53032] Ant Jasper task fails to run when using XML namespaces; no output; no errors

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53032

--- Comment #1 from Nick Williams <ni...@nicholaswilliams.net> 2012-04-03 22:07:09 UTC ---
Relevant to 53011, 53012, 53031 and 53032: Per discussions with Chris Schultz
in the users list, we agree that it would probably make more sense to separate
the Ant task from the JspC class and place a new Ant task in the
o.a.catalina.ant package (possibly o.a.catalina.ant.jasper?). Research about
the state of the task needs to be completed. Further discussions about this
will take place in the developer's list, and then these issues will be updated
when a consensus is reached.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53032] Ant Jasper task fails to run when using XML namespaces; no output; no errors

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53032

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Konstantin Kolinko <kn...@gmail.com> ---
Fixed in 6.0 with r1353247 and will be in 6.0.36.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org