United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6219854 Javadoc throws IllegalArgumentException during during normal useage
JDK-6219854 : Javadoc throws IllegalArgumentException during during normal useage

Details
Type:
Bug
Submit Date:
2005-01-21
Status:
Open
Updated Date:
2010-04-04
Project Name:
JDK
Resolved Date:
Component:
docs
OS:
windows_xp
Sub-Component:
doclet
CPU:
x86
Priority:
P5
Resolution:
Unresolved
Affected Versions:
5.0,5.0u4
Targeted Versions:

Related Reports
Duplicate:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
I'm trying to run simple javadoc from the command line on a test heirarchy that contains only a single Main class.  I've tried several configurations, but it always fails.  It also fails when I try it as an ant task.

One command line I've tried is:

javadoc com.kitfox.violet


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a package structure and create a Main file at com.kitfox.violet.Main.  It does not need to contain much more than the main(String[] argv) method

Type the following line at the command prompt:

javadoc com.kitfox.violet

Source Code:

package com.kitfox.violet;

public class Main {

public static void main(String args[]) {

}
}

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Javadoc should be produced
ACTUAL -
Received an error message

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Loading source files for package com.kitfox.violet...
Constructing Javadoc information...
Standard Doclet version 1.5.0_01
Building tree for all the packages and classes...
Generating com/kitfox/violet/\Main.html...
java.lang.IllegalArgumentException
        at sun.net.www.ParseUtil.decode(ParseUtil.java:183)
        at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:863)
        at sun.misc.URLClassPath$3.run(URLClassPath.java:319)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
        at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
        at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
        at java.lang.ClassLoader.getResource(ClassLoader.java:977)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1159)
        at javax.xml.parsers.SecuritySupport$4.run(SecuritySupport.java:72)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.xml.parsers.SecuritySupport.getResourceAsStream(SecuritySupport
.java:65)
        at javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.
java:213)
        at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
        at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:
107)
        at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML
(LayoutParser.java:72)
        at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(Cl
assBuilder.java:108)
        at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(Html
Doclet.java:155)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:164)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration
(AbstractDoclet.java:106)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractD
oclet.java:64)
        at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:4
2)
        at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
        at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
        at com.sun.tools.javadoc.Start.begin(Start.java:128)
        at com.sun.tools.javadoc.Main.execute(Main.java:41)
        at com.sun.tools.javadoc.Main.main(Main.java:31)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
        at com.sun.tools.doclets.internal.toolkit.builders.LayoutParser.parseXML
(LayoutParser.java:79)
        at com.sun.tools.doclets.internal.toolkit.builders.ClassBuilder.build(Cl
assBuilder.java:108)
        at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(Html
Doclet.java:155)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:164)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration
(AbstractDoclet.java:106)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractD
oclet.java:64)
        at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:4
2)
        at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
        at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
        at com.sun.tools.javadoc.Start.begin(Start.java:128)
        at com.sun.tools.javadoc.Main.execute(Main.java:41)
        at com.sun.tools.javadoc.Main.main(Main.java:31)
com.sun.tools.doclets.internal.toolkit.util.DocletAbortException
        at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(Html
Doclet.java:159)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFi
les(AbstractDoclet.java:164)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration
(AbstractDoclet.java:106)
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractD
oclet.java:64)
        at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:4
2)
        at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
        at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
        at com.sun.tools.javadoc.Start.begin(Start.java:128)
        at com.sun.tools.javadoc.Main.execute(Main.java:41)
        at com.sun.tools.javadoc.Main.main(Main.java:31)

REPRODUCIBILITY :
This bug can be reproduced always.

Release Regression From : 1.4.2_06
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 2005-1-21 00:13:53 GMT
As noted by Doug, this isn't a bug. If the classpath is unset, everything works fine.
An RFE could be filed to have javadoc give a more helpful warning regarding this

                                    

Comments
EVALUATION

I just tested the source file on the same version of Windows and Java:
Win XP 5.1.2600 SP2 Build 2600 with javadoc build 1.5.0-b64 
and it runs fine, generating all the docs with no errors,

C:>"c:\program files\java\jdk1.5.0\bin\javadoc" -d html com.kitfox.violet 
Loading source files for package com.kitfox.violet...
Constructing Javadoc information...
Standard Doclet version 1.5.0
Building tree for all the packages and classes...
Generating html\com/kitfox/violet/\Main.html...
Generating html\com/kitfox/violet/\package-frame.html...
Generating html\com/kitfox/violet/\package-summary.html...
Generating html\com/kitfox/violet/\package-tree.html...
Generating html\constant-values.html...
Building index for all the packages and classes...
Generating html\overview-tree.html...
Generating html\index-all.html...
Generating html\deprecated-list.html...
Building index for all classes...
Generating html\allclasses-frame.html...
Generating html\allclasses-noframe.html...
Generating html\index.html...
Generating html\help-doc.html...
Generating html\stylesheet.css...

Recommendation:
If classpath is set as an environment variable, try unsetting it.

###@###.### 2005-2-01 04:52:39 GMT

Submitter Mark_McKay stated:
I unset my classpath, and it started working again.  Thanks.

###@###.### 2005-2-03

I removed the regression keyword, since this is not really a bug.

Asked submitter.
It seems we could implement a better trap for this classpath error and
output a meaningful error message.

For example, could we at least display the value of classpath in
either the standard or error output stream?  This would make it
easier for us to debug, as we wouldn't have to ask them what it's
set to.

Can you please tell me what the classpath had been set to?
Was it pointing to a pre-5.0 version of tools.jar ?

###@###.### 2005-2-03 20:38:49 GMT

###@###.### 2005-07-18 20:26:15 GMT
                                     
2005-02-01



Hardware and Software, Engineered to Work Together