This discussion is archived
11 Replies Latest reply: Oct 27, 2008 1:03 PM by thomas.behr RSS

IllegalArgumentException executing javadoc in 5.0RC

843810 Newbie
Currently Being Moderated
When I used Javadoc today with the release candidate of the JDK5.0, i got the following IllegalArgumentException (and two DocletAbortExceptions):
>D:\jdk15\bin\javadoc -package -author -d javadoc -subpackages de -subpackages main 

Loading source files for package de.menc.rfc... 
Loading source files for package de.menc.rfc.pop... 
Loading source files for package main.ebay... 
Loading source files for package main... 
Loading source files for package main.start... 
Constructing Javadoc information... 
Standard Doclet version 1.5.0-rc 
Building tree for all the packages and classes... 
Generating javadoc\de/menc/rfc/\AlreadyConnectedException.html... 
java.lang.IllegalArgumentException 
        at sun.net.www.ParseUtil.decode(ParseUtil.java:183) 
        at sun.misc.URLClassPath$FileLoader.<init>(URLClassPath.java:860) 
        at sun.misc.URLClassPath$3.run(URLClassPath.java:316) 
        at java.security.AccessController.doPrivileged(Native Method) 
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:310) 
        at sun.misc.URLClassPath.getLoader(URLClassPath.java:287) 
        at sun.misc.URLClassPath.findResource(URLClassPath.java:138) 
        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(ClassBuilder.java:108) 
        at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64) 
        at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42) 
        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(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215) 
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91) 
        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(ClassBuilder.java:108) 
        at com.sun.tools.doclets.formats.html.HtmlDoclet.generateClassFiles(HtmlDoclet.java:155) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64) 
        at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42) 
        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(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215) 
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91) 
        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(HtmlDoclet.java:159) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateClassFiles(AbstractDoclet.java:164) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:106) 
        at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64) 
        at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42) 
        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(DelegatingMethodAccessorImpl.java:25) 
        at java.lang.reflect.Method.invoke(Method.java:585) 
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215) 
        at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91) 
        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)
I also tried to do it using SyncJEdit100, wich automatically generates the parameters for javadoc, but it ended in the same result.
I hope that anyone is able to help me.

Thanks

PS: I don't think I tried to do that with earlier versions of the JDK5.
PS2: Sorry for the English, I'm learning it only since three years ago yet.
  • 1. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    I am getting the exact same error when I try to build docs with javadoc 5.0 (from the 1.5.0-rc). All my docs build fine with the javadoc from 1.4, no warnings, etc.

    Has anybody been successfull building docs with javadoc 5.0?
  • 2. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    This problem is almost definitely the result of a classpath issue. Try removing unneeded entries from your system classpath or, if possible, removing all entries. If it's not possible for you to remove all classpath entries, you'll have to experiment. If you see any references to the JDK source (~src.jar), I'd recommend removing them first.

    Good luck!
  • 3. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    I got the same error, too. After cleaning up my classpath variable javadoc 1.5.0 works correctly now.
    Thanks, HiTechRedneck.
  • 4. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    Indeed it was a classpath problem, but I did not have to remove VALID entries. I forgot to remove a reference to another environment variable (that got deleted) from my classpath settings:
    blahblah;%oldsubclasspathvariable_that_got_removed%;blahblah...
    Removing the old entry from the classpath solved the problem.
    Sad, that JavaDoc doesn't report the error in a clearer fashion ;-(
    Thanks for the hint!
  • 5. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    I'm seeing the same issue - with a nice, clean classpath (I'm driving javadoc from Ant 1.6). I've cleaned up the classpath as best I can and I cannot get javadoc to 'doc' my classes.

    I am using jini in my application, and it appears that as soon as i add the jini jar file to the class path, the javadoc program takes a dump.

    has anyone any other tips (particularly what the the java doc program is objecting to - if its a particular shape of class, I'm sure I can clean that up somewhat)

    For instance, I don' t have the java sources to jini in my src path, but, as i'm not javadocing jini, I wouldnt have expected this to be a problem.

    any suggestions?

    -T
  • 6. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    Hi:

    I'm running windows xp... and I got the same IllegalArgumentException problem tonight. The problem was my CLASSPATH environment variable was malformed:

    CLASSPATH=%CLASSPATH%;%JDK_HOME%\lib\tools.jar;C:\jdk1.5.0_04\lib\tools.jar;C:\jdk1.5.0_04\lib\tools.jar

    I removed all items from the classpath. I ran this command in MSDOS
    CMD window (under windows XP):
    set CLASSPATH=""

    [Alternatively, I just found out that
        set CLASSPATH=
    command will remove the enviroment variable completely, and this is the *BETTER* way.. read more below.]


    After that doing either above, the javadoc IllegalArgumentException problem went away ...

    By the way.. there is a -classpath argument for javadoc.... When I had the corrupted CLASSPATH, I tried to "override" it by this command:
    javadoc -classpath . file.java
    But I got the same IllegalArgumentException. Go figure.

    Therefore, the -classpath argument does NOT completely override the CLASSPATH environment variable... That is what I concluded.

    By the way, I do NOT recommend to set your CLASSPATH="". I found that ant 1.6.5 was acting weird (ant -p was not displaying the target names, but was doing actually running the build.xml file) when I did that ... So the better way to remove everything from CLASSPATH is this:
    set CLASSPATH=
  • 7. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    Clearing/cleaning system environment classpath is dead on the money. THANK YOU! Setting a correct classpath within the ant target is insufficient.

    On Windows XP, using jdk1.5.0_06, I cleared the system environment variable classpath back to ".", then restarted Eclipse. IllegalArgumentException went away.
  • 8. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    Please refer last entry on this forum:

    http://forum.java.sun.com/thread.jspa?messageID=9406945
  • 9. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    I may have stumble on to the cause.... It appears that ant does not do symbolic substituion for environment entries. Removing the symbolics in my classpath entry fixed my IllegalArgumentException.
    Using the following in my ant script to display the classpath value:
    <property environment="env"/>
    <echo message="CLASSPATH value is ${env.CLASSPATH}"/>

    With symbolics, got exception:
    [echo] CLASSPATH value is .;%JAVA_HOME%\jre\lib\core.jar;%JAVA_HOME%\lib\tools.jar

    Without symbolics, ran fine:
    [echo] CLASSPATH value is .;C:\Program Files\IBM\SDP70\runtimes\base_v61\java\jre\lib\core.jar;C:\Program Files\IBM\SDP70\runtimes\base_v61\java\lib\tools.jar

    Same results from command line or from withing eclicpse (RAD).
    Confirmation apprceciated. Workarounds other than modifying classpath happily accepted.
    Ahoy.
  • 10. Re: IllegalArgumentException executing javadoc in 5.0RC
    843810 Newbie
    Currently Being Moderated
    The removal of symbolics from the classpath also worked for me initially. But after further testing, I found that my JAVA_HOME variable was built from other symbolics (e.g. JAVA_HOME=%OTHERVAR1%\%OTHERVAR2%).

    When I changed it to remove the symbolics from the value of JAVA_HOME (e.g. JAVA_HOME=C:\xxx\xxx\java), I found that it worked. Leaving me to believe that as long as you didn't put a symbolic in the CLASSPATH that had embedded symbolics in its value, then you will be okay. This way at least you have one level of re-use possible.
  • 11. Re: IllegalArgumentException executing javadoc in 5.0RC
    thomas.behr Newbie
    Currently Being Moderated
    Keegan wrote:
    The removal of symbolics from the classpath also worked for me initially. But after further testing, I found that my JAVA_HOME variable was built from other symbolics (e.g. JAVA_HOME=%OTHERVAR1%\%OTHERVAR2%).

    When I changed it to remove the symbolics from the value of JAVA_HOME (e.g. JAVA_HOME=C:\xxx\xxx\java), I found that it worked. Leaving me to believe that as long as you didn't put a symbolic in the CLASSPATH that had embedded symbolics in its value, then you will be okay. This way at least you have one level of re-use possible.
    Thanks for reviving a four year old thread for the fourth time. Don't you think it deserves to rest in peace by now?