iamthechad/javadoc2dash

Failed to create docset: Failed to index javadoc files

Closed this issue · 6 comments

I tried to create a docset for the javaslang library. I downloaded the javadoc from maven-central. Extracted the jar file to a local folder, then ran j2d-cli (version 1.0.7).

The output was Failed to create docset: Failed to index javadoc files.

Here is the output when run with the --verbose option:

Docset directory structure created
Looking for javadoc files
Found javadoc files
Copied javadoc files into docset
Created the plist file in the docset
Failed to create docset: Failed to index javadoc files

I changed the source to get a more precise error description (maybe --verbose should turn this on by default), and I got it:

Failed to create docset: com.megatome.j2d.exception.BuilderException: Failed to index javadoc files
com.megatome.j2d.exception.BuilderException: Failed to index javadoc files
    at com.megatome.j2d.support.JavadocSupport.loadAndFindLinks(JavadocSupport.java:195)
    at com.megatome.j2d.support.JavadocSupport.indexClassFile(JavadocSupport.java:150)
    at com.megatome.j2d.support.JavadocSupport.findSearchIndexValues(JavadocSupport.java:106)
    at com.megatome.j2d.DocsetCreator.makeDocset(DocsetCreator.java:149)
    at com.megatome.j2d.DocsetCreator.makeDocset(DocsetCreator.java:158)
    at com.megatome.j2d.Main.main(Main.java:64)
Caused by: java.io.FileNotFoundException: /home/emmanuel/Downloads/javaslang-javadoc/javaslang/%CE%BB.html (No such file or directory)
    at java.io.RandomAccessFile.open0(Native Method)
    at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
    at org.jsoup.helper.DataUtil.readFileToByteBuffer(DataUtil.java:176)
    at org.jsoup.helper.DataUtil.load(DataUtil.java:40)
    at org.jsoup.Jsoup.parse(Jsoup.java:103)
    at com.megatome.j2d.support.JavadocSupport.loadAndFindLinks(JavadocSupport.java:192)
    ... 5 more

The issue is that javaslang has a class named λ:
http://static.javadoc.io/io.javaslang/javaslang/2.0.2/javaslang/%CE%BB.html

and I think that means it's a bug in the jsoup library...

Opened a jsoup bug as you can see. Renaming the file to %CE%BB helped with the issue otherwise...

Thanks for letting me know about this. I'll keep an eye on the jsoup issue and grab the latest version when it's ready.

I'll also take a look at what I can do to give some more useful output when something goes wrong. It is indeed a bit tough to troubleshoot the problem when you can't even get to a proper stack trace.

So it turns out I was wrong to blame jsoup, sent you a PR.

Fixed by #9