Skip to content

Vaadin Push incompatible with jetty 9.4.0 #8134

Closed

Description

@criemen

Hi,

both Vaadin 7.7.6 and 8.0.0.beta1 are incompatible with jetty 9.4.0.v20161208, as soon as server push (WEBSOCKET or WEBSOCKET_XHR) is enabled.
As soon as the user loads a UI, they get a session expired message.

I can provide a minimum working example if necessary.

Activity

  1. Artur- commented on Jan 3, 2017

    @Artur-
    Member
  2. Augar commented on Mar 28, 2017

    @Augar

    Hi!

    Is it possible that the recent update for the vaadin atmosphere has triggerd this problem once again?
    0f08e30
    We saw this update has been made to vaadin:
    <atmosphere.runtime.version>2.4.5.vaadin2</atmosphere.runtime.version>

    We are facing an issue regarding Jetty 9.4.x and Vaadin 8.0.3 + 8.0.4
    https://vaadin.com/forum#!/thread/15523853

    If we use Jetty 9.4.x + Vaadin 8.0.3/8.0.4 and activate the @Push annotation we are recieving "Session expired" as soon as we open the website.

    If we remove the @Push everything seems fine.

    Using Vaadin 8.0.2 + @Push works fine.
    Using Jetty 9.3.x + @Push + Vaadin 8.0.3/8.0.4 works fine.

    Anybody got an idea on this issue?

  3. Augar commented on May 4, 2017

    @Augar

    G'Day

    Did a test using

    • Jetty 9.4.5.v20170502
      and
    • Vaadin 8.0.5

    Same result as with Jetty 9.4.4 -> did not work

  4. added a commit that references this issue on May 18, 2017
    81c8c31
  5. added a commit that references this issue on May 18, 2017
    84c0bee
  6. added this to the 8.1.0.beta1 milestone on May 18, 2017
  7. mvysny commented on May 24, 2017

    @mvysny
    Member

    Thank you! Using 8.1.0.beta1 with Jetty 9.4.2.v20170220 fixed the Atmosphere/Push issue for me.

  8. kolleggerm commented on May 31, 2017

    @kolleggerm

    Will this feature be available for Vaadin 7?

  9. elmot commented on May 31, 2017

    @elmot
    Contributor

    @kolleggerm, most probably yes. You can always cherry-pick the change and build your own snapshot of 7.7 and test if it works. Any feedback is welcome.

  10. elmot commented on May 31, 2017

    @elmot
    Contributor

    Oops... I did not know some important details.
    The patch most likely is not going to be backported to 7. Please use Vaadin 8.

  11. Legioth commented on May 31, 2017

    @Legioth
    Member

    The main challenge is that the new Atmosphere version requires Java 8. This means that someone would have to identify and backport the fixes related to Jetty 9.4 to an older version of Atmosphere.

  12. mvysny commented on May 31, 2017

    @mvysny
    Member

    What if they are using Vaadin 7.7 with Java 8? Would just upgrading of the atmosphere library work?

  13. Artur- commented on May 31, 2017

    @Artur-
    Member

    If I remember correctly there are API changes in Atmosphere, which you would have to fix in 7.7 in addition to using Java 8

  14. pinonpierre commented on Jun 7, 2017

    @pinonpierre

    I don't understand because I tried to use 8.1.0.beta1 with Jetty 9.4.2.v20170220 and it doesn't work for me (But works with 9.3.20.v20170531 version)

    Is it solved or not?

    If not, I don't understand why this issue is closed. Is there another one?

  15. added 2 commits that reference this issue on Jul 5, 2017
    6fdea95
    e86dff4
  16. jreznot commented on Sep 10, 2017

    @jreznot
    Contributor

    8.1.3 Still does not work with Jetty 9.4.6.v20170531

    Works for me with 9.3.20.v20170531

  17. pinonpierre commented on Sep 10, 2017

    @pinonpierre

    Vaadin 8.1.3 works with Jetty 9.4.5.v20170502.

  18. pinonpierre commented on Sep 14, 2017

    @pinonpierre

    @jreznot, @lanmaster: Can you give us more details because "it doesn't work" is not enough to identify your issue.

    FYI, since recently, we need to add 2 dependencies for websockets:

    		<dependency>
    			<groupId>org.eclipse.jetty.websocket</groupId>
    			<artifactId>websocket-server</artifactId>
    			<version>${jetty.version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.eclipse.jetty.websocket</groupId>
    			<artifactId>javax-websocket-server-impl</artifactId>
    			<version>${jetty.version}</version>
    		</dependency>
    

    and configure the webAppContext for jsr356 web sockets:

    WebSocketServerContainerInitializer.configureContext(webAppContext);

  19. jreznot commented on Sep 14, 2017

    @jreznot
    Contributor

    Hi,
    Check this Gradle project https://github.com/jreznot/electron-java-app
    Simply import it using Eclipse / Intellij and start org.strangeway.electronvaadin.Launcher class in IDE
    It works perfectly with servlet 3.0 configuration and org.eclipse.jetty.websocket:websocket-server:9.3.20.v20170531

    Does not work with 9.4.6.v20170531.

  20. lanmaster commented on Sep 15, 2017

    @lanmaster

    @pinonpierre Thanks a lot. After adding
    <dependency> <groupId>org.eclipse.jetty.websocket</groupId> <artifactId>javax-websocket-server-impl</artifactId> <version>${jetty.version}</version> </dependency>
    it works with 9.4.6.v20170531 !
    Sorry for fomatting

  21. jreznot commented on Sep 15, 2017

    @jreznot
    Contributor

    Unfortunately, it still writes to log

    WARNING: Websocket protocol not supported

    And returns 501 error on PUSH endpoint, so actually WebSocket transport still does not work:

    501 Not Implemented

    Check this branch: https://github.com/jreznot/electron-java-app/tree/feature/jety-9.4

  22. ChristinaSi commented on Jul 17, 2018

    @ChristinaSi

    and configure the webAppContext for jsr356 web sockets:
    WebSocketServerContainerInitializer.configureContext(webAppContext);

    @pinonpierre Where do I configure this? And what do I have to set in webAppContext? I'm getting the error
    javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
    after adding the dependencies for websockets.

  23. gnkuzmin commented on Mar 9, 2019

    @gnkuzmin

    Vaadin 12/13 + push (PushMode.MANUAL) with embedded Jetty 9.3.25.v20180904 works right.
    With embedded 9.4.15.v20190215 only with Transport.LONG_POLLING.
    With other transport: "Session Expired
    Take note of any unsaved data, and click here or press ESC key to continue.", "endRequest called when no request is active."
    Have I wrong configuration?

  24. bihu1 commented on Jul 28, 2022

    @bihu1

    @gnkuzmin Did you solve the problem? I'm facing with the same one with Vaadin 23 and I'm searching for solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions