The following issue has been updated:
Updater: Andrew Stevens (mailto:[EMAIL PROTECTED])
Date: Sun, 9 Mar 2003 6:33 PM
Changes:
[Component] set to [Core]
---------------------------------------------------------------------
For a full history of the issue, see:
http://opensource.atlassian.com/projects/xdoclet/secure/ViewIssue.jspa?key=XDT-349&page=history
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/xdoclet/secure/ViewIssue.jspa?key=XDT-349
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XDT-349
Summary: TemplateParser fails on templates that define a tag handler and uses a
block tag from that handler
Type: Bug
Status: Assigned
Priority: Critical
Time Spent: Unknown
Estimate: 0 minutes
Project: XDoclet
Component: Core
Versions:
1.2 Beta 2
Assignee: xdoclet-devel (Use for new issues)
Reporter: Basil Vandegriend
Created: Tue, 4 Mar 2003 2:38 PM
Updated: Sun, 9 Mar 2003 6:33 PM
Environment: JDK 1.4.1_01, Ant 1.5.1
Description:
To reproduce:
1. Create a template that first defines a tag handler, then uses a block tag from that
tag handler. I.e.:
<XDtTagDef:tagDef namespace="Macro" handler="...MacroTagsHandler"/>
<XDtMacro:eval>
...
</XDtMacro:eval>
2. Run the template subtask of doclettask using that template. I.e.
<doclet ...>
<template .../>
xDoclet will fail only when the template file is _not_ newer than the target file.
The ant output is as follows:
[doclet] Running <template/>
[doclet] (TemplateEngine.getTagHandlerFor 199 ) Could not find tag handler for
prefix: Macro
[doclet] (XDocletMain.start 51 ) Running XDoclet failed.
[doclet] (XDocletMain.start 52 ) <<xdoclet.XDocletException:
Running XDoclet failed.: xdoclet.template.TemplateException: Could not find tag
handler for prefix: Macro>>
[doclet] xdoclet.XDocletException: Running XDoclet failed.:
xdoclet.template.TemplateException: Could not find tag handler for prefix: Macro
[doclet] at xdoclet.XDocletTagSupport.generate(XDocletTagSupport.java:752)
[doclet] at
xdoclet.tagshandler.MergeTagsHandler.generateUsingMergedFile(MergeTagsHandler.java:244)
[doclet] at xdoclet.tagshandler.MergeTagsHandler.merge(MergeTagsHandler.java:80)
[doclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[doclet] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[doclet] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[doclet] at java.lang.reflect.Method.invoke(Method.java:324)
[doclet] at xdoclet.template.TemplateParser.invoke(TemplateParser.java:183)
[doclet] at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:483)
[doclet] at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:908)
[doclet] at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:875)
[doclet] at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:425)
[doclet] at xdoclet.template.TemplateParser.generate(TemplateParser.java:114)
[doclet] at xdoclet.template.TemplateParser.start(TemplateParser.java:84)
[doclet] at
xdoclet.GenerationManager.isGenerationNeeded(GenerationManager.java:303)
[doclet] at
xdoclet.GenerationManager.isTemplateNewerThanFile(GenerationManager.java:228)
[doclet] at
xdoclet.GenerationManager.isGenerationNeeded(GenerationManager.java:136)
[doclet] at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:753)
The cause of this problem seems to be due to the following:
1. The TemplateSubTask determines if generation is necessary by calling
isGenerationNeeded() on the GenerationManager.
2. After determining that the template file is not newer than the target file, the
GenerationManager wants to check all merged templates.
3. It does this by instantiating a TemplateParser (a subclass of TemplateEngine) to
run on the template and build up a collection of merged files.
4. The TemplateParser has overriden the invoke() method (which invokes tags) to ignore
all tags except merge. This means that the TemplateParser ignores <XDtTagDef:tagDef>
tags.
After this, I'm not sure where the problem is. Note that the reported error message
(Could not find tag handler for prefix:) seems to come from
TemplateEngine.getTagHandlerFor(), which seems bizarre since TemplateParser overrides
this method. So perhaps the wrong engine instance ends up being used at some point -
perhaps when parsing a merge file?
The workaround to try is to define the tag handlers outside of the templates.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/xdoclet/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel