1 of 37

Jakarta EE 11 and Beyond

[Your name]

[Your title]

[Your contact information]

2 of 37

Jakarta EE

  • Java EE transitioned from JCP to Eclipse Foundation as Jakarta EE
  • Open governance, open source, open compatibility testing
  • Well-defined specification process, clear IP flow, vendor-neutral open collaboration, level playing field
  • Key stakeholders maintained if not expanded including Oracle, IBM, Payara, Tomitribe, Red Hat, Microsoft,

VMware, Alibaba, London Java Community, OmniFish, SouJava, Apache

  • Community participation and contribution key

3 of 37

The Importance of Jakarta EE

  • Jakarta EE is an important part of the Java ecosystem
  • 25-35% of Java applications run on Jakarta EE runtimes
    • WildFly, Payara, GlassFish, JBoss EAP, WebSphere/Liberty, WebLogic
  • 70-80% of Java applications depend on at least one or more Jakarta EE APIs
    • Tomcat, Hibernate, ActiveMQ, Jetty, Jersey, RESTEasy, Quarkus, MicroProfile, Spring Boot

4 of 37

Jakarta EE Evolution

JPE

J2EE 1.2

Servlet, JSP, EJB, JMS

J2EE 1.3

CMP, JCA

J2EE 1.4

JAX-WS

Java EE 5

EJB 3, JPA, JSF, JAXB, JAX-WS

Java EE 7

WebSocket, JSON, Concurrency, Batch, pruning

Java EE 8

HTTP/2, SSE, Security, pruning

Java EE 6

Profiles, CDI, JAX-RS, Bean Validation

Jakarta EE 8

Open-source governance

Jakarta EE 9.x

Namespace

transition

Jakarta EE 10

New features, updates

Jakarta EE 11

New APIs, features, updates

5 of 37

A Lively Ecosystem

6 of 37

Ambassadors’ Jakarta EE 11 Contribution Guide

7 of 37

Jakarta EE 10 in Context

  • CDI Alignment
    • @Asynchronous, @Schedule, @Lock, @MaxConcurrency in Concurrency, @MessageListener in Messaging, @RolesAllowed, @RunAs in Security
    • Better CDI support in Batch, REST
  • Java SE Alignment
    • CompletionStage in Concurrency
    • Bootstrap APIs for REST, Messaging
  • Closing standardization gaps
    • OpenID Connect, JWT, in-memory identity store, batch job definition Java API, @ManagedExecutorDefinition, more SQL support, multipart/form-data
    • Core/Microservices Profile
  • Deprecation/removal
    • EJB Entity Beans, embeddable EJB container, deprecated Servlet/Faces/CDI features
  • Innovation
    • Repositories, NoSQL, MVC, Configuration, gRPC

Made it! On the way Gap

8 of 37

Jakarta EE 11 in Context

  • CDI Alignment
    • @Schedule, @Lock, @MaxConcurrency in Concurrency, @MessageListener in Messaging, @RolesAllowed, @RunAs in Security
    • Better CDI support in REST, Persistence, Concurrency
  • Java SE Alignment
    • Adapting to Records, Virtual Threads
    • Bootstrap API for Messaging
    • Modularity, standalone/modernized TCKs
  • Closing standardization gaps
    • In-memory identity store, JWT, batch job definition Java API, @Service
  • Deprecation/removal
    • JAX-WS (SOAP), JAXB (XML), CORBA, @ManagedBean, EJB
  • Innovation
    • Repositories, NoSQL, MVC, Configuration, gRPC

Made it! On the way Gap

9 of 37

Jakarta EE 11 Themes

  • Q1 2025 target release date
  • Java SE 17/21 baseline, adapting to key changes
    • Records, Virtual Threads, Security Manager deprecation
  • Specification updates
    • Persistence, Concurrency, Security, CDI, Validation
  • New specifications
    • Data
  • Deprecation
    • JAX-WS (SOAP), JAXB (XML), CORBA, @ManagedBean
  • Modernized TCK

10 of 37

Jakarta EE 11 at a Glance

Platform

Web Profile

Core Profile

11 of 37

Jakarta Persistence

  • Support for Java SE Records as embeddable classes
  • Support for Instant, Year
  • Deprecate usage of Date, Time, Timestamp, @Temporal in favor of Date/Time API
  • More SQL-like features in QL and criteria API
    • concat (||), union, intersect, except, cast, left, right, replace
  • Thread-safe entity manager via @Inject
  • Java configuration as alternative to persistence.xml

  • Make persistence.xml optional/empty marker
  • JCache as a second-level cache provider

12 of 37

Embeddable Records

@Embeddable

public record Address (String street, String city,

String state, String zipCode) {

}

@Entity public class Person {

@Id private Long id;

private String firstName;

private String lastName;

@Embedded private Address address;

...

}

13 of 37

EntityManager via @Inject

<persistence>

<persistence-unit name="MyPU">

<jta-data-source>java:app/jdbc/MyDS</jta-data-source>

<scope>jakarta.transaction.TransactionScoped</scope>

@ApplicationScoped @Transactional

public class BookService {

@Inject EntityManager EntityManager;

14 of 37

Jakarta Concurrency

  • Adapting to Virtual Threads
    • Virtual Threads mostly implementation level concern for runtimes
  • CDI based, modernized equivalent for EJB @Schedule
  • @Inject support
  • Support for Flow API

  • CDI based, modernized equivalent for EJB @Lock
  • Adding @MaxConcurrency

15 of 37

Managed Virtual Threads

@ManagedExecutorDefinition(

name = "java:app/concurrent/MyExecutorService",

maxAsync = 5,

virtual = true

)

16 of 37

@Schedule in CDI Beans

@ApplicationScoped

public class UploadDirectoryScanner {

@Asynchronous(runAt = {

@Schedule(cron = "*/15 * * * * *")})

public CompletableFuture<Integer> processFiles(int mininumSize) {

...

if (normal) {

return null; // Continue schedule

}

return Asynchronous.Result.complete(reason); // Stop schedule

}

}

17 of 37

Jakarta Security

  • JWT alignment
    • MicroProfile bridge specification
    • Multiple authentication mechanisms
  • In-memory identity store

  • CDI based, modernized equivalent for @RolesAllowed, @RunAs

18 of 37

In-memory Identity Store

@InMemoryIdentityStoreDefinition({

@Credentials(callerName = "peter", password = "secret1",

groups = { "foo", "bar" }),

@Credentials(callerName = "john", password = “secret2",

groups = { "foo", "kaz" })

})

19 of 37

  • CDI based, modernized @MessageListener
  • Jakarta Messaging Lite for cloud native use cases
  • Standalone bootstrap API
  • AMQP interoperability

Jakarta Messaging

20 of 37

@MessageListener Example

@ApplicationScoped

@MaxConcurrency(10)

public class HandlingEventRegistrationAttemptConsumer {

@MessageListener(

destinationLookup="jms/HandlingEventRegistrationAttemptQueue",

selector="source = 'mobile'",

batchSize=10, orderBy=TIMESTAMP,

retry=5, retryDelay=7000, deadLetterQueue="jms/DeadLetterQueue")

public void onEventRegistrationAttempt(

HandlingEventRegistrationAttempt... attempts) {

...

}

}

21 of 37

Bootstrap API for Jakarta Messaging

JmsContainer container = JmsContainerFactory.newInstance();

...

JMSContext jmsContext = container.getJmsContext();

Destination handlingEventQueue = container.getDestination(

“jms/HandlingEventRegistrationAttemptQueue” true);

...

jmsContext.createProducer()

.setDisableMessageID(true)

.setDisableMessageTimestamp(true)

.setStringProperty("source", source)

.send(handlingEventQueue, attempt);

...

container.close();

22 of 37

  • Higher level (Repository pattern) data access abstraction like DeltaSpike Data, Spring Data
  • Automatically generated Repository implementations based on annotated interface
  • Both Jakarta Persistence and NoSQL

Jakarta Data

23 of 37

Jakarta Data Example

@Entity public class Product {

@Id private long id;

@Column @NotBlank private String name;

@Column @PositiveOrZero private float price;

@Repository public interface Products extends CrudRepository<Product, Long> {

@Asynchronous @OrderBy("price")

CompletableFuture<List<Product>> findByNameContains(String searchFor);

@Query(

"UPDATE Product o SET o.price = o.price - (?2 * o.price) WHERE o.id = ?1")

boolean discount(long productId, float discountRate);

}

24 of 37

  • Standard action-based web framework
    • Jakarta Faces continues to evolve separately
    • Standalone, “prospective specification” in Jakarta EE 11
  • Model
    • CDI, Validation
  • View
    • Facelets, Jakarta Server Pages
  • Controller
    • Based on Jakarta REST

Jakarta MVC

25 of 37

Jakarta MVC Example

@Controller

@Path("/")

@View("my-index.xhtml")

public class Bookstore {

@Inject private Models model;

@Inject private BookService service;

...

@GET

public void index() {

...

    model.put(“books”, books);

}

}

26 of 37

  • Specification for accessing NoSQL databases
  • Mapping/template API akin to Jakarta Persistence
  • API variants by NoSQL taxonomy
    • Key-value pair, column family, document, and graph
  • Repositories, validation, externalized configuration

Jakarta NoSQL

27 of 37

Jakarta NoSQL Example

@Entity public class Order {

@Id private long id;

@Column @NotBlank private String description;

@Column @NotEmpty private List<OrderLine> orderLines;

@Column @NotNull private Customer customer;

@Column @NotNull private Address address;

template.insert(order);

...

List<Order> results = template.select(Order.class)

.where("description").like("^Pinball").result();

logger.info("Found orders for pinball: " + results.size());

28 of 37

Jakarta Configuration

  •  Externalizing application configuration
  • Built-in stores
    • Property files, Java system properties, environment variables
  • Extensible stores
    • Kubernetes Secrets
    • Secure cloud storage (such as Azure Key Vault)
    • NoSQL stores (such as Azure Redis)
    • Relational database
  • @Inject into code
  • Reference in EL
  • Reference in XML
  • Moving MicroProfile Config to Jakarta EE

29 of 37

Jakarta Configuration Examples

@Inject

@ConfigProperty(name = “admin.group”, defaultValue=“admin”)

private String adminGroup;

persistence.provider=org.hibernate.ejb.HibernatePersistence

persistence.datasource=java:app/jdbc/CargoTrackerDatabase

persistence.schema.generation.database.action=create

<data-source>

<name>java:app/jdbc/CargoTrackerDatabase</name>

<class-name>org.apache.derby.jdbc.EmbeddedDriver</class-name>

<url>jdbc:derby:${temp.dir}/cargo-tracker-database</url>

</data-source>

30 of 37

Other Changes

  • Java SE Records support in Jakarta Validation, CDI, EL
  • @ManagedBean deprecated
  • Java SE SecurityManager dependency removed
  • @Priority on producers

  • Java SE Records support in JSON Binding
  • Replace Jakarta REST @Context by CDI/@Inject
    • Deprecate @Context
  • Java job definition API as alternative to XML in Jakarta Batch

31 of 37

Validating Records

public record Car(

@NotBlank String manufacturer,

@NotNull @Size(min = 2, max = 14) String licensePlate,

@Min(2) int seatCount) {

}

32 of 37

Job Definition API Example

Job job = new JobBuilder(jobName).property("jobk1", "J")

.listener("jobListener1", new String[]{"jobListenerk1",

"#{jobParameters['jobListenerPropVal']}"},

.step(new StepBuilder(stepName)

.properties(new String[]{"stepk1", "S"}, new String[]{"stepk2", "S"})

.batchlet(batchlet1Name, new String[]{"batchletk1", "B"},

new String[]{"batchletk2", "B"})

.listener("stepListener1", stepListenerProps)

.stopOn("STOP").restartFrom(stepName).exitStatus()

.endOn("END").exitStatus("new status for end")

.failOn("FAIL").exitStatus()

.nextOn("*").to(step2Name)

.build())

...

.build();

33 of 37

  • More custom websites for key Jakarta EE technologies
  • Jakarta EE Examples
    • Quickly getting working code for most use cases
  • Jakarta EE Tutorial
    • The official free resource to learn Jakarta EE
  • Jakarta Starter
    • Helping developers getting started quickly
  • Eclipse Cargo Tracker
    • End-to-end application demonstrating architectural practices like Domain-Driven Design

Beyond Specification Work

34 of 37

Ways of Contributing

  • Follow Jakarta EE technologies that interest you and share opinion
  • Advocate for a specific change or feature
    • https://jakarta.ee/projects/
  • Help implement a change in API, specification, TCK or implementation
    • Sign Eclipse Contributor Agreement
    • https://www.eclipse.org/legal/ECA.php
    • Becoming a committer comes much later
  • Engage an Ambassador if needed

35 of 37

Summary

  • Jakarta EE 11 almost here, has important changes
  • One of the key motivations to move Java EE to Jakarta EE is greater community contribution
  • Jakarta EE work is ongoing - time to get involved is now!

36 of 37

Resources

  • JakartaOne Livestream recordings
    • https://jakartaone.org
  • Jakarta EE Community mailing list
  • Jakarta EE X/Twitter handle
    • @JakartaEE
  • Jakarta Tech Talks

37 of 37