Jakarta EE 10 is the first major release of Jakarta EE since the “jakarta” namespace update. Many of the component specifications are introducing Major or Minor version updates that are going to reflect in the implementation APIs. Let’s learn in this article what is new with Jakarta EE 10.
On Sep 22, 2022 the Jakarta EE working group announced the release of the Jakarta EE 10 Platform, Web Profile and the new Core Profile specifications. Jakarta EE 10 provides new functionality in over 20 component specifications through version updates which reflect in their specific APIs.
Therefore, in order to use Jakarta EE 10 API you will need to include the following umbrella dependency in your projects:
<dependency> <groupId>jakarta.platform</groupId> <artifactId>jakarta.jakartaee-api</artifactId> <version>10.0.0</version> <scope>provided</scope> </dependency>
Requirements to run Jakarta EE 10
Java SE 11 is the minimum runtime supported by Jakarta EE compatible implementations.
The following Profiles are available in Jakarta EE 10:
- Full Platform Profile: This profile is designed for developers who require the full set of Jakarta EE APIs for developing Enterprise applications.
- Web Profile: This profile contains web technologies that are part of the full platform and is designed for developers who do not require the full set of Jakarta EE APIs.
- Core Profile: This new profile contains a set of Jakarta EE Specifications targeting smaller runtimes suitable for microservices and ahead-of-time compilation..
API removed or Deprecated
The following two features are tagged as “removed” or “deprecated” (exact term and/or mechanism still needs to be determined).
- EJB Entity Beans (CMP and BMP)
- Embeddable EJB Container
Therefore, applications written to the EJB 3.0 and later APIs (e.g. javax.ejb.Entity) should use the facilities of the Jakarta Persistence API (jakarta.persistence) to model persistent entities.
Finally, here is the list of the Jakarta EE 10 specifications, including a reference to the Specification version, the Profile and if it’s Optional:
|Jakarta Activation 2.1||Full Profile||N|
|Jakarta Annotations 2.1||Web Profile||N|
|Jakarta Authentication 3.0||Web Profile||N|
|Jakarta Authorization 2.1||Full Profile||N|
|Jakarta Batch 2.1||Full Profile||N|
|Jakarta Bean Validation 3.0||Web Profile||N|
|Jakarta Concurrency 3.0||Web Profile||N|
|Jakarta Connectors 2.1||Full Profile||N|
|Jakarta Contexts and Dependency Injection 4.0||Full Profile||N|
|Jakarta Debugging Support for Other Languages 2.0||Web Profile||N|
|Jakarta Dependency Injection 2.0||Web Profile||N|
|Jakarta Enterprise Beans 4.0||Full Profile||N|
|Jakarta Enterprise Beans 4.0 Lite||Web Profile||N|
|Jakarta Enterprise Web Services 2.0||Full Profile||Y|
|Jakarta Expression Language 5.0||Web Profile||N|
|Jakarta Interceptors 2.1||Web Profile||N|
|Jakarta JSON Binding 3.0||Web Profile||N|
|Jakarta JSON Processing 2.1||Web Profile||N|
|Jakarta Mail 2.1||Full Profile||N|
|Jakarta Managed Beans 2.0||Web Profile||N|
|Jakarta Messaging 3.1||Full Profile||N|
|Jakarta Persistence 3.1||Web Profile||N|
|Jakarta RESTful Web Services 3.1||Web Profile||N|
|Jakarta Security 3.0||Web Profile||N|
|Jakarta Server Faces 4.0||Web Profile||N|
|Jakarta Server Pages 3.1||Web Profile||N|
|Jakarta Servlet 6.0||Web Profile||N|
|Jakarta SOAP with Attachments 3.0||Full Profile||Y|
|Jakarta Standard Tag Library 3.0||Web Profile||N|
|Jakarta Transactions 2.0||Web Profile||N|
|Jakarta WebSocket 2.1||Web Profile||N|
|Jakarta XML Binding 4.0||Full Profile||Y|
|Jakarta XML Web Services 4.0||Full Profile||Y|
Major API Upgrades:
In the following section you can have an overview the top highlights you can expect in Jakarta EE 10.
Jakarta Persistence 3.1:
- Added support for the java.uti.UUID Java type, which you can now use as a simple primary key or as a field or property of a composite primary key.
- New numeric functions in the Query Language
- CEILING: Returns the ceiling of its argument:
- EXP: Returns the exponential of its argument
- FLOOR: Returns the floor of its argument:
- LN: Returns the natural logarithm of its argument.
- POWER: Returns the first argument raised to the power of its second argument.
- ROUND: Returns the first argument rounded to the number of decimal places given by the second argument.
- SIGN: Returns the sign of its argument:
- New date functions in the Query Language
- LOCAL DATE: Returns current local date as defined by the database server.
- LOCAL DATETIME: Returns current local date and time as defined by the database server
- LOCAL TIME: Returns current local time as defined by the database server.
- Added EXTRACT Function support: The EXTRACT function allows extracting a numeric part from a given date and it can only retrieve a single field.
Jakarta Servlet 6.0
- Removal of deprecated methods from the specification.:
- Servlet immutable request and response wrapper: developers now have the ability to implement durable immutable requests and responses. Currently, mutable requests cannot be safely passed to asynchronous processes, because there will be a race between the other thread call to a request method and any mutations required as the request propagates through the Servlet container
- Include URI security protection: currently when a request URI is matched by multiple constrained URL patterns, the constraints that apply to the request are those that are associated with the best matching URL pattern.However, no protection requirements apply to a request URI that is not matched by a constrained URL pattern.
- Cookie extra attributes: you can add extra attributes to your cookies without the need to use an external dependency to do that.
Jakarta RESTful Web Services 3.1
Check this article to learn more about this topic: Getting started with Jakarta RESTful Services
- Java SE Bootstrap API: JAX-RS declares Java SE as one of several possible environments. Unfortunately it does not declare how to start a JAX-RS server application in pure Java SE. To get rid of the vendor-lock-in I’d like to propose that the JAX-RS specification defines a vendor-neutral API how a JAX-RS server application can be started in a pure Java SE environment.
- Support for multipart media type: So far, the Jakarta EE spec didn’t provide a specific support for multpart/form. Many implemententations provide a tighter integration with annotation supporting the fields of MultiPart Forms (jersey with @FormDataParam and CXF with @Multipart) code that relies on these extension is no longer portable. Adding the multipart/form-data media type in the specification will enable requests to send multiple entities (parts) as a single entity. Each part contains its own set of headers, media type and content.
- Better alignment with JSON-B: The implementation-supplied entity provider(s) for application-supplied JSON-B classes MUST use Jsonb instances provided by application-supplied context resolvers, see [contextprovider]. If an application does not supply a Jsonb instance for a particular type, the implementation-supplied entity provider MUST use its own default context instead.
- Automatic loading of provider extensions: this will add a declarative way to turn any kind of JAX-RS component into a forcefully auto-loaded component, just by declaring a marker interface in the way Java’s ServiceLoader API works. In fact, the proposed mechanism does not actually instantiate components, but just detects the declared classes, and registers these into the JAX-RS configuration, so the already existing JAX-RS component lifecycle and scope will be in applied.
- Deprecation of @Context in preparation for better alignment with CDI
Jakarta Server Faces 4.0
Firstly, the goal of this release is to include several new enhancements (inspired from MyFaces and Primefaces implementations). At the same time it will remove deprecated things and moving more things to CDI.
- New API to programmatically create Facelets: First class support for creating views in Java as opposed to creating such view using XML as is currently done with Facelets.
- New automatic extensionless mapping: this will provide extensionless mapping similar to MyFaces org.apache.myfaces.AUTOMATIC_EXTENSIONLESS_MAPPING
- Added annotation @ClientWindowScoped: this will add native ClientWindow implementation in a similar way to Primefaces’ native ClientWindow implementation.
- Support for Custom Cookie attributes: such as SameSite in ExternalContext#addResponseCookie()
- Add FacesContext#getLifecycle: this will be primarily be useful for programmatically adding and removing application-wide phase listeners.
- Remove deprecated stuff: Such as JSP support and removing native Managed Beans (@ManagedBean and related).
Jakarta Security 3.0
- Additional authentication mechanisms: to make sure Jakarta Security’s authentication mechanisms can be a full drop-in replacement for vendor or custom autenthication schemas the following mechanism will be added : Client-cert and Digest, OpenID Connect and OAuth 2
- CDI and Security: Add the capability to apply an interceptor binding annotation to a build-in bean from the Security Specification.More details here.
- FeaturesAuthorization module: Simplified custom authorization rules without the need to bundle an entire JACC provider with factory, configuration and policy. More details here.
- Extended authentication mechanisms: including authentication mechanism per URL , User choice of authentication mechanism (login with provider X, login with provider Y, etc), Multiple authentication mechanisms (try JWT, fallback to BASIC, etc)
JSON Processing 2.1
- Distinct repository for the Implementation and the API: The new release separates them to make the specification more vendor neutral.
- JsonNumber improvements: it will be possible to use the general number type to store the numeric value internally.
JSON Binding 3.0
- Easier Handling of Polymorphic Types: In the new release, you can handle polymorphic types using the @JsonbTypeInfo annotation
WildFly support for Jakarta EE 10
Finally, as discussed in the WildFly news , support for Jakarta EE 10 is available in the WildFly 27 release. WildFly 27, in turn, is compatible with the following specifications:
- Java SE 11/17
- Jakarta EE 10
- MicroProfile 5
Payara support for Jakarta EE 10
As Strategic Members of the Eclipse Foundation, the Payara Team is a top player in innovating Enterprise API. You will be able to use Jakarta EE 10 in the release 6 of Payara Application Server. Check for news in the official Payara Jakarta Page: https://www.payara.fish/learn/get-started-with-jakarta-ee/
Stay tuned! We will keep updating this article as there are updates in the Jakarta EE 10 specifications.