Java XHTML Doclet: fatal exception

冷暖自知 提交于 2020-01-05 12:10:57

问题


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?


回答1:


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&aid=3006429&group_id=199009&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.




回答2:


\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



来源:https://stackoverflow.com/questions/2533556/java-xhtml-doclet-fatal-exception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!