tags:

views:

79

answers:

2

Has anyone used XHTML Doclet, and can you provide some hints as to how to get it to work successfully?

I run it like this:

\sunjdk\bin\javadoc -doclet net.sourceforge.xhtmldoclet.Doclet  
         -docletpath c:\sw\java\XHTML_Doclet_0.4.jar -d <output>
         [class files here]

(all on one line)

When I run it I get this:

javadoc: error - In doclet class net.sourceforge.xhtmldoclet.Doclet,  method validOptions has thrown an exception java.lang.reflect.InvocationTargetException
java.lang.Error: Fatal: Resource (net.sourceforge.xhtmldoclet.resources.doclet) for javadoc doclets is missing.
        at com.sun.tools.doclets.internal.toolkit.util.MessageRetriever.getText(MessageRetriever.java:110)
        at com.sun.tools.doclets.internal.toolkit.util.MessageRetriever.getText(MessageRetriever.java:92)
        at com.sun.tools.doclets.internal.toolkit.util.MessageRetriever.getText(MessageRetriever.java:81)
        at com.sun.tools.doclets.internal.toolkit.Configuration.getText(Configuration.java:634)
        at com.sun.tools.doclets.internal.toolkit.Configuration.generalValidOptions(Configuration.java:515)
        at net.sourceforge.xhtmldoclet.Config.validOptions(Unknown Source)
        at net.sourceforge.xhtmldoclet.Doclet.validOptions(Unknown Source)
        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:597)
        at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
        at com.sun.tools.javadoc.DocletInvoker.validOptions(DocletInvoker.java:198)
        at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:317)
        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)
1 error

It seems like it ought to just work. What am I doing wrong?

A: 
\sunjdk\bin\javadoc -classpath c:\sw\java\XHTML_Doclet_0.4.jar 
         -doclet net.sourceforge.xhtmldoclet.Doclet  
         -docletpath c:\sw\java\XHTML_Doclet_0.4.jar -d <output>
         [class files here]

all on one line

Mark McLaren
I had two much more complicated previous attempts at this! One involving modifying tools.jar and one involving compiling doclet.properties but the above method works just fine!
Mark McLaren
This gives the same result, for me. . .
Cheeso
A: 

XhtmlDoclet appears to have a bug in its resource handling. I've submitted a bug and a patch to fix it here: https://sourceforge.net/tracker/?func=detail&amp;aid=3006429&amp;group_id=199009&amp;atid=967765

The bug happens when the doclet is trying to output user-visible text, so it's probably trying to print an error message which you can't see because of the bug.

Draemon
thanks for letting me know.
Cheeso