You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Bryan Pendleton <bp...@amberpoint.com> on 2006/09/07 06:59:16 UTC

DITA docs build problem - cannot replace ref with reftemp

I'm trying to learn how to build the docs from the DITA source,
following the instructions in http://db.apache.org/derby/manuals/dita.html

I think I have the tree set up correctly, and I modified the one file
that I wanted to modify, and then I ran

   ant html.ref

The system whirred and hummed for a *long* time, produced lots of
apparently successful output, but then failed with the errors below.

I've tried cleaning and rebuilding multiple times, and the error is
the same each time.

Any ideas? Do I have something misconfigured? Am I issuing the
wrong build command?

thanks,

bryan

============================================================================


copy-css-default:
      [copy] Copying 3 files to /home2/bpendleton/src/derby/docs/trunk/out/reftemp

copy-css-user:
      [move] Moving 352 files to /home2/bpendleton/src/derby/docs/trunk/out/ref

BUILD FAILED
/home2/bpendleton/src/derby/docs/trunk/build.xml:106: The following error occurred while executing this line:
/home2/bpendleton/src/derby/docs/trunk/build.xml:151: Cannot replace directory /home2/bpendleton/src/derby/docs/trunk/out/ref with 
directory /home2/bpendleton/src/derby/docs/trunk/out/reftemp




Re: DITA docs build problem - cannot replace ref with reftemp

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Andrew McIntyre wrote:
> What version of Ant are you using? 

Thanks Andrew, that was exactly it! I was using Ant 1.6.4 on that
machine, and it so happens that the only difference between 1.6.4
and 1.6.5 is that they fixed a bug in the <move> task :)

thanks again for your help.

bryan




Re: Re: Re: DITA docs build problem - cannot replace ref with reftemp

Posted by Andrew McIntyre <mc...@gmail.com>.
On 9/7/06, Andrew McIntyre <mc...@gmail.com> wrote:
>
> In the meantime, I'll build the HTML ref manual with your change so
> that it is easier for others to review (although it looks like there's
> already a positive review from Rick).

Just realized after looking at DERBY-1765 that John already did this.
Thanks, John!

andrew

Re: Re: DITA docs build problem - cannot replace ref with reftemp

Posted by Andrew McIntyre <mc...@gmail.com>.
On 9/7/06, Bryan Pendleton <bp...@amberpoint.com> wrote:
> Andrew McIntyre wrote:
> > Try deleting your out directory completely and then running the
> > html.ref target again.
>
> Hi Andrew, thanks for the suggestions. Unfortunately, it didn't help.
>
> I ran "ant -verbose html.ref" and captured the output, and the last
> page or two is pasted below.
>
> I guess I'm not quite sure what Ant is trying to do here. It seems
> to have decided to copy each of the files from the old directory ("reftemp")
> to the new directory ("ref"), and it succeeds at doing that, but then
> it tries to rename the directory "reftemp" to be the directory "ref", and
> of course that fails because the directory "ref" already exists at this
> point.
>
> I think that Ant should have either
>   - simply renamed the directory, without copying its contents from the old
>     directory name to the new directory name, or
>   - copied all the contents, but then simply deleted the old directory at the
>     end, no need to rename the directory because all the contents have been
>     copied to the new directory.
>
> Is any of this making sense? I guess I should go read the DITA build.xml files.

Well, I'm following you, but it is rather odd. And I'm really
wondering why you're the first person to hit the problem. I'm guessing
that it's these lines:

    <!-- move any remaining files over -->
    <move todir="${basedir}/out/${manual.name}">
      <fileset dir="${basedir}/out/${manual.name}temp"/>
    </move>

And that at this point, Ant is trying to just move the directory,
instead of the remaining files in the directory, over to out/ref,
which is obviously the wrong thing to do. :-)

What version of Ant are you using? Maybe try updating to Ant 1.6.5, if
that's not the version you are already using, since it works properly
for me with 1.6.5 (and 1.6.2, FWIW).

In the meantime, I'll build the HTML ref manual with your change so
that it is easier for others to review (although it looks like there's
already a positive review from Rick).

andrew

Re: DITA docs build problem - cannot replace ref with reftemp

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Andrew McIntyre wrote:
> Try deleting your out directory completely and then running the
> html.ref target again.

Hi Andrew, thanks for the suggestions. Unfortunately, it didn't help.

I ran "ant -verbose html.ref" and captured the output, and the last
page or two is pasted below.

I guess I'm not quite sure what Ant is trying to do here. It seems
to have decided to copy each of the files from the old directory ("reftemp")
to the new directory ("ref"), and it succeeds at doing that, but then
it tries to rename the directory "reftemp" to be the directory "ref", and
of course that fails because the directory "ref" already exists at this
point.

I think that Ant should have either
  - simply renamed the directory, without copying its contents from the old
    directory name to the new directory name, or
  - copied all the contents, but then simply deleted the old directory at the
    end, no need to rename the directory because all the contents have been
    copied to the new directory.

Is any of this making sense? I guess I should go read the DITA build.xml files.

thanks,

bryan

      [move] Attempting to rename: 
/home2/bpendleton/src/derby/docs/trunk/out/reftemp/refconrefs.html to 
/home2/bpendleton/src/derby/docs/trunk/out/ref/refconrefs.html
      [move] Copying /home2/bpendleton/src/derby/docs/trunk/out/reftemp/refconrefs.html to 
/home2/bpendleton/src/derby/docs/trunk/out/ref/refconrefs.html
      [move] Attempting to rename: 
/home2/bpendleton/src/derby/docs/trunk/out/reftemp/crefjavccns.html to 
/home2/bpendleton/src/derby/docs/trunk/out/ref/crefjavccns.html
      [move] Copying /home2/bpendleton/src/derby/docs/trunk/out/reftemp/crefjavccns.html to 
/home2/bpendleton/src/derby/docs/trunk/out/ref/crefjavccns.html
      [move] Attempting to rename: 
/home2/bpendleton/src/derby/docs/trunk/out/reftemp/rrefcallprocedure.html to 
/home2/bpendleton/src/derby/docs/trunk/out/ref/rrefcallprocedure.html
      [move] Copying /home2/bpendleton/src/derby/docs/trunk/out/reftemp/rrefcallprocedure.html to 
/home2/bpendleton/src/derby/docs/trunk/out/ref/rrefcallprocedure.html
      [move] Attempting to rename dir: /home2/bpendleton/src/derby/docs/trunk/out/reftemp to 
/home2/bpendleton/src/derby/docs/trunk/out/ref
   [antcall] Exiting /home2/bpendleton/src/derby/docs/trunk/build.xml.

BUILD FAILED
/home2/bpendleton/src/derby/docs/trunk/build.xml:106: The following error occurred while executing 
this line:
/home2/bpendleton/src/derby/docs/trunk/build.xml:151: Cannot replace directory 
/home2/bpendleton/src/derby/docs/trunk/out/ref with directory 
/home2/bpendleton/src/derby/docs/trunk/out/reftemp
         at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)
         at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
         at org.apache.tools.ant.Task.perform(Task.java:364)
         at org.apache.tools.ant.Target.execute(Target.java:341)
         at org.apache.tools.ant.Target.performTasks(Target.java:369)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
         at org.apache.tools.ant.Main.runBuild(Main.java:668)
         at org.apache.tools.ant.Main.startAnt(Main.java:187)
         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: /home2/bpendleton/src/derby/docs/trunk/build.xml:151: Cannot replace directory 
/home2/bpendleton/src/derby/docs/trunk/out/ref with directory 
/home2/bpendleton/src/derby/docs/trunk/out/reftemp
         at org.apache.tools.ant.taskdefs.Move.renameFile(Move.java:386)
         at org.apache.tools.ant.taskdefs.Move.doFileOperations(Move.java:133)
         at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:430)
         at org.apache.tools.ant.taskdefs.Move.execute(Move.java:111)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
         at org.apache.tools.ant.Task.perform(Task.java:364)
         at org.apache.tools.ant.Target.execute(Target.java:341)
         at org.apache.tools.ant.Target.performTasks(Target.java:369)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
         ... 13 more
--- Nested Exception ---
/home2/bpendleton/src/derby/docs/trunk/build.xml:151: Cannot replace directory 
/home2/bpendleton/src/derby/docs/trunk/out/ref with directory 
/home2/bpendleton/src/derby/docs/trunk/out/reftemp
         at org.apache.tools.ant.taskdefs.Move.renameFile(Move.java:386)
         at org.apache.tools.ant.taskdefs.Move.doFileOperations(Move.java:133)
         at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:430)
         at org.apache.tools.ant.taskdefs.Move.execute(Move.java:111)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
         at org.apache.tools.ant.Task.perform(Task.java:364)
         at org.apache.tools.ant.Target.execute(Target.java:341)
         at org.apache.tools.ant.Target.performTasks(Target.java:369)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
         at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
         at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
         at org.apache.tools.ant.Task.perform(Task.java:364)
         at org.apache.tools.ant.Target.execute(Target.java:341)
         at org.apache.tools.ant.Target.performTasks(Target.java:369)
         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
         at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
         at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
         at org.apache.tools.ant.Main.runBuild(Main.java:668)
         at org.apache.tools.ant.Main.startAnt(Main.java:187)
         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

Total time: 6 minutes 46 seconds


Re: DITA docs build problem - cannot replace ref with reftemp

Posted by Andrew McIntyre <mc...@gmail.com>.
On 9/6/06, Bryan Pendleton <bp...@amberpoint.com> wrote:
>
> Any ideas? Do I have something misconfigured? Am I issuing the
> wrong build command?
>
> copy-css-user:
>       [move] Moving 352 files to /home2/bpendleton/src/derby/docs/trunk/out/ref
>
> /home2/bpendleton/src/derby/docs/trunk/build.xml:151: Cannot replace directory /home2/bpendleton/src/derby/docs/trunk/out/ref with
> directory /home2/bpendleton/src/derby/docs/trunk/out/reftemp

My guess is that you have a file open in the output directory,
out/ref, that your OS is preventing Ant from deleting during the move
of reftemp to ref. That move, by the way, is used to insert the Apache
license headers into the HTML files.

Try deleting your out directory completely and then running the
html.ref target again.

HTH,
andrew