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

Issue #9396 - fixes to resolve WebSocket JPMS warnings #9915

Merged
merged 15 commits into from
Jul 3, 2023

Conversation

lachlan-roberts
Copy link
Contributor

@lachlan-roberts lachlan-roberts commented Jun 15, 2023

Issue #9396

  • fix some JPMS warnings for websocket
  • add testing for websocket with JPMS in DistributionTests
  • Make WebSocketShutdownContainers publicly exported in module-info files.
  • Optional dependencies for WebSocketShutdownContainer and JettyWebSocketClientConfiguration should be requires static transitive as they are in public signatures but also optional.

@lachlan-roberts lachlan-roberts requested review from sbordet and gregw June 19, 2023 04:38
@lachlan-roberts
Copy link
Contributor Author

I don't think the requires static transitive works. I'm getting the following error when running tests for jetty-ee9-websocket-client

Corrupted channel by directly writing to native stream in forked JVM 1. Stream 'java.lang.module.ResolutionException: Module org.eclipse.jetty.ee9.websocket.jetty.client does not read a module that exports org.eclipse.jetty.ee9.webapp'.

The issue is that we must export the package of JettyWebSocketClientConfiguration as we use it with the service provider, and because this is publicly exposed we need the requires transitive. However we also want to make it an optional dependency so we want the requires static. And so the addition of the static modifier is what is causing this error.

@gregw gregw requested a review from janbartel June 20, 2023 13:51
@gregw
Copy link
Contributor

gregw commented Jun 20, 2023

@janbartel help

@gregw
Copy link
Contributor

gregw commented Jun 20, 2023

i think this could just be a surefire issue. I might needs something like:

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>
            @{argLine} ${jetty.surefire.argLine}
            --add-modules org.eclipse.jetty.ee9.webapp
            --add-reads org.eclipse.jetty.ee9.websocket.jetty.client=org.eclipse.jetty.ee9.webapp
          </argLine>
        </configuration>
      </plugin>

@gregw
Copy link
Contributor

gregw commented Jun 20, 2023

@lachlan-roberts that fixed it, so I've pushed to this branch.
@janbartel do you think that looks right?

@lachlan-roberts lachlan-roberts self-assigned this Jun 22, 2023
Signed-off-by: Olivier Lamy <[email protected]>
<argLine>
@{argLine} ${jetty.surefire.argLine}
--add-modules org.eclipse.jetty.ee8.webapp
--add-reads org.eclipse.jetty.ee8.websocket.jetty.client=org.eclipse.jetty.ee8.webapp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need the read line. That is only used where we cannot declare an outright requires in the module-info.java, eg for test-only dependencies. Your module-info.java has declared a requires static and that must be sufficient and should not need to be forcibly overridden in this way.

sbordet
sbordet previously approved these changes Jun 29, 2023
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wot @janbartel said!

I think that was my original mistake and I went from "Try A" to "Try A and B" without actually doing "Try B".

@lachlan-roberts
Copy link
Contributor Author

These --add-modules and --add-reads are removed by #9981.
I will merge these two together now simone is happy with other changes in this PR.

…ent-webapp

Split websocket client modules for webapp configuration.
gregw
gregw previously approved these changes Jun 30, 2023
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look OK to me

janbartel
janbartel previously approved these changes Jul 1, 2023
@gregw
Copy link
Contributor

gregw commented Jul 1, 2023

@jmcc0nn3ll @joakime This has not actually been built in CI?

@jmcc0nn3ll
Copy link
Contributor

@jmcc0nn3ll @joakime This has not actually been built in CI?

This needs to push a notification to the build servers, I updated DNS but perhaps there's something else that we need to do to fix that connection.

@lachlan-roberts lachlan-roberts dismissed stale reviews from janbartel and gregw via 69728c3 July 3, 2023 00:36
@lachlan-roberts lachlan-roberts merged commit 643c11c into jetty-12.0.x Jul 3, 2023
@lachlan-roberts lachlan-roberts deleted the jetty-12.0.x-9396-websocket-jpms-review branch July 3, 2023 07:42
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

Successfully merging this pull request may close these issues.

6 participants