Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Cloud-Native Development and Migration to Jakarta EE
Cloud-Native Development and Migration to Jakarta EE

Cloud-Native Development and Migration to Jakarta EE: Transform your legacy Java EE project into a cloud-native application

Arrow left icon
Profile Icon Ron Veen Profile Icon David Vlijmincx
Arrow right icon
€18.99 €27.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
eBook Oct 2023 198 pages 1st Edition
eBook
€18.99 €27.99
Paperback
€34.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Ron Veen Profile Icon David Vlijmincx
Arrow right icon
€18.99 €27.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
eBook Oct 2023 198 pages 1st Edition
eBook
€18.99 €27.99
Paperback
€34.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€18.99 €27.99
Paperback
€34.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Cloud-Native Development and Migration to Jakarta EE

The History of Enterprise Java

In this chapter, we will look at the history of Java EE and Jakarta EE. Since its inception, Java enterprise technology has had several names – starting as J2EE, then being rebranded as JEE, followed by Java EE, and finally, Jakarta EE.

In this chapter, we will cover the following topics:

  • What is Java EE, and why was it created?
  • Web servers versus application servers
  • Java EE 5, the first user-friendly version
  • The history of key features added in Java EE since version 5

By the end of this chapter, you will have a better understanding of Java EE and Jakarta EE in a historical sense, and you will know some of the key features added to Java EE. Changes to Jakarta EE will be discussed in subsequent chapters.

What is Java EE, and why was it created?

The Java language was introduced to the world in 1996. It consisted of a compiler and a Java virtual machine. Both components are platform-dependent, meaning that you have different versions for Windows, Linux, macOS, and so on. This is called Java Standard Edition (Java SE).

The Java language is unique in that it does not compile to native machine code but, instead, to something called bytecode. This bytecode is platform-independent, meaning it can be transferred to any of the aforementioned platforms.

To execute the bytecode, you would need a Java Virtual Machine (JVM). The JVM translates the intermediate bytecode to machine code, specific to the platform it is executed on.

This principle of compiling to bytecode and being able to execute it on any platform was dubbed Write Once, Run Anywhere (WORA). This has proven to be the distinctive feature that has led to the success of Java in business environments.

Initially, Java was meant to run in browsers, inside so-called applets. These applets added a lot of functionality to the early browsers such as Microsoft’s Internet Explorer and Netscape’s Navigator.

Free versions of Java were supplied to several popular platforms, which aided in the rapid success of the language.

The JVM specification could be licensed by third parties, allowing them to build their own implementations of the compiler and the JVM. Several companies have done so, which means that there are now several vendors that offer their own implementation. The most common are (in alphabetical order) as follows:

  • Alibabi Dragonwell
  • Amazon Coretto
  • Azul Zulu
  • Bellsoft Liberica
  • Eclipse Adoptium Temurin
  • J9
  • Oracle Oracle JDK and OpenJDK
  • Redhat OpenJDK
  • SAP SapMachine

But soon, Java moved out of the realm of browsers into the business world. It became obvious that developing business applications required additional functionality that was not part of the language.

Instead of adding this functionality to the language itself, it was decided that it would better be provided by a separate set of APIs. To avoid confusion and distinguish between Java SE and these new APIs, they were called Java Enterprise Edition (Java EE).

Java EE added features such as transactions, security, scalability, management of components, and concurrency. It allowed you to create dynamic web applications and provided a robust platform for distributed transactions.

Web servers versus application servers

The terms web servers and application servers are often confused by people new to Java EE and used interchangeably, although this is not correct. In this section, we will highlight the differences between the two, as we believe that it is important to know the differences between them, as both are key components of Java EE, but each plays its own role.

Starting to understand the difference between them is best done by highlighting their goals.

Web servers

Web servers implement the Servlet API, which is a set of classes and interfaces defined in the specification that allow you to create dynamic web applications. Applications based on the Servlet API, called Servlets, run inside a web server and serve, possibly dynamic, content to their users.

There are a number of technologies developed over the years that support the Servlet API. Specifications such as Java Server Pages (JSP), Java Standard Tag Libraries (JSTL), Java Server Faces (JSF), and Bean Validations are the most notable. Later, Java API for XML Web Service (JAX-WS) and Java API for Restful Web services (JAX-RS) were added.

There are many popular, standalone implementations of the Servlet API, such as the following:

  • Tomcat
  • Jetty
  • NGINX

All these provide a Servlet container in which servlets can run.

It is good to understand that you can run multiple servlets inside one servlet container. In the early days, this was a common practice, as it allowed you to run more than one application on the same piece of hardware.

For good measure, it should be noted that a framework such as Spring Boot still uses the Servlet API. This means that at the core level, some implementation of the Servlet API is still running. In the case of Spring Boot, however, which servlet container implementation is being used is pluggable, meaning you choose it yourself.

Application servers

Conversely, application servers do have the requirement of supplying an implementation that supports the Servlet API, but they offer far more than that. Application servers offer a richer environment, more targeted at executing business logic. They offer Enterprise Java Beans (EJBs). EJBs come in three major flavors:

  • Session Beans (SBs)
  • Entity Beans (EBs)
  • Message-Driven Beans (MDBs)

Session beans can be further divided into Stateful Session Beans (SFSBs) and Stateless Session Beans (SLSBs). Session beans contain business logic.

Entity beans, which handle database operations, came as Container Managed Persistence (CMP) and Bean Managed Persistence (BMP) entity beans. In the former, the application server was responsible for handling the persistence and retrieval of the data, while in the latter, an application developer had to write the queries to select and update the database themselves.

We write this in the past tense, as entity beans were dropped altogether in version 3 of the EJB specification, delivered in Java EE 5, in favor of the Java Persistence API (JPA).

Furthermore, application servers provide APIs for declarative and programmatic transaction management. As with entity beans, the difference is that in the former, the container will start, commit, or roll back transactions automatically, while in the latter, this has to be done in code.

The Java Messaging Service (JMS) is another feature that is required for application servers. JMS allows you to asynchronously exchange messages between different applications or application components.

JMS offers one-to-one connections between two components via queues while offering a one-to-many message exchange via topics.

Furthermore, application servers allow the registration and discovery of components via the Java Naming and Directory Interface (JNDI). As an example, an EJB to send emails can be instantiated and successively registered in the JNDI registry. Another EJB, which requires the functionality of sending an email, is then able to look up this email service by its name in the registry and use it.

In addition to this, functionality such as declarative security, concurrency, and interceptors are provided by application servers.

Some very popular application servers are as follows:

  • IBM Websphere
  • JBoss Application
  • Oracle Glassfish
  • Oracle Weblogic
  • Payara Server Enterprise

Application servers had a tendency to be heavy, and startup times were awful. Taking 10–15 minutes to start up and bringing the deployed applications to an initialized state was quite common in the early days. However, nowadays, it is very common that they start within a few seconds.

Profiles to the rescue

In the early years of Java EE, there was one simple rule if you wanted to be a Java EE compatible server – you had to implement all the specifications. However, it soon became clear that not every application required a full-blown application server. Often, a web server was more than enough.

To make this distinction clearer, profiles were introduced. The first one was Web Profile, which made its first appearance in Java EE 6. It was made up of the Servlet, JSF, JSP, EJB, CDI, JTA, JPA, and Bean Validation specifications.

The full set of all specifications became known as the Full Platform Profile.

In Jakarta EE 10, the Core Profile was introduced. This contains an even smaller subset of specifications and targets microservices, edge-computing, and ahead-of-time compilation. In Chapter 2, we will dive deeper into these subjects.

The following diagram depicts the different profiles and the specifications they are required to implement. The image was taken from the Jakarta EE website (https://jakarta.ee/release/10/).

Figure 1.1 – The different Jakarta EE profiles and their specifications

Figure 1.1 – The different Jakarta EE profiles and their specifications

Java EE 5, the first user-friendly version

This thing that hampered Java EE most of all was the sheer amount of configuration that you had to provide. All of these configurations had to be done in so-called XML deployment configuration files. We refer you to the documentation at https://docs.oracle.com/cd/E13211_01/wle/dd/ddref.htm, should you be interested in the content of the files.

For a container-managed entity bean, for instance, you had to specify each of the methods that were exported, its type parameters, and the return value.

It was not uncommon to have these configuration files being more than 300–400 lines of XML. This was called configuration hell, and this is where Java EE (back then still called J2EE) got its reputation in the developer community for being bloated.

Developers got so frustrated with this type of configuration that alternatives arose. The rise of the now very famous Spring Framework can be attributed to exactly these feelings. The Spring Framework itself required some XML configuration, but it wired up a lot of parts automatically for developers. Back then, what the Spring Framework did mostly, next to adding dependency injection, was wiring up the different components.

In 2005, version 5 of Java EE was released. This was the first time that J2EE was rebranded Java EE, but more importantly, it introduced annotations for the first time. Annotations allowed you to specify certain configuration options already in the code, thus providing a reasonable default setting. Now, it only was required to specify the situations where the configuration should divert from these default values. This is called convention over configuration, and it immensely reduces the amount of configuration required.

Another improvement was that you could now simply annotate a bean with, for instance, @Local, to define it as a local EJB. Again, dozens of lines of configuration were saved.

This was actually part of the introduction of the EJB3 specification. It was revolutionary in that sense that it deprecated the traditional entity beans in favor of the Java Persistence API(JPA).

JPA was heavily influenced by frameworks such as Hibernate, which provided an object-relational persistence approach. This meant that the mapping between database fields and Java fields was done by the framework now; no longer was application code required to achieve this mapping. This is known as Object-Relational Mapping (ORM).

With Java EE version 5, a very competitive and, maybe for the first time, very developer-friendly version of the specification became available. Suddenly, developing Java EE applications was not something just for very experienced developers anymore.

The history of key features added in Java EE since version 5

Let us now have a quick look at what changes have been introduced in Java EE after version 5.

Java EE 6

The most famous change that was introduced in Java EE version 6 is undoubtedly the support for RESTful API web services. REST has become the more popular form of web service, compared to SOAP web services, due to its flexible nature.

Additionally, version 6 saw the introduction of the Context and Dependency Injection (CDI) API. That allowed for, among other things, the use of dependency injection in Java EE applications.

Java EE 7

Java EE version 7 introduced the notion of batch applications. These are a number of tasks that are executed without user intervention.

It also introduced some additional concurrency utilities, such as the managed executor service, a scheduled variant, and a managed thread factory.

Furthermore, the first version of the WebSocket API was introduced. WebSockets allow full duplex communication between two peers.

Finally, the introduction of the JSON-P specification should not go unmentioned. It allows Java objects to be serialized to the JSON format, and vice versa. This has, with the rise of the RESTful API web services, become a pivotal specification of the Java EE platform.

Java EE 8

Java EE 8 was the final version of Java EE released by Oracle. The was a considerable amount of time between the release of Java EE version 7 and version 8 (4 years, 3 months, and 3 days to be exact). It was starting to become clear that Java EE was in demise at Oracle.

Nevertheless, this final version introduced some good functionality. Most of all, there was JAXB, the Java API for XML binding. Furthermore, annotation-based security was introduced with the Java Security EE API.

Summary

This chapter has given a short introduction to the history of Java EE up to version 8. After this version, Java EE was handed over to the Eclipse Foundation and was rebranded as Jakarta EE.

With this history in mind, you can now start your Jakarta EE journey. In the next chapter, we will introduce our example application to you, while in the following chapters, we will start migrating to a newer version of Jakarta EE.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore the cargo tracker application, an industry-relevant example that illustrates key Jakarta EE concepts and practices
  • Learn how to transition from Java EE to Jakarta EE to modernize your existing applications
  • Understand the benefits of cloud technologies and how to deploy a Jakarta EE application to the cloud
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Cloud-Native Development and Migration to Jakarta EE will help you unlock the secrets of Jakarta EE's evolution as you explore the migration and modernization of your applications. You’ll discover how to make your code compatible with the latest Jakarta EE version and how to leverage its modern features effectively. First, you’ll navigate the realm of cloud-native development as you demystify containers and get introduced to the Eclipse MicroProfile, a powerful tool in your toolkit. Next, you’ll take the bold step of transitioning your applications from local hardware to the limitless possibilities of the cloud. By following the author’s expert guidance to deploy your Jakarta EE applications on Microsoft Azure, you’ll gain hands-on experience in managing cloud resources. In the final leg of your journey, you’ll explore the world of serverless architecture. You’ll learn to design and run services that are truly serverless, harnessing the potential of the event-driven paradigm for scalability and cost-efficiency. By the end of this book, you’ll have mastered Jakarta EE and become a proficient cloud-native developer. Join us on this exciting journey of transformation and innovation as you pave the way for the future of Jakarta EE and cloud-native development.

Who is this book for?

This book is for developers working in small or large companies developing applications in Jakarta EE. If you're looking for a comprehensive guide that will provide you with all the tools and guidance needed to upgrade your existing applications, then this is the book for you. Intermediate-level knowledge and experience with Java EE 5/6/7/8 will help you get the most out of this book.

What you will learn

  • Explore the latest advancements in Jakarta EE and gain a thorough understanding of its core features and capabilities
  • Understand the principles and practices of designing and building cloud-native applications
  • Gain a detailed understanding of containers and Docker
  • Uncover how to embrace containers in your IT landscape
  • Move from your own hardware to managed hardware in the cloud
  • Discover how Kubernetes enhances scalability, resilience, and portability

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 31, 2023
Length: 198 pages
Edition : 1st
Language : English
ISBN-13 : 9781837630738
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 31, 2023
Length: 198 pages
Edition : 1st
Language : English
ISBN-13 : 9781837630738
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 102.97
Angular Projects
€31.99
Cloud-Native Development and Migration to Jakarta EE
€34.99
Full Stack Development with Spring Boot 3 and React
€35.99
Total 102.97 Stars icon
Banner background image

Table of Contents

15 Chapters
Part 1: History of Java EE and Jakarta EE Chevron down icon Chevron up icon
Chapter 1: The History of Enterprise Java Chevron down icon Chevron up icon
Chapter 2: Introducing the Cargo Tracker Application Chevron down icon Chevron up icon
Part 2: Modern Jakarta EE Chevron down icon Chevron up icon
Chapter 3: Moving from Java EE to Jakarta EE Chevron down icon Chevron up icon
Chapter 4: Modernizing Your Application with the Latest Features Chevron down icon Chevron up icon
Chapter 5: Making Your Application Testable Chevron down icon Chevron up icon
Part 3: Embracing the Cloud Chevron down icon Chevron up icon
Chapter 6: Introduction to Containers and Docker Chevron down icon Chevron up icon
Chapter 7: Meet Kubernetes Chevron down icon Chevron up icon
Chapter 8: What Is Cloud Native? Chevron down icon Chevron up icon
Chapter 9: Deploying Jakarta EE Applications in the Cloud Chevron down icon Chevron up icon
Chapter 10: Introducing MicroProfile Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
N/A Jul 19, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Feefo Verified review Feefo
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.