Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javadoc search doesn't work #27

Closed
joel-costigliola opened this issue Aug 18, 2019 · 6 comments
Closed

Javadoc search doesn't work #27

joel-costigliola opened this issue Aug 18, 2019 · 6 comments

Comments

@joel-costigliola
Copy link

Hi,

I discovered javadoc.io a few months ago and was super happy to use it for AssertJ Core.
AssertJ Core is targeted for java 8 but built with java 11, the javadoc built search capability is broken when navigating to the result: searching in the search textbox correctly shows the list of candidates corresponding to the text searched but when one selects a candidate the page displays an error like:

<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>5641D62303D47982</RequestId><HostId>Qy3TFOaRnVsj1V+RaZm9NruF12OGY7XVCZH8AxVY3z0QEVRWgMfpy6JD3WGJAOFVUcBsPxp+W8k=</HostId></Error>

Here's an example of link https://static.javadoc.io/org.assertj/assertj-core/3.13.2/undefined/org/assertj/core/api/StringAssert.html

The issue seems to come from the undefined subpath, maybe something due to java 9 module system ?

@joel-costigliola
Copy link
Author

Likely related to https://stackoverflow.com/questions/52326318/maven-javadoc-search-redirects-to-undefined-url, I will give it a try when I can.

@joel-costigliola
Copy link
Author

joel-costigliola commented Aug 24, 2019

Adding <additionalJOption>--no-module-directories</additionalJOption> solved the issue. see assertj/assertj@9af0910

@joel-costigliola
Copy link
Author

Unfortunately there is still an issue with search as one can see in https://www.javadoc.io/doc/org.assertj/assertj-core/3.14.0/index.html where the filtering work in the textbox but navigating to one of the matching items does not.

Note that search work fine for locally generated javadoc.

This is related to assertj/assertj#1657

@maxcellent
Copy link
Owner

maxcellent commented Oct 29, 2019

It looks like there is a bug in the generated search.js. If we change line 322
from parent.classFrame.location = pathtoroot + url; to parent.location.href = pathtoroot + url; then it works.

This works when it's NOT running inside an iframe. As a workaround, you can use https://www.javadoc.io/static/org.assertj/assertj-core/3.14.0/index.html , trading off the top navbar.

@maxcellent
Copy link
Owner

This is resolved now. Basically openjdk is making a strong assumption that the parent iframe is called classFrame.

https://github.com/openjdk/jdk/blob/cc621b681e279a3672f38f5d81943f35f57e6e55/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js#L350

@joel-costigliola
Copy link
Author

Excellent thanks @maxcellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants