-
Notifications
You must be signed in to change notification settings - Fork 174
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
7494: Unable to view JMC Help Contents #347
Conversation
We needed a servlet api implementation for the websocket server so we added a dependency on the jetty.servlet-api. We already have jakarta.servlet-api in our dependencies, required by the eclipse help page which also uses jetty to serve dynamic content. We need to avoid loading multiple servlet-apis because it causes errors serving help pages - the server fails to recognise HTTP requests, presumably because of the multiple implementations available.
👋 Welcome back cimi! A progress list of the required criteria for merging this PR into |
@cimi This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@thegreystone, @aptmac) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
Since the ticket mentioned the help pages didn't work if we run JMC with JDK 17, I tried it out. I could reproduce it, here is the error:
I didn't know how to open the jsp in eclipse so I couldn't play with it there, but looking at the source it seems that because of the |
Guru had opened an Eclipse bug for JDT explaining our issue [0], there hasn't been a lot of comments on it recently though. Interesting that the update to JDT 3.26.0 fixed the issue for open-library, we're currently consuming 3.18 via 2021-06 [1] (and it looks like even through to 2021-12 the same version will be used). [0] https://bugs.eclipse.org/bugs/show_bug.cgi?id=574937 |
/sponsor |
Going to push as commit b65e351. |
@thegreystone @cimi Pushed as commit b65e351. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR fixes a problem that makes all JMC help pages fail.
We use the eclipse help plugin, it plugin starts a web server which renders the XML content in the docs plugin via JSP. When the user clicks help in the JMC UI they are sent to the browser, which tries to render one of these JSP pages.
In #306 we introduced new dependencies on multiple Jetty packages so we can run a websocket server inside JMC. After these changes we notice that the help pages fail to render with the following error:
This is the code that throws the exception:
The help plugin has Jetty as a transitive dependency so it's likely this error is caused by the new
servlet-api
dependency that we've introduced. Using the debugger, we can set a breakpoint before the exception is thrown and we can inspectreq
andres
to see why theinstanceof
check fails. The result of this is very strange:I don't understand why this fails here, since we can see with reflection that
req
implements the expectedjavax.servlet.http.HttpServletRequest
interface. It's likely this is because we have twoservlet-api
bundles loaded,org.eclipse.jetty.servlet-api
(explicit dependency offlightrecorder.ui
) andjakarta.servlet-api
(transitive dependency of the help plugin).I also don't understand if it's possible that
instanceof
fails because it tries to comparejavax.servlet.http.HttpServletRequest
loaded from the different bundles, given that the package and interface names are identical.Regardless of the root cause, removing the explicit dependency on
org.eclipse.jetty.servlet-api
from the target platform and depending onjakarta.servlet-api
in theflightrecorder.ui
manifest fixes the issue. Now help pages load successfully and the websocket server works as before.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jmc pull/347/head:pull/347
$ git checkout pull/347
Update a local copy of the PR:
$ git checkout pull/347
$ git pull https://git.openjdk.java.net/jmc pull/347/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 347
View PR using the GUI difftool:
$ git pr show -t 347
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jmc/pull/347.diff