Search code examples
jettyopenjdk-11

Jetty upgrade 8 to 9


When I am trying to migrate to Jetty 9.4.18 from Jetty 8.1.12, I am getting errors because of following issues.

  1. we are using org.eclipse.jetty.server.AsyncContinuation. Which is not present in Jetty 9.4.18
  2. We are using AbstractHttpConnection. specifically AbstractHttpConnection.getCurrentConnection() method. Which is not present in Jetty 9.4.18.
  3. We are using org.eclipse.jetty.security.MappedLoginService which is not present in Jetty 9.4.18.
  4. we are using connector.getConnection() method. which is not present in Connector class in Jetty 9.4.18.

I did not find any documentation in Jetty upgrade page for these issues.


Solution

  • Welcome to Stackoverflow!

    It is not a great idea to ask multiple unrelated questions on a single question.

    1) we are using org.eclipse.jetty.server.AsyncContinuation. Which is not present in Jetty 9.4.18

    AsyncContinuation is an Jetty 7 and older concept.

    It was kept in Jetty 8 as a transition to the Servlet spec specific behaviors regarding async that were introduced in Servlet 3.0 (supported in Jetty 8.x).

    Switch to using javax.servlet.AsyncContext instead. (You'll find many of the methods names to be similar, so the transition shouldn't be that problematic).

    2) We are using AbstractHttpConnection. specifically AbstractHttpConnection.getCurrentConnection() method. Which is not present in Jetty 9.4.18

    If you are accessing the raw Connection you will have an endless stream of issues ahead of you. The Connection object no longer represents the physical connection, it often represents a virtual connection and can mutate or be swapped out through the lifespan of a physical connection. You have failed to explain why you need this, and under what kind of situations and environments you need this.

    Create a new question on stackoverflow explaining why you need this, and what goal you are attempting to solve. (not the techniques you were using before, the goal, the end result)

    3) We are using org.eclipse.jetty.security.MappedLoginService which is not present in Jetty 9.4.18

    The entire Security layer was refactored, without details on what you are attempting, it would be impossible to point you to the correct place to look.

    Create (another) question on stackoverflow for this one too. Explain what you are attempting to solve, show some code. When detailing your question focus on the goal first, then the techniques you have attempted.

    4) we are using connector.getConnection() method. which is not present in Connector class in Jetty 9.4.18.

    This seems to overlap with question 3, perhaps. But there's nothing to work with on this kind of question.