Giter Site home page Giter Site logo

Comments (12)

jansupol avatar jansupol commented on August 17, 2024

Jetty 12 is aligned with Jakarta EE 10, whereas Jetty 9 is aligned with Jakarta EE 8.
Jersey 3.1.x is aligned with Jakarta EE 10, whereas Jersey 2.x is aligned with Jakarta EE 8.
Hence, Jersey 2.x supports Jetty 9, Jersey 3.0.x Jetty 11, and Jersey 3.1.5+ Jetty 12.

from jersey.

gpfeifer avatar gpfeifer commented on August 17, 2024

IMPORTANT: You need to add this to MANIFEST

  Jetty-Environment: ee8

from jersey.

gpfeifer avatar gpfeifer commented on August 17, 2024

@jansupol We wrote a comment at the same time :-)

I'm using Jetty 12 with EE8

from jersey.

jansupol avatar jansupol commented on August 17, 2024

@gpfeifer Can you point us to a documentation regarding this MANIFEST tag?

from jersey.

gpfeifer avatar gpfeifer commented on August 17, 2024

There is no documentation as far as I know. As I wrote in jetty/jetty.project#11315 it took me some hours to find out that this entry is needed. I found this entry in: https://github.com/jetty/jetty.project/tree/jetty-12.0.x/jetty-ee8/jetty-ee8-osgi

from jersey.

gpfeifer avatar gpfeifer commented on August 17, 2024

I created a PR (#5524). The PR contains a minimalistic example of a working osgi-helloworld-jetty-12-webapp. Unfortunately a automated JUnit test is missing.

from jersey.

joakime avatar joakime commented on August 17, 2024

Jetty 12 is aligned with Jakarta EE 10, whereas Jetty 9 is aligned with Jakarta EE 8.
Jersey 3.1.x is aligned with Jakarta EE 10, whereas Jersey 2.x is aligned with Jakarta EE 8.
Hence, Jersey 2.x supports Jetty 9, Jersey 3.0.x Jetty 11, and Jersey 3.1.5+ Jetty 12.

This is the chart you need ...

Jetty version Environment EE Level Servlet ver Servlet namespace
12 ee10 Jakarta EE10 Servlet 6.0 jakarta.servlet
12 ee9 Jakarta EE9 Servlet 5.0 jakarta.servlet
12 ee8 Jakarta EE8 Servlet 4.0 javax.servlet
11 n/a Jakarta EE9 Servlet 5.0 jakarta.servlet
10 n/a Jakarta EE8 Servlet 4.0 javax.servlet
9 n/a Java EE7 Servlet 3.1 javax.servlet

Note: Jetty 12 server has no servlet dependencies anymore.
The various environments in Jetty 12 have the servlet layers (along with other APIs that are also in that EE level)
When EE11 releases, it'll still be Jetty 12, but just a new environment definition called "ee11".

from jersey.

joakime avatar joakime commented on August 17, 2024

Using your definitions of Jersey versions to EE levels, the extended chart would look like ...

Jetty version Environment EE Level Servlet ver Servlet namespace Jersey Version
12 ee10 Jakarta EE10 Servlet 6.0 jakarta.servlet Jersey 3.1.5+
12 ee9 Jakarta EE9 Servlet 5.0 jakarta.servlet Jersey 3.0.x
12 ee8 Jakarta EE8 Servlet 4.0 javax.servlet Jersey 2.x
11 n/a Jakarta EE9 Servlet 5.0 jakarta.servlet Jersey 3.0.x
10 n/a Jakarta EE8 Servlet 4.0 javax.servlet Jersey 2.x
9 n/a Java EE7 Servlet 3.1 javax.servlet Not supported

But that doesn't make sense, as we know you support Jetty 9.

Looking at your codebase.

Ah, Jersey 2.x codebase doesn't support EE8, it supports EE7 (based on it's use of Servlet 2.4/2.5), that's the mistake!
The corrected chart would be ...

Jetty version Environment EE Level Servlet ver Servlet namespace Jersey Version
12 ee10 Jakarta EE10 Servlet 6.0 jakarta.servlet Jersey 3.1.x+
12 ee9 Jakarta EE9 Servlet 5.0 jakarta.servlet Jersey 3.0.x
12 ee8 Jakarta EE8 Servlet 4.0 javax.servlet Not supported
11 n/a Jakarta EE9 Servlet 5.0 jakarta.servlet Jersey 3.0.x
10 n/a Jakarta EE8 Servlet 4.0 javax.servlet Not supported
9 n/a Java EE7 Servlet 3.1 javax.servlet Jersey 2.x

from jersey.

joakime avatar joakime commented on August 17, 2024

Technically speaking, Jersey 2.x supports Eclipse Jetty 7, as that's the version that introduced support for Servlet 2.4 (Jetty 8 was Servlet 3.0)

from jersey.

gpfeifer avatar gpfeifer commented on August 17, 2024

@joakime The codebase I'm working on is running in production and is using Jetty 10 and Jersey 2.x. I'm migrating this codebase to Jetty 12. The Jersey example (2.x/examples/osgi-helloworld-webapp) works with Jetty 10 and Jersey 2.x. But is does not work with Jetty 12 ee8. My example (osgi-helloworld-webapp-jetty-12) works with Jetty 12 (ee8) and Jersey 2.x. I will use the approach used in osgi-helloworld-webapp-jetty-12 in my codebase. Is there anything against it?

from jersey.

gpfeifer avatar gpfeifer commented on August 17, 2024

@joakime Or in other words: I don't get it.

Jetty 10 works with Jersey 2.x in production.
Why is Jetty 10 not supported by Jetty 2.x?

Jetty 12 e88 seems to work with Jetty 2.x, but I'm not finished with my migration.
Why is Jetty 12 e88 not supported by Jetty 2.x?

from jersey.

joakime avatar joakime commented on August 17, 2024

@gpfeifer some history ...

  • Servlet 1.0 thru Servlet 3.1 were backward compatible. (meaning if you wrote for and older version and deployed on a newer version, no big deal, it'll work)
  • Servlet 4.0 added a few things to the APIs, but isn't 100% backward compatible with Servlet 3.1 or older (mostly due to behavior changes).
  • Servlet 5.0 is not backward compatible with any versions before it (due to namespace changes)
  • Servlet 6.0 removed classes and methods, changed important APIs, and changed behaviors. (this means if you wrote for Servlet 5.0 and deployed here, you'll likely have issues)
  • Servlet 6.1 has a few changes to support new browser changes. (going from 6.0 to 6.1 should be trivial)

The fact that it seems to work for you is just luck, and is not to be relied on, as the most trivial change can suddenly cause issues for you. (eg: using Java 11 or older then moving to Java 17 and using those old versions of the Servlet spec, suddenly some of your responses are different.)
Jersey has newer versions to support (some of) the servlet specs listed above, in turn those containers (like Jetty) support the improvements in the Servlet spec too.

In Jetty 12, ee8, we try to maintain bug for bug compatibility with how things worked back then, but it's not perfect, and only strives for the bugs that existed back in EE8 days, not earlier.
Some things we cannot work around, like the changes in the JVM impacting behavior of your webapp.

from jersey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.