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 #4722 - remove websocket-servlet #4723

Merged
merged 11 commits into from
May 7, 2020

Conversation

lachlan-roberts
Copy link
Contributor

Issue #4722

Removed the websocket-servlet layer which was resulting in exposing websocket-core classes.

  • WebSocketServlet and WebSocketServletFactory have been merged into JettyWebSocketServlet and JettyWebSocketServletFactory which were extending them previously.

  • The other classes including WebSocketUpgradeFilter and WebSocketMapping were moved into the new package org.eclipse.jetty.websocket.util.server of websocket-util, but maybe these should be in websocket-core instead

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts
Copy link
Contributor Author

lachlan-roberts commented Apr 15, 2020

I'm getting a failure on this branch for DistributionTests.testSimpleWebAppWithWebsocket saying

java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: Provider org.eclipse.jetty.logging.JettyLoggingServiceProvider not found

Any idea what would cause this @joakime @olamy , is this something to do with the recent logging changes?

…hey try to load slf4j impl

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
@olamy
Copy link
Member

olamy commented Apr 15, 2020

@lachlan-roberts should be fixed with this commit 5199e78

Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

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

👍

- Fix packages exposed in the websocket configuration
- Make servlet dependency for websocket-util optional

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Copy link
Contributor

@joakime joakime left a comment

Choose a reason for hiding this comment

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

Still a 👍 from me

…jpms

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts
Copy link
Contributor Author

@joakime the change to make jetty-servlet an optional dependency for websocket-util has caused some problems.

The last commit got it working working but giving a JPMS warning as there are servlet classes in the public signature of websocket-util server package.

Warning:(106, 19) java: class org.eclipse.jetty.servlet.FilterHolder in module org.eclipse.jetty.servlet is not indirectly exported using requires transitive

As an alternative I could introduce another module which is shared only between both websocket-jetty-server and websocket-javax-server, called something like websocket-server-common and then move the WebSocketUpgradeFilter and other classes here. I still think WebSocketServlet does not belong in that package and the current changes to merge that with JettyWebSocketServlet is a good change.

@gregw
Copy link
Contributor

gregw commented Apr 20, 2020

@lachlan-roberts I'm loath to introduce more modules. I'm sure JPMS can deal with optional/provided dependencies.... ask @sbordet for advice or look for other examples of provided dependencies in the code base.

@lachlan-roberts
Copy link
Contributor Author

@gregw I asked @sbordet for advice and he said it would be best to introduce a new websocket-util-server module.

- This module contains the WebSocketUpgradeFilter.
- Also has an internal package with the components used
  to implement websocket upgrades common to both the
  jetty and javax websocket implementations.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts
Copy link
Contributor Author

I pushed a commit to introduce a websocket-util-server module which has the WebSocketUpgradeFilter and other classes in internal package.

It only exports the internal package to websocket-jetty-server and websocket-javax-server and exports the base package (containing only the upgrade filter) to all.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@joakime
Copy link
Contributor

joakime commented Apr 22, 2020

The osgi tests on this branch are failing.

@@ -90,7 +90,7 @@
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<artifactId>jetty-websocket</artifactId> <!-- TODO: is this even right? -->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@janbartel while debugging I saw this, any idea what this is for? I don't know what this is referring to, I don't think there is any jetty-websocket artifactId in jetty 10 so I thought this should be an errror.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
…WebSocketServlet

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts lachlan-roberts requested a review from gregw May 1, 2020 05:49
@lachlan-roberts
Copy link
Contributor Author

@gregw || @joakime can I get a tick after the new changes where I added the module jetty-util-server? I'd like to get this merged before we do another release of 10.

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.

LGTM.

@lachlan-roberts lachlan-roberts merged commit 2e1c01a into jetty-10.0.x May 7, 2020
@lachlan-roberts lachlan-roberts deleted the jetty-10.0.x-WebSocketServlet branch May 7, 2020 12:45
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.

4 participants