Jakarta EE

From wiki1463
Jump to navigation Jump to search

Template:Short description Template:Infobox software platform Template:Java platforms Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE[1] with specifications for enterprise features such as distributed computing and web services.[2] Jakarta EE applications are run on reference runtimes, which can be microservices or application servers, which handle transactions, security, scalability, concurrency and management of the components they are deploying.

Jakarta EE is defined by its specification. The specification defines APIs (application programming interface) and their interactions. As with other Java Community Process specifications, providers must meet certain conformance requirements in order to declare their products as Jakarta EE compliant.

Examples of contexts in which Jakarta EE referencing runtimes are used are: e-commerce, accounting, banking information systems.

History

The platform created by Sun Microsystems was known as Java 2 Platform, Enterprise Edition or J2EE from version 1.2, until the name was changed to Java Platform, Enterprise Edition or Java EE in version 1.5.

After Sun was acquired in 2009, Java EE was maintained by Oracle under the Java Community Process. On September 12, 2017, Oracle Corporation announced that it would submit Java EE to the Eclipse Foundation.[3] The Eclipse top-level project has been named Eclipse Enterprise for Java (EE4J).[4] The Eclipse Foundation could not agree with Oracle over the use of Template:Code and Java trademarks.[5] Oracle owns the trademark for the name "Java" and the platform was renamed from Java EE to Jakarta EE.[6][7] The name refers to the largest city on the island of Java and also the capital of Indonesia, Jakarta.[8] The name should not be confused with the former Jakarta Project which fostered a number of current and former Java projects at the Apache Software Foundation.

Java enterprise platform history
Platform version Release[9] Specification Template:Nowrap Support Important Changes
Jakarta EE 11 Template:Nowrap[10] 11 Template:Ubl Data
Jakarta EE 10 Template:Nowrap[11] 10 Template:Ubl Removal of deprecated items in Servlet, Faces, CDI and EJB (Entity Beans and Embeddable Container). CDI-Build Time.
Template:Nowrap Template:Nowrap[12] 9.1 Template:Ubl JDK 11 support
Jakarta EE 9 Template:Nowrap[13] 9 Java SE 8 API namespace move from Template:Code to Template:Code
Jakarta EE 8 Template:Nowrap[14] 8 Java SE 8 Full compatibility with Java EE 8
Java EE 8 2017-08-31 JSR 366 Java SE 8 HTTP/2 and CDI based Security
Java EE 7 2013-05-28 JSR 342 Java SE 7 WebSocket, JSON and HTML5 support
Java EE 6 2009-12-10 JSR 316 Java SE 6 CDI managed Beans and REST
Java EE 5 2006-05-11 JSR 244 Java SE 5 Java annotations and Generics in Java
J2EE 1.4 2003-11-11 JSR 151 J2SE 1.4 WS-I interoperable web services[15]
J2EE 1.3 2001-09-24 JSR 58 J2SE 1.3 Java connector architecture[16]
J2EE 1.2 1999-12-17 1.2 J2SE 1.2 Initial specification release

Specifications

Jakarta EE includes several specifications that serve different purposes, like generating web pages, reading and writing from a database in a transactional way, and managing distributed queues.

The Jakarta EE APIs include several technologies that extend the functionality of the base Java SE APIs, such as Jakarta Enterprise Beans, connectors, servlets, Jakarta Server Pages and several web service technologies.

Web specifications

  • Jakarta Servlet: defines how to manage HTTP requests, in a synchronous or asynchronous way. It is low level and other Jakarta EE specifications rely on it;
  • Jakarta WebSocket: API specification that defines a set of APIs to service WebSocket connections;
  • Jakarta Faces: a technology for constructing user interfaces out of components;
  • Jakarta Expression Language (EL) is a simple language originally designed to satisfy the specific needs of web application developers. It is used specifically in Jakarta Faces to bind components to (backing) beans and in Contexts and Dependency Injection to named beans, but can be used throughout the entire platform.

Web service specifications

Enterprise specifications

  • Jakarta Activation (JAF) specifies an architecture to extend component Beans by providing data typing and bindings of such types.
  • Jakarta Contexts and Dependency Injection (CDI) is a specification to provide a dependency injection container;
  • Jakarta Enterprise Beans (EJB) specification defines a set of lightweight APIs that an object container (the EJB container) will support in order to provide transactions (using JTA), remote procedure calls (using RMI or RMI-IIOP), concurrency control, dependency injection and access control for business objects. This package contains the Jakarta Enterprise Beans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the ejb container.
  • Jakarta Persistence (JPA) are specifications about object-relational mapping between relation database tables and Java classes.
  • Jakarta Transactions (JTA) contains the interfaces and annotations to interact with the transaction support offered by Jakarta EE.[17][18] Even though this API abstracts from the really low-level details in implementing the X/Open XA standard, the interfaces are also considered somewhat low-level and the average application developer in Jakarta EE is either assumed to be relying on transparent handling of transactions by the higher level EJB abstractions, or using the annotations provided by this API in combination with CDI managed beans.
  • Jakarta Messaging (JMS) provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

Other specifications

  • Jakarta Validation: This package contains the annotations and interfaces for the declarative validation support offered by the Jakarta Validation API. Jakarta Validation provides a unified way to provide constraints on beans (e.g. Jakarta Persistence model classes) that can be enforced cross-layer. In Jakarta EE, Jakarta Persistence honors bean validation constraints in the persistence layer, while JSF does so in the view layer.
  • Jakarta Batch provides the means for batch processing in applications to run long running background tasks that possibly involve a large volume of data and which may need to be periodically executed.
  • Jakarta Connectors is a Java-based tool for connecting application servers and enterprise information systems (EIS) as part of enterprise application integration (EAI). This is a low-level API aimed at vendors that the average application developer typically does not come in contact with.

Web profile

In an attempt to limit the footprint of web containers, both in physical and in conceptual terms, the web profile was created, a subset of the Jakarta EE specifications. The Jakarta EE web profile comprises the following:

Specification Java EE 6[19] Java EE 7[20] Java EE 8[21]
Jakarta EE 8[22]
Jakarta EE 9[23]
Jakarta EE 9.1[24]
Jakarta EE 10[25] Jakarta EE 11[26]
Jakarta Servlet 3.0 3.1 4.0 5.0 6.0 6.1
Jakarta Server Pages (JSP) 2.2 2.3 2.3 3.0 3.1 4.0
Jakarta Expression Language (EL) 2.2 3.0 3.0 4.0 5.0 6.0
Jakarta Debugging Support for Other Languages (JSR-45) 1.0 1.0 1.0 2.0 2.0 2.0
Jakarta Standard Tag Library (JSTL) 1.2 1.2 1.2 2.0 3.0 3.0
Jakarta Faces 2.0 2.2 2.3 3.0 4.0 4.1
Jakarta RESTful Web Services (JAX-RS) 1.1 2.0 2.1 3.0 3.1 4.0
Jakarta WebSocket (WebSocket) Template:N/a 1.0 1.1 2.0 2.1 2.2
Jakarta JSON Processing (JSON-P) Template:N/a 1.0 1.1 2.0 2.1 2.1
Jakarta JSON Binding (JSON-B) Template:N/a Template:N/a 1.1 2.0 3.0 3.0
Jakarta Annotations (CA) 1.1 1.2 1.3 2.0 2.1 3.0
Jakarta Enterprise Beans (EJB) 3.1 Lite 3.2 Lite 3.2 Lite 4.0 Lite 4.0 Lite 4.0 Lite
Jakarta Transactions (JTA) 1.1 1.2 1.2 2.0 2.0 2.0
Jakarta Persistence (JPA) 2.0 2.1 2.2 3.0 3.1 3.2
Jakarta Bean Validation 1.0 1.1 2.0 3.0 3.0 3.1
Jakarta Managed Beans 1.0 1.0 1.0 2.0 Template:N/a N/a
Jakarta Interceptors 1.1 1.2 1.2 2.0 2.1 2.2
Jakarta Contexts and Dependency Injection (CDI) 1.0 1.1 2.0 3.0 4.0 4.1
Jakarta Dependency Injection 1.0 1.0 1.0 2.0 2.0 2.0
Jakarta Security Template:N/a Template:N/a 1.0 2.0 3.0 4.0
Jakarta Authentication Template:N/a 1.0 1.1 2.0 3.0 3.1
Jakarta Concurrency Template:N/a Template:N/a Template:N/a Template:N/a 3.0 3.1

Certified referencing runtimes

Although by definition all Jakarta EE implementations provide the same base level of technologies (namely, the Jakarta EE spec and the associated APIs), they can differ considerably with respect to extra features (like connectors, clustering, fault tolerance, high availability, security, etc.), installed size, memory footprint, startup time, etc.

Jakarta EE

Referencing runtime[27][28][29] Developer Jakarta EE 10 Platform Jakarta EE 9/9.1 Platform Compatible Products Jakarta EE 9/9.1 Web Profile Compatible Products Jakarta EE 8 Platform Compatible Products Jakarta EE 8 Web Profile Compatible Products Licensing
GlassFish Eclipse Template:Yes 7.0.0 Template:Yes 6.0.0/ 6.1.0 Template:Yes 6.0.0/ 6.1.0 Template:Yes 5.1.0 Template:Yes 5.1.0 Template:Free
Open Liberty IBM Template:Yes 22.0.0.13-beta,[30] 23.0.0.3[31] Template:Yes 21.0.0.12 Template:Yes 21.0.0.12 Template:Yes 19.0.0.6, 20.0.0.3 Template:Yes 19.0.0.6, 20.0.0.3 Template:Free
WebSphere Liberty IBM Template:Yes 23.0.0.3[31] Template:Yes 21.0.0.12 Template:Yes 21.0.0.12 Template:Yes 20.0.0.3 Template:Yes 20.0.0.3 Template:Proprietary
WildFly Red Hat Template:Yes 27.0.0.Alpha5 Template:Yes 23.0.1-Preview/25.0.0-Preview Template:Yes 23.0.1-Preview/25.0.0-Preview Template:Yes 18.0.0 Template:Yes 18.0.0 Template:Free
JBoss EAP Red Hat Template:Yes 8.0.0 Template:No Template:No Template:Yes 7.3.0 Template:Yes 7.3.0 Template:Free
TomEE Apache Template:Yes 10.x Template:Yes 9.x Template:Yes 9.x Template:Yes 8.x Template:Yes 8.x Template:Free
Payara Server Payara Services Limited Template:Yes 6.2022.1 Alpha 4 Template:Yes 6.2021.1 Alpha 1 Template:No Template:Yes 5.22.0, 5.23.0 Template:Yes 5.23.0 Template:Free
Thunisoft Application Server Beijing Thunisoft Information Technology Template:No Template:Yes 3.0 Template:No Template:Yes 2.8 Template:No Template:Proprietary
JEUS TmaxSoft Template:No Template:No Template:No Template:Yes 8.5 Template:No Template:Proprietary
InforSuite Application Server Shandong Cvicse Middleware Template:No Template:Yes 11 Template:No Template:Yes 10 Template:No Template:Proprietary
WebOTX NEC Template:Yes 12 Template:No Template:No Template:Yes 11 Template:No Template:Proprietary

Java EE

Referencing runtime Developer Java EE 8 certified – Full Java EE 8 certified – Web Java EE 7 certified – Full Java EE 7 certified – Web Java EE 6 certified – Full
Official Oracle page for Java EE Compatibility.
Java EE 6 certified – Web Java EE 5 certified J2EE 1.4 certified Licensing
GlassFish server Open Source Edition Oracle Template:Yes v5.0[32] Template:Yes v5.0[32] Template:Yes v4.x[33] Template:Yes v4.x[33] Template:Yes v3.x and upward[34] Template:Yes v3.x Web Profile Template:Yes v2.1.x[34] Template:Free
Oracle GlassFish Server Oracle Template:Yes v3[35] based on the open source GlassFish application server Template:Yes Sun Java System Application Server v9.0 Template:Yes Sun Java System Application Server v8.2 Template:Proprietary
Oracle WebLogic Server Oracle Template:Yes 14.1.1[36] Template:Yes 12.2.1[37] Template:Yes v12c[38] Template:Yes v10.3.5.0 Template:Yes v9 Template:Proprietary
WildFly Red Hat Template:Yes v14.x[32] Template:Yes v14.x[32] Template:Yes v8.1 [39] Template:Yes v8.0.0.Final Template:Yes v7.1[40] Template:Yes v6.0[41] and v7.0[42] Template:Yes v5.1[43][44] Template:Yes v4.x Template:Free
JBoss Enterprise Application Platform Red Hat Template:Yes v7.2 [45] Template:Yes v7.0[33] Template:Yes v7.0[33] Template:Yes v6.0[46] Template:Yes v5 Template:Proprietary
IBM WebSphere Application Server IBM Template:Yes v9.x[32] Template:Yes v9.x[33] Template:Yes v8[47] Template:Yes v7 Template:Yes Template:Proprietary
IBM WebSphere Application Server Liberty IBM Template:Yes v18.0.0.2[48] Template:Yes v18.0.0.2[48] Template:Yes v8.5.5.6[49][50] Template:Yes v8.5.5.6[33] Template:Yes v8.5.5[51] Template:Proprietary
Open Liberty IBM Template:Yes v18.0.0.2 Template:Yes v18.0.0.2 Template:Free
IBM WebSphere Application Server Community Edition IBM Template:Yes v3.0 Template:Yes v2.1 Template:Proprietary
Apache Geronimo Apache Template:Yes v3.0-beta-1[52][53] Template:Yes v2.0 Template:Yes v1.0 Template:Free
JEUS TmaxSoft Template:Yes v8 Template:Yes v7[54][55] Template:Yes v6 Template:Yes v5 Template:Proprietary
Cosminexus Application Server Hitachi Template:Yes v10.0[32] Template:Yes v9[56] Template:Proprietary
Fujitsu Interstage Application Server[57] Fujitsu Template:Yes v12.0[32] Template:Yes v1 Azure/v10.1[58][59] Template:Yes Template:Proprietary
WebOTX NEC Template:Yes[60] Template:Yes Template:Proprietary
BES Application Server Baolande Template:Yes v9.5[33]
Apache TomEE[61][62] Apache Template:No 7 (Java EE 7 like, but not certified[63]) Template:Yes Template:Free
Resin Server Caucho Template:Yes v4.0[64] Template:Yes Template:Proprietary
Siwpas OW2 Template:Yes v6.0[65] Template:Free
JOnAS OW2 Template:Yes v5.3 rc1[66] Template:Yes Template:Yes Template:Free
SAP NetWeaver SAP Template:Yes v2.x[67] Template:Yes Template:Yes Template:Proprietary
Oracle Containers for Java EE Oracle Template:Yes Template:Proprietary
Oracle iPlanet Web Server Oracle Template:Yes Sun Java System Web Server Template:Proprietary
Oracle Application Server 10g Oracle Template:Yes Template:Proprietary
Pramati Server Pramati Technologies Template:Yes v5.0 Template:Proprietary
Trifork T4 Trifork Template:Yes Template:Proprietary
Sybase Enterprise Application Server[68] Sybase Template:Yes Template:Proprietary

Jakarta Mail

Jakarta Mail (formerly JavaMail) is a Jakarta EE API used to send and receive email via SMTP, POP3 and IMAP. Jakarta Mail is built into the Jakarta EE platform, but also provides an optional package for use in Java SE.[69]

The current version is 2.1.3, released on February 29, 2024.[70] Another open source Jakarta Mail implementation exists (GNU JavaMail), which -while supporting only the obsolete JavaMail 1.3 specification- provides the only free NNTP backend, which makes it possible to use this technology to read and send news group articles.

As of 2019, the software is known as Jakarta Mail, and is part of the Jakarta EE brand (formerly known as Java EE). The reference implementation is part of the Eclipse Angus project.

Maven coordinates of the relevant projects required for operation are:

  • mail API: jakarta.mail:jakarta.mail-api:2.1.3
  • mail implementation: org.eclipse.angus:angus-mail:2.0.3
  • multimedia extensions: jakarta.activation:jakarta.activation-api:2.1.3

Jakarta Mail is hosted as an open source project on Eclipse.org under its new name Jakarta Mail.[71]

Most of the Jakarta Mail source code is licensed under the following licences:

  • EPL-2.0
  • GPL-2.0 with Classpath Exception license
  • The source code for the demo programs is licensed under the BSD license

Code sample

The code sample shown below demonstrates how various technologies in Java EE 7 are used together to build a web form for editing a user.

In Jakarta EE a (web) UI can be built using Jakarta Servlet, Jakarta Server Pages (JSP), or Jakarta Faces (JSF) with Facelets. The example below uses Faces and Facelets. Not explicitly shown is that the input components use the Jakarta EE Bean Validation API under the covers to validate constraints.

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core">

    <f:metadata>
        <f:viewParam name="user_id" value="#{userEdit.user}" converter="#{userConvertor}" />
    </f:metadata>

    <h:body>

        <h:messages />

        <h:form>
            <h:panelGrid columns="2">
                <h:outputLabel for="firstName" value="First name" />
                <h:inputText id="firstName" value="#{userEdit.user.firstName}" label="First name" />

                <h:outputLabel for="lastName" value="Last name" />
                <h:inputText id="lastName" value="#{userEdit.user.lastName}" label="Last name" />

                <h:commandButton action="#{userEdit.saveUser}" value="Save" />
            </h:panelGrid>
        </h:form>

    </h:body>
</html>

Example Backing Bean class

To assist the view, Jakarta EE uses a concept called a "Backing Bean". The example below uses Contexts and Dependency Injection (CDI) and Jakarta Enterprise Beans (EJB).

package org.wikipedia.examples;

import java.io.Serializable;

import jakarta.faces.view.ViewScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;

@Named
@ViewScoped
public class UserEdit implements Serializable {
    private static final long serialVersionUID = 1L;

    private User user;

    @Inject
    private UserDAO userDAO;

    public String saveUser() {
        userDAO.save(this.user);
        addFlashMessage(String.format("User %d saved", this.user.getId()));

        return "users.xhtml?faces-redirect=true";
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }
}

Example Data Access Object class

To implement business logic, Jakarta Enterprise Beans (EJB) is the dedicated technology in Jakarta EE. For the actual persistence, JDBC or Jakarta Persistence (JPA) can be used. The example below uses EJB and JPA. Not explicitly shown is that JTA is used under the covers by EJB to control transactional behavior.

package org.wikipedia.examples;

import java.util.List;

import jakarta.ejb.Stateless;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.TypedQuery;

@Stateless
public class UserDAO {
    @PersistenceContext
    private EntityManager entityManager;

    public void save(User user) {
        entityManager.persist(user);
    }

    public void update(User user) {
        entityManager.merge(user);
    }

    public List<User> getAll() {
        return entityManager.createNamedQuery("User.getAll", User.class)
            .getResultList();
    }
}

Example Entity class

For defining entity/model classes Jakarta EE provides the Jakarta Persistence (JPA), and for expressing constraints on those entities it provides the Bean Validation API. The example below uses both these technologies.

package org.wikipedia.examples;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;

@Entity
public class User {
    @Id
    @GeneratedValue(strategy = IDENTITY)
    private Integer id;

    @Size(min = 2, message="First name too short")
    private String firstName;

    @Size(min = 2, message="Last name too short")
    private String lastName;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
}

See also

Template:Portal

References

Template:Reflist

Template:Commons category

Template:Jakarta EE Template:Eclipse Foundation Template:Java (software platform)

  1. ↑ Template:Cite web
  2. ↑ Template:Cite web
  3. ↑ Template:Cite web
  4. ↑ Template:Cite web
  5. ↑ Template:Cite web
  6. ↑ Template:Cite news
  7. ↑ Template:Cite news
  8. ↑ Template:Cite web
  9. ↑ Template:Cite web
  10. ↑ Template:Cite press release
  11. ↑ Template:Cite press release
  12. ↑ Template:Cite press release
  13. ↑ Template:Cite press release
  14. ↑ Template:Cite press release
  15. ↑ Template:Cite web
  16. ↑ Template:Cite web
  17. ↑ Template:Cite book
  18. ↑ Template:Cite book
  19. ↑ Template:Cite web
  20. ↑ Template:Cite web
  21. ↑ Template:Cite web
  22. ↑ Template:Cite web
  23. ↑ Template:Cite web
  24. ↑ Template:Cite web
  25. ↑ Template:Cite web
  26. ↑ Template:Cite web
  27. ↑ Template:Cite web
  28. ↑ Template:Cite web
  29. ↑ Template:Cite web
  30. ↑ Template:Cite web
  31. ↑ 31.0 31.1 Template:Cite web
  32. ↑ 32.0 32.1 32.2 32.3 32.4 32.5 32.6 Template:Cite web
  33. ↑ 33.0 33.1 33.2 33.3 33.4 33.5 33.6 Template:Cite web
  34. ↑ 34.0 34.1 Template:Cite web
  35. ↑ Template:Cite web
  36. ↑ Template:Cite web
  37. ↑ Template:Cite web
  38. ↑ Template:Cite web
  39. ↑ Template:Cite web
  40. ↑ Template:Cite web
  41. ↑ Template:Cite web
  42. ↑ Template:Cite web
  43. ↑ Template:Cite web
  44. ↑ Template:Cite web
  45. ↑ Template:Cite web
  46. ↑ Template:Cite web
  47. ↑ Template:Cite web
  48. ↑ 48.0 48.1 Template:Cite web
  49. ↑ Template:Cite web
  50. ↑ Template:Cite web
  51. ↑ Template:Cite web
  52. ↑ Template:Cite web
  53. ↑ Template:Cite web
  54. ↑ Template:Cite web
  55. ↑ Template:Cite web
  56. ↑ Template:Cite web
  57. ↑ Template:Cite web
  58. ↑ Template:Cite web
  59. ↑ Template:Cite web
  60. ↑ Template:Cite web
  61. ↑ Template:Cite web
  62. ↑ Template:Cite web
  63. ↑ Template:Cite web
  64. ↑ Template:Cite web
  65. ↑ Template:Cite web
  66. ↑ Template:Cite web
  67. ↑ Template:Cite web
  68. ↑ Template:Cite web
  69. ↑ Template:Cite web
  70. ↑ Template:Cite web
  71. ↑ Template:Cite web