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
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
Paperback Oct 2023 198 pages 1st Edition
eBook
$9.99 $36.99
Paperback
$45.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Ron Veen Profile Icon David Vlijmincx
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
Paperback Oct 2023 198 pages 1st Edition
eBook
$9.99 $36.99
Paperback
$45.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$9.99 $36.99
Paperback
$45.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781837639625
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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
$279.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 $ 134.97
Angular Projects
$41.99
Cloud-Native Development and Migration to Jakarta EE
$45.99
Full Stack Development with Spring Boot 3 and React
$46.99
Total $ 134.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.