Java Platform, Enterprise Edition

From HandWiki

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

Java 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 Java EE compliant.

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

History

The platform 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. The current version is called Jakarta EE 8.

  • J2EE 1.2 (December 12, 1999)
  • J2EE 1.3 (September 24, 2001)
  • J2EE 1.4 (November 11, 2003)
  • Java EE 5 (May 11, 2006)
  • Java EE 6 (December 10, 2009)
  • Java EE 7 (May 28, 2013,[3] but April 5, 2013 according to spec document. June 12, 2013 was the planned kickoff date[4])
  • Java EE 8 (August 31, 2017[5])
  • Jakarta EE 8 (September 10, 2019) - fully compatible with Java EE 8[6]

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.[7] The Eclipse top-level project has been named Eclipse Enterprise for Java (EE4J).[8] The Eclipse Foundation was forced to change the name of Java EE because Oracle owns the trademark for the name "Java."[9] On February 26, 2018, it was announced that the new name of Java EE will be Jakarta EE.[10]

Specifications

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

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

Web specifications

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

Web service specifications

  • Java API for RESTful Web Services provides support in creating web services according to the Representational State Transfer (REST) architectural pattern;
  • Java API for JSON Processing is a set of specifications to manage information encoded in JSON format;
  • Java API for JSON Binding provides specifications to convert JSON information into or from Java classes;
  • Java Architecture for XML Binding allows mapping XML into Java objects;
  • Java API for XML Web Services can be used to create SOAP web services.

Enterprise specifications

  • Contexts and Dependency Injection is a specification to provide a dependency injection container, as in Spring;
  • Enterprise JavaBean (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 Enterprise JavaBeans classes and interfaces that define the contracts between the enterprise bean and its clients and between the enterprise bean and the ejb container.
  • Java Persistence API are specifications about object-relational mapping between relation database tables and Java classes.
  • Java Transaction API contains the interfaces and annotations to interact with the transaction support offered by Java EE. Even though this API abstracts from the really low-level details, the interfaces are also considered somewhat low-level and the average application developer in Java 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.
  • Java Message Service provides a common way for Java programs to create, send, receive and read an enterprise messaging system's messages.

Other specifications

  • Validation: This package contains the annotations and interfaces for the declarative validation support offered by the Bean Validation API. Bean Validation provides a unified way to provide constraints on beans (e.g. JPA model classes) that can be enforced cross-layer. In Java EE, JPA honors bean validation constraints in the persistence layer, while JSF does so in the view layer.
  • Batch Applications provides the means to run long running background tasks that possibly involve a large volume of data and which may need to be periodically executed.
  • Java EE Connector Architecture 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 Java EE specifications. The Java EE web profile comprises the following:

Specification Java EE 6[11] Java EE 7[3] Java EE 8[5]
Servlet 3.0 3.1 4.0
JavaServer Pages (JSP) 2.2 2.3 2.3
Unified Expression Language (EL) 2.2 3.0 3.0
Debugging Support for Other Languages (JSR-45) 1.0 1.0 1.0
JavaServer Pages Standard Tag Library (JSTL) 1.2 1.2 1.2
JavaServer Faces (JSF) 2.0 2.2 2.3
Java API for RESTful Web Services (JAX-RS) 1.1 2.0 2.1
Java API for WebSocket (WebSocket) n/a 1.0 1.1
Java API for JSON Processing (JSON-P) n/a 1.0 1.1
Common Annotations for the Java Platform (JSR-250) 1.1 1.2 1.3
Enterprise JavaBeans (EJB) 3.1 Lite 3.2 Lite 3.2
Java Transaction API (JTA) 1.1 1.2 1.2
Java Persistence API (JPA) 2.0 2.1 2.2
Bean Validation 1.0 1.1 2.0
Managed Beans 1.0 1.0 1.0
Interceptors 1.1 1.2 1.2
Contexts and Dependency Injection for the Java EE Platform 1.0 1.1 2.0
Dependency Injection for Java 1.0 1.0 1.0

Certified referencing runtimes

Although by definition all Java EE implementations provide the same base level of technologies (namely, the Java 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.

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 Yes v5.0[12] Yes v5.0[12] Yes v4.x[13] Yes v4.x[13] Yes v3.x and upward[14] Yes v3.x Web Profile Yes v2.1.x[14] Free software
Oracle GlassFish Server Oracle Yes v3[15] based on the open source GlassFish application server Yes Sun Java System Application Server v9.0 Yes Sun Java System Application Server v8.2 Proprietary software
Oracle WebLogic Server Oracle Yes 12.2.1[16] Yes v12c[17] Yes v10.3.5.0 Yes v9 Proprietary software
WildFly Red Hat Yes v14.x[12] Yes v14.x[12] Yes v8.1 [18] Yes v8.0.0.Final Yes v7.1[19] Yes v6.0[20] and v7.0[21] Yes v5.1[22][23] Yes v4.x Free software
JBoss Enterprise Application Platform Red Hat Yes v7.2 [24] Yes v7.0[13] Yes v7.0[13] Yes v6.0[25] Yes v5 Source is Free software
IBM WebSphere Application Server IBM Yes v9.x[12] Yes v9.x[13] Yes v8[26] Yes v7 Yes Proprietary software
IBM WebSphere Application Server Liberty IBM Yes v18.0.0.2[27] Yes v18.0.0.2[27] Yes v8.5.5.6[28][29] Yes v8.5.5.6[13] Yes v8.5.5[30] Proprietary software
Open Liberty IBM Yes v18.0.0.2 Yes v18.0.0.2 Free software
IBM WebSphere Application Server Community Edition IBM Yes v3.0 Yes v2.1 Proprietary software
Apache Geronimo Apache Yes v3.0-beta-1[31][32] Yes v2.0 Yes v1.0 Free software
JEUS TmaxSoft Yes v8 Yes v7[33][34] Yes v6 Yes v5 Proprietary software
Cosminexus Application Server Hitachi Yes v10.0[12] Yes v9[35] Proprietary software
Fujitsu Interstage Application Server[36] Fujitsu Yes v12.0[12] Yes v1 Azure/v10.1[37][38] Yes Proprietary software
WebOTX NEC Yes[39] Yes Proprietary software
BES Application Server Baolande Yes v9.5[13]
Apache TomEE[40][41] Apache No 7 (Java EE 7 like, but not certified[42]) Yes Free software
Resin Server Caucho Yes v4.0[43] Yes Proprietary software
Siwpas OW2 Yes v6.0[44] Free software
JOnAS OW2 Yes v5.3 rc1[45] Yes Yes Free software
SAP NetWeaver SAP Yes v2.x[46] Yes Yes Proprietary software
Oracle Containers for Java EE Oracle Yes Proprietary software
Oracle iPlanet Web Server Oracle Yes Sun Java System Web Server Proprietary software
Oracle Application Server 10g Oracle Yes Proprietary software
Pramati Server Pramati Yes v5.0 Proprietary software
Trifork T4 Trifork Yes Proprietary software
Sybase Enterprise Application Server[47] Sybase Yes Proprietary software

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 Java EE a (web) UI can be built using Servlet, JavaServer Pages (JSP), or JavaServer Faces (JSF) with Facelets. The example below uses JSF and Facelets. Not explicitly shown is that the input components use the Java 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, Java EE uses a concept called a "Backing Bean". The example below uses Contexts and Dependency Injection (CDI) and Enterprise JavaBean (EJB).

@Named
@ViewScoped
public class UserEdit {
        
    private User user;

    @Inject
    private UserDAO userDAO;
  
    public String saveUser() {
        userDAO.save(this.user);        
        addFlashMessage("User " + this.user.getId() + " saved");
                
        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, Enterprise JavaBean (EJB) is the dedicated technology in Java EE. For the actual persistence, JDBC or Java Persistence API (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.

@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 Java EE provides the Java Persistence API (JPA), and for expressing constraints on those entities it provides the Bean Validation API. The example below uses both these technologies.

@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

References

  1. "Differences between Java EE and Java SE - Your First Cup: An Introduction to the Java EE Platform". Docs.oracle.com. 2012-04-01. http://docs.oracle.com/javaee/6/firstcup/doc/gkhoy.html. Retrieved 2012-07-18. 
  2. "Java EE Overview". Oracle Corporation. https://www.oracle.com/technetwork/java/javaee/overview/index.html. Retrieved February 26, 2017. 
  3. 3.0 3.1 "JSR 342: Java™ Platform, Enterprise Edition 7 (Java EE 7) Specification". http://jcp.org/en/jsr/detail?id=342. 
  4. Wieldt, Tori. "Introducing Java EE 7: June 12 Kickoff". https://blogs.oracle.com/java/entry/introducing_java_ee_7. 
  5. 5.0 5.1 "Java Platform, Enterprise Edition (Java EE) Specification, v8". Oracle. https://github.com/javaee/javaee-spec/blob/master/download/JavaEE8_Platform_Spec_FinalRelease.pdf. 
  6. "Welcome to the Future of Cloud Native Java" (in en). 10 September 2019. https://blogs.eclipse.org/post/mike-milinkovich/welcome-future-cloud-native-java. Retrieved 12 September 2019. 
  7. John K. Waters (2017-09-12). "Java EE Is Moving to the Eclipse Foundation" (in en). https://adtmag.com/articles/2017/09/12/java-ee-moving-to-eclipse.aspx. 
  8. Beaton, Wayne. "EE4J FAQ | The Eclipse Foundation". https://www.eclipse.org/ee4j/faq.php. 
  9. Vaughan-Nichols, Steven J. (2018-03-05). "Good-bye JEE, hello Jakarta EE" (in en). https://www.zdnet.com/article/good-bye-jee-hello-jakarta-ee/. 
  10. Milinkovich, Mike (2018-02-26). "And the Name Is…" (in en). https://mmilinkov.wordpress.com/2018/02/26/and-the-name-is/. 
  11. "JSR 316: Java™ Platform, Enterprise Edition 6 (Java EE 6) Specification". http://jcp.org/en/jsr/detail?id=316. 
  12. 12.0 12.1 12.2 12.3 12.4 12.5 12.6 "Java EE Compatibility". http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html. 
  13. 13.0 13.1 13.2 13.3 13.4 13.5 13.6 "Java EE Compatibility". http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html. 
  14. 14.0 14.1 "Comparing GlassFish Open Source Edition versions 2.x and 3.0.x". https://glassfish.dev.java.net/public/comparing_v2_and_v3.html. 
  15. "Java EE Compatibility". Java.sun.com. 2010-09-07. http://java.sun.com/javaee/overview/compatibility.jsp. Retrieved 2012-07-18. 
  16. "Oracle Weblogic Server 12.1.1". https://www.oracle.com/technetwork/java/javaee/overview/oracleweblogic1211-2769862.html. 
  17. "Archived copy". Archived from the original on 2011-12-15. https://web.archive.org/web/20111215182732/http://wcc.on24.com/event/37/57/27/rt/1/documents/player_docanchr_3/weblogic12c_launch_tech_webinar_v8.pdf. Retrieved 2011-12-03. 
  18. "Java EE Compatibility". https://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html. 
  19. "JBoss AS 7.1.0.Final "Thunder" released - Java EE 6 Full Profile certified! | My Wiki | Planet JBoss Community". Planet.jboss.org. 2012-02-17. http://planet.jboss.org/post/jboss_as_7_1_0_final_thunder_released_java_ee_6_full_profile_certified. Retrieved 2012-07-18. 
  20. "JBoss Application Server - JBoss Community". http://www.jboss.org/jbossas. 
  21. "JBoss Application Server - JBoss Community". http://www.jboss.org/as7. 
  22. "Java EE Compatibility". http://java.sun.com/javaee/overview/compatibility.jsp. 
  23. "JBoss AS is now EE5 certified!". 15 September 2008. https://sacha.labourey.com/2008/09/15/jboss-as-is-now-ee5-certified/. 
  24. "Red Hat JBoss Enterprise Application Platform 7.2 Availability". https://middlewareblog.redhat.com/2019/01/22/red-hat-jboss-enterprise-application-platform-7-2-availability/. 
  25. Business Wire (2012-06-20). "Red Hat Launches JBoss Enterprise Application Platform 6 to Help Enterprises Move Application Development and Deployment to the Cloud". Business Wire. http://www.businesswire.com/news/home/20120620005266/en/Red-Hat-Launches-JBoss-Enterprise-Application-Platform. Retrieved 2012-07-18. 
  26. "What's new in WebSphere Application Server V8". Ibm.com. http://www.ibm.com/developerworks/websphere/techjournal/1106_alcott/1106_alcott.html. Retrieved 2012-07-18. 
  27. 27.0 27.1 "IBM WebSphere Application Server Liberty delivers the first production-ready, Java EE 8-compatible application server and broadens support for Spring Boot applications". http://www-01.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ssi/rep_ca/4/897/ENUS218-354/index.html&lang=en&request_locale=en. Retrieved 12 July 2018. 
  28. oracle.com/technetwork/java/javaee/overview/waslibertyprofile8556-2587134.html
  29. "Java EE 7 has landed in WAS Liberty - WASdev". 25 June 2015. https://developer.ibm.com/wasdev/blog/2015/06/25/java-ee-7-has-landed-in-was-liberty. 
  30. "IBM Java EE 6 Web Profile Tested Configurations". http://www.oracle.com/technetwork/java/javaee/community/ibm-javaee6-web-tested-configs-1961333.html. 
  31. "Apache Geronimo : Index". January 25, 2010. http://geronimo.apache.org/. 
  32. "Apache Geronimo fully certified for Java EE 6 - The H Open: News and Features". H-online.com. 2011-11-14. Archived from the original on 20 April 2012. https://web.archive.org/web/20120420064218/http://www.h-online.com/open/news/item/Apache-Geronimo-fully-certified-for-Java-EE-6-1378384.html. Retrieved 2012-07-18. 
  33. "Tested Configurations, Java EE 6 - TMAX JEUS 7". Oracle.com. 2010-09-07. http://www.oracle.com/technetwork/java/javaee/tmax-javaee6-141684.html. Retrieved 2012-07-18. 
  34. "Java EE6 Web Application Server, WAS Software". Us.tmaxsoft.com. Archived from the original on 2012-07-02. https://web.archive.org/web/20120702045326/http://us.tmaxsoft.com/jsp/product/detailcontents.jsp?psCd=00PD04&menuCd=00PDMSJE. Retrieved 2012-07-18. 
  35. "Java EE 6 - Tested Configurations, Java EE 6 - Hitachi uCosminexus Application Server v9.0". Oracle.com. http://oracle.com/technetwork/java/javaee/community/hitachi-compat-1585039.html. 
  36. "Fujitsu Interstage Application Server powered by Windows Azure". Archived from the original on August 10, 2011. https://web.archive.org/web/20110810160631/http://www.fujitsu.com/global/services/software/windows-azure/. 
  37. "Tested Configurations, Java EE6 - Fujitsu Interstage". Oracle.com. 2010-09-07. http://www.oracle.com/technetwork/java/javaee/community/default-452835.html. Retrieved 2012-07-18. 
  38. "Fujitsu Releases Interstage Application Server V10.1". Fujitsu. http://fujitsu.com/global/about/resources/news/press-releases/2011/1220-02.html. 
  39. "NEC WebOTX Application Server V9.x Certification". http://www.oracle.com/technetwork/java/javaee/community/nec-webotx-v9x-certification-2002719.html. 
  40. "Apache TomEE". Openejb.apache.org. http://openejb.apache.org/3.0/apache-tomee.html. Retrieved 2012-07-18. 
  41. "MarketWatch.com". MarketWatch.com. http://www.marketwatch.com/story/the-apache-software-foundation-announces-apache-tomee-certified-as-java-ee-6-web-profile-compatible-2011-10-04. Retrieved 2012-07-18. 
  42. TomEE, Apache. "Apache TomEE 7.0.1". http://tomee.apache.org/download/tomee-7.0.1.html. 
  43. http://www.caucho.com/articles/Caucho_Web%20Profile%20JavaEE6_whitepaper_byRR.pdf
  44. "Please Welcome Siwpas as Java EE Certified Option!". Oracle.com. https://blogs.oracle.com/theaquarium/entry/please_welcome_siwpas_as_java. Retrieved 2015-12-07. 
  45. "Archived copy". Archived from the original on 2013-10-15. https://web.archive.org/web/20131015132408/http://jonas.ow2.org/xwiki/bin/view/Blog/JOnAS+530+RC1+released. Retrieved 2014-02-25. 
  46. "SAP NetWeaver Cloud Java EE 6 Web Profile Certified! (The Aquarium)". https://blogs.oracle.com/theaquarium/entry/sap_netweaver_cloud_java_ee. 
  47. "SAP Software Solutions - Business Applications and Technology". http://www.sybase.com/products/modelingdevelopment/easerver. 

External links