Issue Details (XML | Word | Printable)

Key: XDT-879
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: xdoclet-devel (Use for new issues)
Reporter: Matt Raible
Votes: 4
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
XDoclet

Fix for "destDir attribute must be present."

Created: 25/Apr/04 11:57 PM   Updated: 01/Jun/06 03:45 PM
Component/s: Core
Affects Version/s: 1.2.1
Fix Version/s: 1.3

Time Tracking:
Not Specified

File Attachments: 1. Text File DocletTask.diff.patch (1.0 kB)
2. Text File DocletTask.patch (0.7 kB)
3. Text File XDT879.patch (1 kB)

Environment: Windows XP, JDK 1.4.2, Ant 1.6.1


 Description  « Hide
When I do an "ant clean" and try to run "webdoclet" on my project, I get the following error:

"destDir attribute must be present."

According to the following Ant bug report:

It is a bug in the xdoclet code.
At the end of the execute method, it cleans up (nulls)
some internal variables. This code also incorrectly nulls the
destdir attribute.

http://issues.apache.org/bugzilla/show_bug.cgi?id=26310

I'll attach a patch that seems to fix this problem. Note that it only happens when I do a clean checkout and the first build on my project.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Matt Raible added a comment - 27/Apr/04 11:16 PM
Now I'm getting the following issue when I do a clean and then run webdoclet:
[xdoclet] java.lang.NullPointerException
[xdoclet] at xdoclet.DocletTask.getConfigParams(DocletTask.java:439)
[xdoclet] at xdoclet.DocletTask.createContext(DocletTask.java:615)
[xdoclet] at xdoclet.DocletTask.validateSubTasks(DocletTask.java:517)
[xdoclet] at xdoclet.DocletTask.validateOptions(DocletTask.java:491)
[xdoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:94)
[xdoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[xdoclet] at org.apache.tools.ant.Target.execute(Target.java:301)
[xdoclet] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[xdoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[xdoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
[xdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:632)
[xdoclet] at org.apache.tools.ant.Main.startAnt(Main.java:183)
[xdoclet] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
[xdoclet] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

I'm guessing that the last changed fix that issue, but caused this one. Who knows. Any ideas on how to resolve this incompatibility with 1.6.1?

Matt Raible added a comment - 01/Sep/04 05:32 PM
Anyone have a clue how to fix this one? I tried again today with no luck. I'd be happy with a workaround if no one knows of a fix.

Matt Raible added a comment - 02/Sep/04 03:27 PM
On 2nd check, this patch does seem to work. The NPE was caused by recompiling and not including the new xdoclet-xdoclet-module-version.jar. If there are no objections, I'd like to check this in. I've tested it with Ant 1.6.2 and Ant 1.5.4.

The error seems to occur when you try to run an XDoclet task twice in the same Ant execution.

Tom Cunningham added a comment - 08/Oct/04 01:16 PM
I've tried patching 1.2.1 and 1.2.2rc1 with this and I still get the following NPE. I'm sure I included all of the required jars.

[webdoclet] java.lang.NullPointerException
[webdoclet] at xdoclet.DocletTask.getConfigParams(DocletTask.java:439)
[webdoclet] at xdoclet.DocletTask.createContext(DocletTask.java:615)
[webdoclet] at xdoclet.DocletTask.validateSubTasks(DocletTask.java:517)
[webdoclet] at xdoclet.DocletTask.validateOptions(DocletTask.java:491)
[webdoclet] at xdoclet.modules.web.WebDocletTask.validateOptions(WebDocletTask.java:24)
[webdoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:94)
[webdoclet] at org.apache.tools.ant.Task.perform(Task.java:364)
[webdoclet] at org.apache.tools.ant.Target.execute(Target.java:341)
[webdoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[webdoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[webdoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[webdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:673)
[webdoclet] at org.apache.tools.ant.Main.startAnt(Main.java:188)
[webdoclet] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[webdoclet] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Rory Winston added a comment - 14/Oct/04 09:50 AM
This issue has bitten me as well - latest (1.2.2 RC1) XDoclet, Ant 1.6.2, and Clover 1.3.1. This bug only happens when I run the build script with Clover enabled.

Matt Raible added a comment - 25/Oct/04 07:02 PM
Here's a 2nd patch that fixes the problem form me. I'm using Ant 1.6.2 on Windows XP.

Matt Raible added a comment - 08/Apr/05 12:32 PM
Fixed in CVS.

Matt Raible added a comment - 08/Apr/05 01:11 PM
CVS COMMIT LOG:
SUBJECT: [Xdoclet-devel] CVS: xdoclet/core/src/xdoclet DocletTask.java,1.63,1.64
Fixed "destDir attribute must be present" error that happens when running targets twice in Ant 1.6 (XDT-879)


Matt Raible added a comment - 20/Mar/06 09:59 PM
Re-opened to back out change.

Matt Raible added a comment - 20/Mar/06 10:00 PM
Backed out change since it seems to cause more problems than it fixes.

Konstantin Sobolev added a comment - 01/Jun/06 03:45 PM
Here's a quick hack against 1.2.3 which fixes this problem for me.