This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 57375 - IOException when trying to generate JavaDoc
Summary: IOException when trying to generate JavaDoc
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 51372 (view as bug list)
Depends on: 70720
Blocks: 64802
  Show dependency tree
 
Reported: 2005-04-02 22:18 UTC by tkellerer
Modified: 2005-10-17 16:32 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Output of the debug run for building javadoc (97.19 KB, text/plain)
2005-04-04 14:46 UTC, tkellerer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tkellerer 2005-04-02 22:18:47 UTC
NetBeans 4.1 (Daily build: 200503301800), JDK 1.4.2_02, WinXP

When I try to build the JavaDoc for my project I get an error message:

Javadoc execution
D:\projects\jworkbench\netbeans41\nbproject\build-impl.xml:339: Javadoc failed:
java.io.IOException: CreateProcess: C:\jdk1.4.2\bin\javadoc.exe -d
D:\projects\jworkbench\netbeans41\dist\javadoc -notree -noindex -windowtitle
JWorkbench -private -sourcepath D:\projects\jworkbench\src -source 1.4
D:\projects\jworkbench\src\workbench\WbManager.java
D:\projects\jworkbench\src\workbench\WbSplash.java
D:\projects\jworkbench\src\workbench\WbStarter.java
D:\projects\jworkbench\src\workbench\db\ASAConstraintReader.java
D:\projects\jworkbench\src\workbench\db\AbstractConstraintReader.java
D:\projects\jworkbench\src\workbench\db\CloudscapeConstraintReader.java
D:\projects\jworkbench\src\workbench\db\ColumnIdentifier.java
D:\projects\jworkbench\src\workbench\db\ConnectionMgr.java
D:\projects\jworkbench\src\workbench\db\ConnectionProfile.java
D:\projects\jworkbench\src\workbench\db\DbDriver.java
D:\projects\jworkbench\src\workbench\db\DbMetadata.java
D:\projects\jworkbench\src\workbench\db\DeleteScriptGenerator.java
D:\projects\jworkbench\src\workbench\db\DependencyNode.java
D:\projects\jworkbench\src\workbench\db\Firebir

BUILD FAILED (total time: 0 seconds)

The number of directories in this output is much to short, and the last one is
even cut off. It seems that some maximum regarding the length of the parameter
is hit and thus the generation fails.

It seems that I'm not the only one:
http://www.netbeans.org/servlets/ReadMsg?listName=nbusers&msgNo=51205
reports a similar error with NB 4.0
Comment 1 Jan Becicka 2005-04-04 08:53:49 UTC
java/platform issue?
Comment 2 Tomas Zezula 2005-04-04 09:57:28 UTC
J2SEProject issue.
Comment 3 Tomas Zezula 2005-04-04 10:15:19 UTC
Which paltform?
It seems as a Windows known cmd.exe issues, it is not able to pass long command
line to the process.
Using the default platform which runs the javadoc internally or using cygwin
bash which allows long command lines may help you.
Comment 4 tkellerer 2005-04-04 10:27:59 UTC
But this was working with NB 3.6 (same project)
Comment 5 Tomas Zezula 2005-04-04 12:23:44 UTC
The NetBeans 3.6 has only the default platform. This is what I have suggested.
If you use the default platform, it should work. 
Please, can you set the OS?
Comment 6 tkellerer 2005-04-04 12:30:11 UTC
Occurs on Win2K and WinXP with the default platform (as a matter of fact, I
don't have a different platform configured). 
Comment 7 Tomas Zezula 2005-04-04 12:44:39 UTC
OK, thanks. I will try to fix it.
Comment 8 Tomas Zezula 2005-04-04 14:23:16 UTC
I've tries it on the WinXP, and it works fine with project having 200 java
files. How big is your project (number of java files, the javadoc is built from)?
Can you run the gnerate javadoc action with verbosity level = debug (You have to
change the Tools/Options/Building/Ant Settings/verbosity level) and attach the
output to this issue. Thanks
Comment 9 tkellerer 2005-04-04 14:46:20 UTC
Created attachment 21349 [details]
Output of the debug run for building javadoc
Comment 10 tkellerer 2005-04-04 14:47:04 UTC
The project has about 500 files in it (The path names are a bit different
compared to my first example, because I tried this on a different computer)
Comment 11 Tomas Zezula 2005-04-04 15:12:20 UTC
Thanks very much.
Could you try one more thing, try to change the -javadoc-build target in the
build-impl.xml in the following way:
Add the attribute useexternalfile="true" into javadoc task.
Does it work?

The -javadoc-build target should look like:
<target name="-javadoc-build" depends="init">
        <mkdir dir="${dist.javadoc.dir}"/>
        <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}"
notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}"
noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}"
author="${javadoc.author}" version="${javadoc.version}"
windowtitle="${javadoc.windowtitle}" private="${javadoc.private}"
additionalparam="${javadoc.additionalparam}" failonerror="true"
useexternalfile="true">
            <classpath>
                <path path="${javac.classpath}"/>
            </classpath>
            <sourcepath>
                <pathelement location="${src.dir}"/>
            </sourcepath>
            <fileset dir="${src.dir}"/>
        </javadoc>
    </target>
Comment 12 Tomas Zezula 2005-04-04 15:16:42 UTC
Save the old build-impl.xml first and restore it after you tried it. You can
also restore the original build-impl.xml by deleting it, closing project and
opening it again.
Comment 13 Tomas Zezula 2005-04-04 15:24:35 UTC
The useexternalfile should work fine, I am going to fix it in this way.
Comment 14 tkellerer 2005-04-04 15:28:59 UTC
Yes, adding useexternalfile="true" works fine. 
Thanks for your help
Comment 15 Tomas Zezula 2005-04-04 17:27:44 UTC
Unfortunately I will not be able to use this fix until the Ant 1.7 is out. The
Ant 1.6.2 has a bug (see
http://issues.apache.org/bugzilla/show_bug.cgi?id=27814) which crashes the
Javadoc on folders containig spaces.
Comment 16 Tomas Zezula 2005-04-05 10:29:04 UTC
The problem appears on the Windows when the command line is longer than 64KB.
The solution is to set the useexternalfile attribute to true, but there is a bug
in the file list generation on the Windows when the path contains space
characters. This solution cannot be used until Ant 1.7 where the issue is fixed.
See: http://issues.apache.org/bugzilla/show_bug.cgi?id=27814

An workaround which does not fix the problem but makes it less often is to use
the packageset rather than the fileset. The list of packages is smaller than the
list of files. But this does not work too. The Ant packageset is not able to
pass an default package.

The issue is related to the Ant, the same problem happens while running an
javadoc task of any Ant script when command line is longer than 64 KB on Windows OS.
Comment 17 Jesse Glick 2005-04-05 15:33:58 UTC
Known to affect only Windows, not other OSs.

Workaround should be to override the -javadoc-build target in build.xml: copy
the basic impl from build-impl.xml, but also set useexternalfile="true".
Additionally, ensure that the directory in which you are keeping your project's
sources does not contain any spaces. If it does, move your project to one that
does not. (Generally good advice for Windows users anyway.)

Workaround only applies to people using the default platform. People using a
specific target JDK will anyway see a quite different -javadoc-build, due to a
workaround for an unrelated bug. Not sure what happens in that case, whether
they see a similar bug or not.
Comment 18 Jan Chalupa 2005-04-07 12:56:36 UTC
There were no objections to the waiver. Considered approved for 4.1.
Comment 19 Tomas Zezula 2005-09-20 15:57:01 UTC
Checking in
j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectGenerator.java;
/cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectGenerator.java,v
 <--  J2SEProjectGenerator.java
new revision: 1.41; previous revision: 1.40
done
Checking in
j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl;
/cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v
 <--  build-impl.xsl
new revision: 1.63; previous revision: 1.62
done
Comment 20 Tomas Zezula 2005-10-17 16:32:42 UTC
*** Issue 51372 has been marked as a duplicate of this issue. ***