Skip to main content

Jakarta EE Community Update October 2020

by Tanja Obradovic at October 28, 2020 01:55 PM

This month’s Jakarta EE round-up includes news about the latest Jakarta EE 9-compatible product, Jakarta EE 9 specification status, JakartaOne Livestream and Jakarta EE Virtual Tour 2020 (and 2021!) dates, community calls, and more.

Keep reading to get all the details.

 

Another Jakarta EE 8 Compatible Product

Great news! The FUJITSU Software Enterprise Application Platform has achieved full platform compatibility with Jakarta EE 8. That is the 9th Jakarta EE 8 compatible product!!

For the complete list of Jakarta EE 8 platform and web profile compatible products, click here.

 

Encourage Developer Tool and Platform Providers to Migrate to the New Namespace

If you have a preferred developer tool vendor or a platform provider please consider asking them to migrate to the new Jakarta namespace so you can continue to use them with Jakarta EE 9 and beyond. Also, this is a great time to start planning migration of your enterprise applications to the new Jakarta namespace!

 To help vendors make the transition, the Jakarta EE community has developed a data sheet summarizing the namespace migration challenge and opportunity. You can download the data sheet here.

 

All but Five of the Jakarta EE 9 Specifications are in ballot!

As we get closer to the November 20 General Availability release date for Jakarta EE 9, here’s a summary of the latest status on specification approvals. Following the Jakarta EE Specification Process (JESP), we now have more than half of the specifications approved as Ratified Final Specification, 8 specifications are being voted on and we are about to start the ballot for 4 specifications. The only one still in waiting is the final Jakarta EE Specification, expected to be on the ballot at the end of next week! We are right on track for November 20th release.

Completed: 57 percent (or 20 specification)

Jakarta Concurrency
Jakarta Persistence
Jakarta Web Services Metadata
Jakarta Activation
Jakarta Bean Validation
Jakarta Dependency Injection
Jakarta Expression Language
Jakarta JSON Processing
Jakarta Servlet
Jakarta SOAP with Attachments
Jakarta Authentication
Jakarta Authorization
Jakarta Debugging Support for Other Language
Jakarta JSON Binding
Jakarta Mail
Jakarta Contexts and Dependency Injection (CDI)
Jakarta XML Web Services Specification
Jakarta Batch
Jakarta Security
Jakarta Server Faces

 

In the ballot process: 26 percent or 8 specifications

Jakarta Messaging
Jakarta WebSocket
Jakarta Server Pages
Jakarta XML Binding
Jakarta RESTful Web Services
Jakarta Transactions
Jakarta Connectors
Jakarta Standard Tag Library


About to start the ballot process: 14 percent or 4 specifications

Jakarta Interceptors
Jakarta Enterprise Beans
Jakarta Enterprise Web Services
Jakarta EE Web Profile

Updates in progress: 3 percent or 1 specification

Jakarta EE Platform


The chart below provides a visual summary of our progress.

______________________________

 

Register for JakartaOne Livestream Today

Be sure to reserve Tuesday, December 8, to attend JakartaOne Livestream. This year’s virtual event will include demos and interviews as well as a keynote address by Eclipse Foundation Executive Director, Mike Milinkovich.

The program committee is now reviewing the submitted papers — thanks to everyone who submitted — and you can expect to see the event details and program schedule in early November.

Register today to reserve your spot. JakartaOne Livestream is a great way to learn more about the technical benefits and architectural advances that become possible with cloud native Java, Jakarta EE, Eclipse MicroProfile, and Java EE technologies.

For live event updates, speaker announcements, news, and more, follow @JakartaOneConf on Twitter.

 

JakartaOne Livestream - Spanish: Watch the Replay

The JakartaOne Livestream Spanish event on October 12 was a huge success with 513 registered individuals so far. More than 300 people attended the live event and almost 200 more have watched the replay.

The event included a keynote address, vendor talks about compatible implementations by Red Hat, Tomitribe, Payara, and Oracle, and five technical talks.

To see the session topics, click here.

To watch the session replays, click here. Note that the sessions are delivered in Spanish.

 

Book Your Jakarta EE Virtual Tour

Jakarta EE Developer Advocate, Ivar Grimstad, and I (Tanja Obradovic) have started our Jakarta EE Virtual Tour, providing one-hour talks on Jakarta EE 9 and beyond to Java communities.

The current schedule for the Jakarta EE Virtual Tour is shown below, but there are still openings, and the tour will continue in 2021, so don’t hesitate to contact me (tanja.obradovic@eclipse-foundation.org) if you’d like us to present at your Java User Group (JUG) or Meetup event.

Upcoming Events

Eclipse Foundation staff and community members will be participating in a number of upcoming events related to Java and Jakarta EE. Here are brief summaries to help you choose the ones you want to attend.

Java Community Online Conference (JCON) 2020

·  Speaker: Gaël Blondelle, Managing Director, Eclipse Foundation Europe GmbH, and Vice President, Ecosystem Development at the Eclipse Foundation

·  Topic: Cloud Native Java at the Eclipse Foundation - Not your parents' Eclipse!

·  Date: Thursday October 29, 2020, 15:00-16:00 CET

Cloud Native Development Panel Discussion Meetup

·  Speakers: Niklas Heidloff from IBM and Rudy De Busscher from Payara with me (Tanja Obradovic) as moderator

·  Topic: All things cloud native

·  Date: Tuesday October 27, 2020, 17:00-18:00 GMT+1

KubeCon + CloudNativeCon North America

·  Speakers: The Eclipse Foundation will host a virtual community booth with cloud native Java experts on hand and community members who will participate in the booth chat session so be sure to visit us, meet community experts, and ask questions.

·  Topics: Live talks, demos, and Q&A sessions

·  Dates: November 17-20

 

Jakarta EE Community Calls

The Jakarta EE community hosted two calls in October. If you weren’t able to join the calls live, we’ve provided very brief summaries and links to the recordings below.

Jakarta EE Working Group Members’ Call

On October 6, the Jakarta EE Steering Committee hosted a call with Jakarta EE Working Group members to discuss the following topics:

·  Welcome Jakarta EE members: Will Lyons and David Blevins

·  Introduction of Jakarta EE Working Group committees: Will Lyons (Steering), Paul Buck (Specification), Neil Patterson (Marketing)

·  Jakarta EE to date: Will Lyons, Tanja Obradovic

·  Jakarta EE 9: Kevin Sutter

·  Opportunities and benefits for members: Tanja Obradovic

·  Jakarta EE Working Group experiences and how we can do better: Eric Meng, Ruslan Synytsky, Rob Tompkins, and others

Access the recording here.

Public Steering Committee Call

On October 13, Jakarta EE Steering Committee members provided the following updates during the J4K conference:

·  Jakarta EE 9: Kevin Sutter

·  JakartaOne Livestream 2020: Tanja Obradovic

·  Jakarta EE 10: Ivar Grimstad

Access the recording here.

Join Our Upcoming Calls

Jakarta EE community calls are open to everyone! For upcoming dates and connection details, see the Jakarta EE Community Calendar.

We know it’s not always possible to join calls in real time, so here are links to the recordings and presentations:

·  October call presentations

·  The complete playlist

 

Stay Connected With the Jakarta EE Community

The Jakarta EE community is very active and there are a number of channels to help you stay up to date with all of the latest and greatest news and information. Subscribe to your preferred channels today:

·  Social media: Twitter, Facebook, LinkedIn Group

·  Mailing lists: jakarta.ee-community@eclipse.org, jakarta.ee-wg@eclipse.org, project mailing lists

·  Newsletters, blogs, and emails: Eclipse newsletter, Jakarta EE blogs

·  Meetings: Jakarta Tech Talks, Jakarta EE Update, Jakarta Town Hall, and Eclipse Foundation events and conferences

You can find the complete list of channels here.

To help shape the future of open source, cloud native Java, get involved in the Jakarta EE Working Group.

To learn more about Jakarta EE-related plans and check the date for the next Jakarta Tech Talk, be sure to bookmark the Jakarta EE Community Calendar.

 


by Tanja Obradovic at October 28, 2020 01:55 PM

Community Chat with Markus Karg

by Ivar Grimstad at October 27, 2020 07:24 AM

Last week, I had a community chat with Markus Karg. We talked about community engagement in Jakarta EE and the upcoming Jakarta EE 9 release. Check out the entire chat below.

The Jakarta EE Community Chats is a series of short informal interviews in Studio Jakarta EE with members of the Jakarta EE community. Please contact me if you want to be a part of this series.


by Ivar Grimstad at October 27, 2020 07:24 AM

October Payara Roadmap Overview Webinar

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at October 26, 2020 10:57 AM

In this Roadmap Overview Webinar, Payara CEO Steve Millidge discusses the current Roadmap for Payara Platform, a retrospective on the last few months, what can be expected in upcoming releases and the latest news on Jakarta EE 9 and beyond. And even a few words on our not so secret, revolutionary project - Payara Cloud.


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at October 26, 2020 10:57 AM

2020 JCP EC Elections

by Ivar Grimstad at October 26, 2020 09:12 AM

The 2020 elections for the Java Community Process (JCP) Executive Committee (EC) have started. The ballot will be open for voting between November 3 and 16.

The Eclipse Foundation has been participating in the JCP Executive Committee since 2007 with the primary goal to represent the interests of the open-source community, and for independent implementations of Java specifications

I am happy to be announced as the candidate for the primary representative of the Eclipse Foundation in this election. I have previously served two periods as an individual holding an associate seat, as well as being the alternate for Eclipse Foundation the last year.

VOTE for the Open Source Community, VOTE for Eclipse Foundation!

Both Jakarta EE and MicroProfile are established as working groups within the Eclipse Foundation. Being a part of the JCP EC secures the important linkage between Java™ SE and the enterprise Java™ technologies. The move of AdoptOpenJDK to Eclipse Foundation and the establishment of the Adoptium working group makes Eclipse Foundation the biggest distributor of Java™ runtimes after Oracle.

Tune in to the “Meet the JCP EC Candidates” conference call on Thursday, October 29, 2020 at 10 AM PDT. Check the JCP elections website and follow @jcp_org on Twitter for announcements of how to join the call.


by Ivar Grimstad at October 26, 2020 09:12 AM

Java / Jakarta Messaging Service (JMS) on ...Microsoft Azure--airhacks.fm podcast

by admin at October 25, 2020 04:02 PM

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #111 airhacks.fm episode with Ashish Chhabria (@ashishc1) about:
algorithms, math in motion, passion with standards, JMS 2.0 on Microsoft's Azure Service Bus and JMS vs. Kafka
is available for download.

by admin at October 25, 2020 04:02 PM

Hashtag Jakarta EE #43

by Ivar Grimstad at October 25, 2020 10:59 AM

Welcome to the forty-third issue of Hashtag Jakarta EE!

Time for this week’s Jakarta EE 9 status. We now have twenty specifications approved and nine ballots ongoing. The remaining six are the Platform Specification and five specifications that depends on it.

The Platform Specification is the one with most work remaining, but I am confident that we will be able to finish it and get it on ballot before November 6 in order to be able to release the entire thing on November 20.

This week, we released Jakarta MVC 1.1. The compatible implementation used to verify the specification is Eclipse Krazo 1.1.0. With this release, Krazo graduated from incubation to be a mature Eclipse project! This is the first of the EE4J projects being graduated, with the exception of EclipseLink which has been around for a while.

The Jakarta EE Virtual Tour continues to grow and has expanded into 2021. Do contact us if you want your JUG/Meetup to be added to this list!


by Ivar Grimstad at October 25, 2020 10:59 AM

Guest on “Studio Jakarta EE”

by Markus Karg at October 24, 2020 12:49 PM

Yesterday I had the honour to be guest on the YouTube show Studio Jakarta EE, and had a nice chat with its host Ivar Grimstadt (Jakarta EE Developer Advocate at the Eclipse Foundation).


by Markus Karg at October 24, 2020 12:49 PM

Deploy Friday: E28 Language Spotlight: Java

by otaviojava at October 23, 2020 02:21 PM

This year marked 25 years since the first public alpha release of the Java programming language and platform. Java would become a key player in the years following that release as the Internet transitioned to become a mainstream phenomenon. After 25 years, will Java continue to shape the next 25 years? Join us and find […]

by otaviojava at October 23, 2020 02:21 PM

My first Computer – The Two Minutes Tuesday 009

by Markus Karg at October 20, 2020 09:00 PM

Hey guys!

I still know exactly how it felt when I used a computer for the first time. The Sinclair ZX Spectrum 48K changed my life, as it made me a code addict.

Even after more than 35 years, that fascinating little rubber-keyed machine has not lost any attraction to me.

CU!


by Markus Karg at October 20, 2020 09:00 PM

Notifier API Updated for Payara Server Community Edition

by Debbie Hoffman at October 20, 2020 10:00 AM

Previously, Payara Server did not offer a convenient way to add extensions. If you wanted to add an extension, you had to download the Payara Server code base, build the entire repository, write your own extension and module, and basically act as a developer. We’re working to create a simplified way to add extensions to Payara Server, starting with the Notifier API. 


by Debbie Hoffman at October 20, 2020 10:00 AM

Helidon 2.1.0 is released

by dmitrykornilov at October 19, 2020 07:33 PM

I am proud to announce the Helidon 2.1.0 release. It’s a new minor release which introduces new features such as MicroProfile 3.3 support, new FaultTolerance implementation and @HelidonTest annotation, as well as bug fixes and performance improvements. The new version is available in Maven Central. See the full list of changes in the release notes.

Microprofile 3.3

Supporting Microprofile is one of main project Helidon priorities. In version 2.1.0 we bring full MicroProfile 3.3 support. MicroProfile 3.3 contains updated versions of the following specifications:

  • Config 1.4
  • Fault Tolerance 2.1
  • Health 2.2
  • Metrics 2.3
  • Rest Client 1.4

It’s a minor release with no backwards incompatible changes.

New FaultTolerance implementation

In this release we also introduced a new Helidon SE Fault Tolerance feature. This not only provides Helidon SE users a fault tolerance implementation, but it also replaces Hystrix in Helidon’s MicroProfile Fault Tolerance implementation. This is important because Hystrix is no longer under active development. For more information see the Helidon SE Fault Tolerance documentation.

Simplified testing of Microprofile applications

Another interesting feature is new @HelidonTest annotation which simplifies testing of MicroProfile applications in JUnit 5 environment. This provides the lifecycle management of CDI and Helidon MicroProfile server, so your tests can focus on testing your application. Start with @HelidonTest annotation, and look for details in Testing Helidon.


by dmitrykornilov at October 19, 2020 07:33 PM

Java, Vaadin, Web and Vanilla Web Components--airhacks.fm podcast

by admin at October 19, 2020 02:08 PM

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

The #110 airhacks.fm episode with Alejandro Duarte (@alejandro_du) about:
programming games and the "Apocalypse 2040", C, Java, Enterprise Java, Vaadin, Vaadin Web Components and vanilla Web Components
is available for download.

by admin at October 19, 2020 02:08 PM

Joining Strings with Java 1.8+

by admin at October 18, 2020 03:51 PM

The static String's method join, introduced in Java 1.8, joins a String array with a passed separator:

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

public class StringJoinTest {
    @Test
    public void joinStrings() {
        var commaSeparated = String.join(",", "hello", "world");
        assertEquals("hello,world", commaSeparated);
    }
}    

by admin at October 18, 2020 03:51 PM

Hashtag Jakarta EE #42

by Ivar Grimstad at October 18, 2020 09:59 AM

Welcome to the forty-second issue of Hashtag Jakarta EE!

I have a confession to make. As one of the few, or maybe the only one in our industry, I have never read the book or seen the movie…

Anyway, 42 is the answer and this is issue number 42 of Hashtag Jakarta EE!

The status for Jakarta EE 9 this week is that fifteen specifications have passed the approval ballot, six are still in ballots that will close within the next two weeks. Eleven specifications are close to being ready for ballot. Many of these are depending on the Platform specification, so we will likely see specifications up for ballots like ketchup this week.

The one that is causing a little concern is the Jakarta Server Pages specification. If you’re involved in this specification, please help sort out the outstanding issues.

The schedule for the Jakarta EE Virtual Tour is shaping up. We are adding stops to the tour every day AND we are continuing the tour in 2021, so do contact us if you want us to present at YOUR JUG or Meetup.

The upcoming week is the week of EclipseCon 2020. The logo kind of shouts “ECLIPSE 2020 CON” to me, but be not mistaken, it is time for EclipseCon 2020 Virtual Event! This year’s edition is virtual and there are more than 2000 registered attendees. Make sure you reserve your spot for the sessions you would like to attend by building your schedule in the conference app.

And, you may relax, the Hitchhiker’s Guide to the Galaxy is now downloaded to my Kindle, so there is still hope for me:)


by Ivar Grimstad at October 18, 2020 09:59 AM

Monolithic to microservices: How design patterns help ensure migration success

by dmitrykornilov at October 17, 2020 06:09 PM

You’ve decided that migrating a monolith application to a microservice is the best approach to meet new application needs. Microservices are cloud native, scalable, and can be created in different languages for different services.

When you’re ready to migrate, you can use different strategies. Among the most common is the strangler pattern, often used with the anti-corruption layer pattern. Both design patterns deserve careful consideration.

Design patterns provide proven solutions

Why do you need to choose a design pattern when you’re migrating your monolith applications to microservices? Design patterns are general, proven, and well-known solutions for common application development problems. Experts recommend them and many people use them. These patterns are well-described, which makes them easy to understand.

Using design patterns help increase your microservice application quality and make it more supportable and better understandable by developers. Consider using design patterns as a best practice.

Why the strangler pattern remains the most popular

In the migration of monolith applications to microservices, the most used patterns are the strangler pattern with the anti-corruption layer pattern. As with all design patterns, they have many strong advantages, but none is perfect.

The main advantage of the strangler pattern is that it offers an incremental migration process without breaking the whole application functionality. It’s a more reasonable alternative to recreating the whole application from scratch.

Software development advisor Martin Fowler observed that microservices development often runs into problems. He noted the following points:

  • Almost all the successful microservice stories started with a monolith that got too big and was broken up.
  • Almost all the cases where I’ve heard of a system that was built as a microservice system from scratch have ended up in serious trouble.

The strangler pattern dates back to 2004 when Fowler was on a trip to Australia and observed the strangler fig trees:

They seed in the upper branches of a tree and gradually work their way down the tree until they root in the soil. Over many years they grow into fantastic and beautiful shapes, meanwhile strangling and killing the tree that was their host.

Applying the strangler pattern, we can think about newly created microservices as the strangler fig and the tree as the monolith. We start building microservices around the monolith until we cover all its functionality and eventually terminate the original monolith application. The process of breaking the monolith using the strangler pattern is also known as strangling the monolith.

With the strangler pattern, you define the independent functionality of your monolith and cut it off to the microservice. You have your monolith application working with one microservice. After that, you extract a second piece of your monolith the same way to another microservice, and you have your monolith with two microservices. You extract pieces until your monolith becomes a smaller microservice. It’s by far the most used pattern.

Making the microservice design independent of the monolith

The extracted microservice and the monolith are part of the bigger application and communicate with each other. Most likely, they use different domain models that are converted during the communication process. The process involves some glue code, which resides in the monolith, in the microservice, or on both sides. This code is called the anti-corruption layer.

In this case, anti-corruption means that the design solutions of the extracted microservice and the monolith don’t affect each other. In other words, the anti-corruption layer pattern is applicable to each extracted microservice and makes its design independent of the monolith design. You implement the anti-corruption layer. While extra work is needed, this choice enables you to extract a piece of functionality as a microservice. With the anti-corruption layer pattern, you take some code, extract it to a microservice, and design your monolith layer to allow you to work with that microservice.

Migrating Java EE-based monoliths to microservices–simplified

There’s a good chance your monolith application was built in Java. Java enterprise edition (Java EE), which is widely used for enterprise systems, was based on standards. One of the main advantages of standards are portability and backward compatibility. Java EE applications were portable between Java EE application servers’ solutions provided by different vendors.

Java EE is old, but not dead. It’s still developed and supported. In 2019, it was transferred to the Eclipse Foundation and got a new name: Jakarta EE. Now it’s truly an open source solution developed by the Java community and leading software vendors, such as Oracle, IBM, Red Hat, Payara, Tomitribe, and others, under an open specification process.

At the same time, there’s another modern standard solution for cloud native microservices called MicroProfile. It includes specifications that extend Jakarta EE functionality in better supporting clouds and microservices architecture, such as Config, HealthChecks, OpenTracing, and Metrics. MicroProflie is also the Eclipse Foundation project.

So, if your monolith is a Java EE or Jakarta EE application, it might make sense to use standards-based Java solution for your microservices, too. Your microservice has a similar design and use the same standard APIs, so you can copy some business logic to your microservices without serious modifications of the source code. In this case, I recommend using Helidon. Helidon is a modern Java microservices framework implementing MicroProfile and some well-known Jakarta EE components, such as JAX-RS, CDI, JPA, JSONP, and JSONB.

Still not sure migration is the right approach?

If you’re unsure whether migrating your monolithic application to microservices is the right strategy, read my earlier blog post, From Monolith to Microservice: When Should You Convert Your Java Applications? In this blog, I lay out the advantages and the drawbacks of microservices. This explanation can help you decide if a monolith-to-microservices migration is the best strategy for your specific application needs.


by dmitrykornilov at October 17, 2020 06:09 PM

Java API Enhancements

by Markus Karg at October 17, 2020 03:00 PM

Hey guys! How’s it going?

The Java SE API is enhanced in detail with each new generation of the JRE, besides the major JEPs lineup.

09: https://cr.openjdk.java.net/~iris/se/10/latestSpec/apidiffs/overview-summary.html

10: https://cr.openjdk.java.net/~iris/se/10/latestSpec/apidiffs/overview-summary.html

11: https://cr.openjdk.java.net/~iris/se/11/latestSpec/apidiffs/overview-summary.html

12: https://cr.openjdk.java.net/~iris/se/12/latestSpec/apidiffs/overview-summary.html

13: https://cr.openjdk.java.net/~iris/se/13/latestSpec/apidiffs/overview-summary.html

14: https://cr.openjdk.java.net/~iris/se/14/latestSpec/apidiffs/overview-summary.html

15: https://cr.openjdk.java.net/~iris/se/15/latestSpec/apidiffs/overview-summary.html

The Java Alamanc provides a brilliant diff view: https://javaalmanac.io/

Does it makes sense to look into the small details? This video explains how to easily detect ALL detail changes, and why it definitively makes sense to learn about them!

Stay save and… Party On!

 


by Markus Karg at October 17, 2020 03:00 PM

Extracting Fragments from JSON Documents with JSON-P

by admin at October 17, 2020 01:49 AM

With Jakarta JSON Processing API (JSON-P) available in all Jakarta EE and MicroProfile runtimes, you can parse a JSON object:

import static org.junit.jupiter.api.Assertions.assertEquals;

import static javax.json.Json.*;
import java.io.StringReader;
import javax.json.JsonObject;
import javax.json.JsonReader;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class JSONPPointerTest {

    JsonObject json;

    @BeforeEach
    public void init() {
        var raw = this.getJSON();
        try(JsonReader reader = createReader(new StringReader(raw))){
            this.json = reader.readObject();
        }
    }

    String getJSON() {
        return """
                {
                    "base": {
                        "cpu.systemLoadAverage": 4.14208984375,
                        "thread.count": 45,
                        "gc.time;name=G1 Young Generation": 16
                        },
                    "references":["MP metrics","JSON-P","rfc6901","Jakarta EE","microprofile"]
                }
                """;
    }
    
    
...and use a JSON Pointer (rfc6901) to extract values from nested objects:
            
    @Test
    public void extractValueFromObject() {
        var pointer = createPointer("/base/thread.count");
        var fragment = pointer.getValue(this.json);
        assertEquals(createValue(45), fragment);
    }
    
...as well as, JSON arrays:

    @Test
    public void extractValueFromArray() {
        var pointer = createPointer("/references/1");
        var fragment = pointer.getValue(this.json);
        assertEquals(createValue("JSON-P"), fragment);
    }

}    
    
The JSON-P implementation already ships with all Jakarta EE 8 / Java EE 8 / MicroProfile runtimes. The single, test-scoped, dependency is only required to run the Unit Tests:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.json</artifactId>
    <version>1.1.4</version>
    <scope>test</scope>
</dependency>
    

Also checkout: "Manipulating JsonObjects with JsonPatch"


by admin at October 17, 2020 01:49 AM

Eclipse Transformer Configuration Option with Jakarta EE 9 Milestone Release

by Gaurav Gupta at October 15, 2020 01:23 PM

The Eclipse Transformer tooling helps you transform existing Jakarta EE 8 binary to Jakarta EE 9. This is another step toward the full release of Jakarta EE 9. Payara Server Community Edition now includes a TECH PREVIEW of Jakarta EE 9 support to allow users to try out the new Jakarta EE 9 namespace and start experimenting and migrating applications in these early stages.

The Jakarta EE 9 3rd release candidate is available on Maven Central with the namespace changes in all of the Jakarta EE APIs and compatible implementations passing the standalone TCKs. Jakarta EE 9 will not be full of exciting new features, but this is an important milestone to drive forward and innovate the Jakarta EE 10 Platform in the cloud space.


by Gaurav Gupta at October 15, 2020 01:23 PM

JakartaONE Brazil 2020: Como alavancar microservices com TomEE e MicroProfile para ajudar a indústria médica no Brasil.

by Jean-Louis Monteiro at October 15, 2020 10:51 AM

No dia 29 de agosto, aconteceu o JakartaOne Livestream Brazil. Foi uma conferência virtual de um dia para desenvolvedores e líderes técnicos trazendo o estado atual e futuro de Jakarta EE e tecnologias relacionadas, com foco no desenvolvimento de aplicativos nativos em nuvem corporativa. A participação foi ótima, com cerca de 200 pessoas conectadas continuamente.
Nosso parceiro no Brasil, Rafael Guimares, CEO of GBR Sistemas, falou sobre como eles alavancaram microservices com TomEE para ajudar a indústria médica no Brasil. Graças à sua experiência, a equipe de Rafael foi capaz de construir rapidamente um novo aplicativo para suporte à telemedicina no contexto do Coronavírus (consulta e prescrição online) em apenas 5 dias para a primeira versão.

English

On August 29th, JakartaOne Livestream Brazil took place. It was a one-day virtual conference for developers and technical leaders bringing the current state and future of Jakarta EE and related technologies, focused on the enterprise cloud-native application development. The turnout was great, with around continuously 200 people connected.
With our partner in Brazil, Rafael Guimares, CEO of GBR Systems, we spoke about how we are leveraging microservices with Apache TomEE to help Brazil’s medical industry. Rafael also shared how, with his team, they are reusing the lessons learned to build an application that helps mitigate Covid-19 in Brazil quickly.

The post JakartaONE Brazil 2020: Como alavancar microservices com TomEE e MicroProfile para ajudar a indústria médica no Brasil. appeared first on Tomitribe.


by Jean-Louis Monteiro at October 15, 2020 10:51 AM

What's New in the Payara Platform October Release?

by Dominika Tasarz at October 14, 2020 01:00 PM

We're happy to announce that Payara Platform Community 5.2020.5 (direct download here) and Payara Platform Enterprise 5.22.0 (request here) Editions are out !

With this major release of Payara Platform Enterprise, we're introducing Payara InSight -  a new and improved version of the Community Edition's Monitoring Console. Enterprise Edition also features some tooling enhancements including IntelliJ support and NetBeans Community Tooling.

Meanwhile, the Payara Community Edition introduces support for the Jakarta EE 9 Platform as a Tech Preview feature and a major Notifier API Update.

Read more below to find out the details!


by Dominika Tasarz at October 14, 2020 01:00 PM

Hibernate & Testcontainers – A Perfect Match For Your Tests?

by Thorben Janssen at October 13, 2020 12:00 PM

The post Hibernate & Testcontainers – A Perfect Match For Your Tests? appeared first on Thorben Janssen.

When writing tests that rely on a database, you are facing 2 challenges: You need to write meaningful tests that ensure that your application works correctly. You need to provide a test database for each test run. I can’t help you with the 1st challenge. You know your application a lot better than I do, […]

The post Hibernate & Testcontainers – A Perfect Match For Your Tests? appeared first on Thorben Janssen.


by Thorben Janssen at October 13, 2020 12:00 PM

Startup Hook / Initialization Logic with CDI

by admin at October 13, 2020 05:01 AM

The Initialized qualifier is fired when a context is initialized, i.e. ready for use., and can be used to listen for the ApplicationScoped to be "ready".

Now you can use Initialized together with Observes to implement startup logic:


import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized;
import javax.enterprise.event.Observes;

@ApplicationScoped
public class InitializerOnStart {

    public void onStart(@Observes @Initialized(ApplicationScoped.class) Object pointless) {
        System.out.println("InitializerOnStart.onStart() ");
    }
}

...the same functionality with EJBs:


import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;

@Startup
@Singleton
public class InitializerOnStart {

    @PostConstruct
    public void onStart() { }
}
(EJB example used in: A Java EE 7+ Alternative To EJB Timers)

by admin at October 13, 2020 05:01 AM

JPA and "ORA-01795: maximum number of expressions in a list is 1000 error" workaround

October 12, 2020 09:00 PM

Oracle RDBMS has a known 1000 elements limitation on count of parameters for the IN clause.

SELECT * FROM TABLE WHERE ID IN (?,?,?.....?)

In case count of parameters more than 1000, - Oracle throws error: ORA-01795: maximum number of expressions in a list is 1000 error

Exists few ways to deal with it from the SQL point of view:

  • Split clause field IN (n1,...n9999) to portions like (field IN (n1...n999) or field IN (n1000...n1999)...)
  • Use temporary table to insert IDs and use sub select like field IN (select id from TMP_IDS)
  • Use tuples like where (id, 0) IN ((1, 0)...(n, 0))

Some data mapping frameworks provides solution for above by default, but unfortunately, Hibernate (most popular JPA provider) does not yet.

Fortunately, we can provide custom solution here by overriding EmptyInterceptor.onPrepareStatement(String sql) which is called when SQL string is being prepared and perform some String manipulation with the SQL.

First, we need for regular expression to find IN clause matches in the query. regex101.com provides great help here
pager

Now we are ready to implement interceptor:

public class SafeInInterceptor extends EmptyInterceptor {

    private final static Pattern pattern = Pattern.compile("[^\\s]+\\s+in\\s*\\(\\s*\\?[^\\(]*\\)", Pattern.CASE_INSENSITIVE);
    private final static int IN_CAUSE_LIMIT = 1000;

    @Override
    public String onPrepareStatement(String sql) {
        return super.onPrepareStatement(this.rewriteSqlToAvoidORA_01795(sql));
    }

    private String rewriteSqlToAvoidORA_01795(String sql) {
        Matcher matcher = pattern.matcher(sql);
        while (matcher.find()) {
            String inExpression = matcher.group();
            long countOfParameters = inExpression.chars().filter(ch -> ch == '?').count();

            if (countOfParameters <= IN_CAUSE_LIMIT) {
                continue;
            }

            String fieldName = inExpression.substring(0, inExpression.indexOf(' '));
            StringBuilder transformedInExpression = new StringBuilder(" ( ").append(fieldName).append(" in (");

            for (int i = 0; i < countOfParameters; i++) {
                if (i != 0 && i % IN_CAUSE_LIMIT == 0) {
                    transformedInExpression
                            .deleteCharAt(transformedInExpression.length() - 1)
                            .append(") or ").append(fieldName).append(" in (");
                }
                transformedInExpression.append("?,");
            }
            transformedInExpression.deleteCharAt(transformedInExpression.length() - 1).append("))");
            sql = sql.replaceFirst(Pattern.quote(inExpression), transformedInExpression.toString());
        }
        return sql;
    }
}

To enable interceptor, - add next property to the your persistence.xml

<property name="hibernate.ejb.interceptor" value="org.kostenko.example.jpa.dialect.SafeInInterceptor" />

Time to test:

@Test
public void transformSelectToSafeIn() throws Exception {
    EntityManager em = Persistence.createEntityManagerFactory("myDSTestOra").createEntityManager();

    List<Long> idsList = new ArrayList<>();
    for (int i = 0; i < 1199; i++) {
        idsList.add((long)i);
    }

    Query q =  
            em.createQuery("SELECT b FROM OraBlogEntity b WHERE b.id IN (:idsList)", OraBlogEntity.class)
            .setParameter("idsList", idsList);

    List<OraBlogEntity> blogEntitys = q.getResultList();
    System.out.println(blogEntitys.size());
}

Output:

Hibernate:select orablogent0_.id as id1_0_, orablogent0_.body as body2_0_, orablogent0_.title as title3_0_ from orablogentity orablogent0_
where  ( orablogent0_.id in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
or orablogent0_.id in (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?))

As you can see SQL was splited. No source code changes required and no ORA-01795 anymore.

Source code of described example as usual available on GitHub


October 12, 2020 09:00 PM

Community Chat with Edwin Derks

by Ivar Grimstad at October 12, 2020 03:58 PM

I had the pleasure of talking with Edwin Derks about Jakarta EE, MicroProfile, and engaging in the community. Check out the entire chat below.

The Jakarta EE Community Chats is a series of short informal interviews in Studio Jakarta EE with members of the Jakarta EE community. Please contact me if you want to be a part of this series.


by Ivar Grimstad at October 12, 2020 03:58 PM

Understanding Jakarta EE 9

by Jan at October 12, 2020 08:29 AM

Overview Java Enterprise Edition, or Java EE, is a set of standards defined to be used in an enterprise environment, implemented by a set of Java EE compatible application servers. Java Enterprise Edition or JEE (formerly Java 2 Enterprise Edition, … Continue reading

by Jan at October 12, 2020 08:29 AM

Head Crashing Comedy Special on Halloween with Live Chat

by Markus Karg at October 11, 2020 04:41 PM

Stay tuned for our Comedy Special on Halloween Premiere at 17:00 CET! In Epsiode 20 of Head Crashing Informatics on YouTube, you can join Leo and me preparing our Horror party night… Even better, Leo and me are present in the live chat on YouTube, so you can ask questions, give feedback, or just say hello!

Stay safe and… Party On!

Please support my work and become my patreon!


by Markus Karg at October 11, 2020 04:41 PM

Hashtag Jakarta EE #41

by Ivar Grimstad at October 11, 2020 12:13 PM

Welcome to the forty-first issue of Hashtag Jakarta EE!

The Jakarta EE 9 status pie for this week shows that we still have twelve ratified specifications. This is as expected since no ballots were scheduled to conclude this week. Of the nine ongoing ballots, four will close this week.

There are eleven specifications in the pipeline pretty close to being ready for ballot. Only three need a little more work. Two of these are the platform specifications which are expected to be the last up for a vote since they aggregate and sum up all the other specifications.

The Jakarta EE Virtual Tour is shaping up, but we still have room for more stops. We will also extend this tour to continue into 2021 to be able to meet as many as possible. So, don’t hesitate to reach out if you want to host us in your JUG or Meetup.

The Call-for-Paper for JakartaOne Livestream 2020 on December 8 has closed, and the program committee has started the job of finalizing the schedule.

The ballot for Jakarta MVC 1.1 will conclude on October 21. The status so far is that there are already enough votes for this specification to be ratified. In parallel, we have started the work on Jakarta MVC 2.0. This release will be featuring the new jakarta.mvc.* namespace.


by Ivar Grimstad at October 11, 2020 12:13 PM

What is new in Jersey 2.32

by Jan at October 10, 2020 03:24 PM

Recently, Jersey 2.32 has been released. Jersey 2.x is a continuous evolution of Jersey implementing JAX-RS 2.1 Specification. While the successor Jakarta Restful Web Services 3.0 Specification, which is part of the Jakarta EE 9 initiative, will bring a lot … Continue reading

by Jan at October 10, 2020 03:24 PM

WebLogic to to Payara Server Enterprise Migration Resources

by Debbie Hoffman at October 09, 2020 10:49 AM

Migrating from Oracle WebLogic to Payara Server Enterprise 5 is a fairly straightforward process because both servers rely on the Java EE specifications. We strive to make it as painless as possible with our migration resources and guides! 


by Debbie Hoffman at October 09, 2020 10:49 AM

Coding is a DRUG! – The Two Minutes Tuesday 008

by Markus Karg at October 06, 2020 09:00 PM

Hey guys!

Do you know that euphoria when you tried and tried and nothing worked out, but then your code suddenly works? Like the best day you every had in your life?

You immediately want to try out the next things, and you just cannot stop coding even after 12 hours of work? Welcome in the club of coding addicts!

CU!


by Markus Karg at October 06, 2020 09:00 PM

Native Queries with Spring Data JPA

by Thorben Janssen at October 06, 2020 12:00 PM

The post Native Queries with Spring Data JPA appeared first on Thorben Janssen.

Spring Data JPA supports various ways to retrieve data from your database. Some are very easy to use, like derived queries. Others provide great flexibility and enable you to read and transform the data in various ways, e.g., custom queries. Native queries are the extreme of the 2nd category. They are your most flexible and […]

The post Native Queries with Spring Data JPA appeared first on Thorben Janssen.


by Thorben Janssen at October 06, 2020 12:00 PM

The Payara Monthly Catch for September 2020

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at October 06, 2020 11:14 AM

 

The monthly catch came out slightly late this month, but it is chock a block full of content. With a slight emphasis on best practises, tips and plenty of video and podcast content!

In this blog you will find a curated list of some of the most interesting news, articles and videos from the last month. Can't wait until the end of the month? Visitour Twitter page where we post all these articles as we find them! 


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at October 06, 2020 11:14 AM

Hashtag Jakarta EE #40

by Ivar Grimstad at October 04, 2020 09:59 AM

Welcome to the fortieth issue of Hashtag Jakarta EE!

This week’s Jakarta EE 9 Specification Status shows some progress!

We now have twelve specifications approved and four ballots that started last week. There are thirteen that are close to being ready for ballots and only six that need a little more work. We’re getting there! Mark November 20 in your calendar! Read this status update from Kevin Sutter for more details.

This Jakarta EE Survey by Omnifaces covers a lot of relevant topics for Jakarta EE releases following Jakarta EE 9. Please do take some time and fill out the survey. Surveys like this provide extremely valuable input for the work on upcoming releases.

Tanja and I are going on a virtual tour talking about Jakarta EE. The first stop on the tour was India and we are currently planning stops in Poland, Serbia, Spain, Sweden and USA. Please reach out to us if you want us to present at your JUG/meetup.


by Ivar Grimstad at October 04, 2020 09:59 AM

Java Startup Performance

by Markus Karg at October 03, 2020 03:00 PM

Hey guys! How’s it going?

One of the major pain points even with the latest Java generation is its terribly slow startup time. There are things that you can do to improve it, so here is how to do them and how much they actually improve the situation!

Stay safe and… Party on!


by Markus Karg at October 03, 2020 03:00 PM

Jakarta EE JPA paging and COUNT(*) OVER()

October 01, 2020 09:00 PM

pager

Almost all data related applications and UI\UX practices need for paging. Jakarta EE JPA specification helps to do it on backend side by providing simple Query API:

  • setFirstResult(int startPosition) - Set the position of the first result to retrieve.
  • setMaxResults(int maxResult) - Set the maximum number of results to retrieve.

Typically, to implement paging with JPA you need for two queries: one to select page and second to select total count to calculate count of pages. It works well with simple queries and well described in many articles. But real world enterprise application often enough operates with complex queries with complex filters on big amount of data and unfortunately second query is not for free here from performance point of view.

Fortunately, since JPA 2.1 developers can use function() to call not standard DB functions. Let's play around it to use power of database window functions and JPA usability.

Actually, in case Hibernate JPA provider all we need is register our custom function for our custom dialect like:

public class MyOraDialect extends Oracle10gDialect {
    public MyOraDialect () {
        super();
        registerFunction("countover", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "count(*) over()"));
    }
}

and use dialect above in the our application persistence.xml:

  <property name="hibernate.dialect" value="org.kostenko.example.jpa.dialect.MyOraDialect"/>

Looks so easy, - time to test!

public class OraTest {
    @Test
    public void countOver() throws Exception {
        EntityManager em = Persistence.createEntityManagerFactory("myDSTestOra").createEntityManager();
        this.generateTestData(em);
        Query query =  em.createQuery("SELECT b as post, function('countover') as cnt FROM OraBlogEntity b", Tuple.class);
        query.setFirstResult(10);
        query.setMaxResults(5);
        List<Tuple> tpList = query.getResultList();
        for (Tuple tp : tpList) {
            System.out.println(tp.get("post"));
            System.out.println("Total:" + tp.get("cnt"));
        }
    }
    ...
}

Output:

Hibernate: select * from ( select row_.*, rownum rownum_ from ( select orablogent0_.id as col_0_0_, count(*) over() as col_1_0_, orablogent0_.id as id1_0_, orablogent0_.body as body2_0_, orablogent0_.title as title3_0_ from orablogentity orablogent0_ ) row_ where rownum <= ?) where rownum_ > ?
OraBlogEntity{id=151, title=title7, body=body7}
Total:3003
OraBlogEntity{id=152, title=title8, body=body8}
Total:3003
...

Please, note: count(*) over() construction is not supported by all RDBMS, but in turn supports by Oracle, Postgres, MSSQL Server and others.

Source code of described example as usual available on GitHub


October 01, 2020 09:00 PM

From Monolith to Microservice: When Should You Convert Your Java Applications?

by dmitrykornilov at October 01, 2020 08:25 PM

One major reason that many enterprises are thinking about migrating from monolith, on-premises applications to cloud native microservices is the cloud. The cloud provides many useful services, such as load balancers, monitoring and tracing tools, and auto-recovery—services that you’d have to implement and manage yourself if you didn’t use the cloud. Microservices are, in a way, designed for cloud, providing both scalability and portability. But should you convert your Java-based monolithic applications?

When Microservices Might Not Be the Answer

Choosing microservices involves trade-offs. Before making a choice to move your monolith application to microservices, developers need to understand that microservices architecture might not be a good fit for them.

Are You Building Netflix?

Scalability is one of the main advantages of using microservices. Each service can scale independent of other services, which makes them even more flexible. Often, the monolith application is created for a limited number of office users. In this case, using microservices could be an overhead. Even if scaling is required, it’s solvable by adding another cluster node to your application server.

Are You a Polyglot?

Another advantage of microservices is the ability to use different programming languages for different services. Sounds great, right? You can use a language that suits your business logic most effectively. But there are also a few drawbacks.

One is the financial consideration. Using multiple languages requires hiring developers with expertise in these languages. With high probability, these developers can’t support services written in languages other than the ones in which they have expertise. Developers capable of programming in different languages are more expensive. So, a higher budget is required.

Another reason against polyglot is the legacy code. Breaking a monolith written in Java EE to microservices written in Java is easier. They share a programming language, and you can copy some pieces of code to the new service without serious modifications. Rewriting these pieces in different programming languages is another story.

No More Shared Code, No More One Database

Usually, monolith applications are designed to work with a single database and share some code, such as data transfer objects and entities, among all its components. In microservices architecture, however, the best practice is to keep all services independent. They shouldn’t share any code and the database. Each microservice should use its own data storage, independent of other services. So, you should carefully redesign the database structure and the database application layer of your monolith to allow multiple-storage support without breaking the data consistency. In my opinion, you should place the most effort here.

Transactions May Become a Problem

If your application is in banking or another financial area, transactions can be one of the requirements. Java EE offers a solid support for transactions, and it’s not a problem for monolith applications. In microservices, the situation is different. Supporting distributed transactions between microservices is a more complicated task and requires more effort. It’s not as easy as adding @Transactional annotation and everything else is done by your application server behind the scenes. It’s not impossible, but it is more complicated. Use Saga Pattern or long-running actions (LRA).

Are You Ready for Microservices Dependency Hell?

The number of services you need to manage in applications designed using the microservices architecture is higher than in monoliths. If the number of dependencies is high, managing them can become difficult especially, too.

Testing May Become Problematic

It’s not a problem to test individual services. In fact, each service in microservices application is better tested than individual monolith components. On the other hand, integration testing becomes more difficult simply because application logic is now split between multiple services owned by different teams.

Another problem is unused code. It’s easy to detect it in a monolith. In microservices, it’s hard to say which API methods are used and which re obsolete. Teams should think about some tracing methods to detect it.

When the Decision Is Made

Now that you’re aware of the potential issues, and you know how to solve or avoid these problems, you are ready to break your monolith. Congratulations! I’d like to give you some advice.

Stick with One Programming Language, If Possible

Assuming that your monolith is written in Java, I recommend using Java for your microservices, too. As I mentioned, keeping the same language allow you to easily reuse some of your code, and the same teams who worked on the monolith can work on the new application. You don’t need to hire developers in other languages. However, it doesn’t make sense if some code is a perfect fit for another language.

Use Patterns

Some design patterns were developed to help with migration to microservices, such as Strangler Pattern and Anti-Corruption Layer Pattern. Explaining how they work is a topic for my next blog article.

Use Frameworks Designed for Microservices

Some modern Java frameworks are designed for developing microservices, such as Helidon, Quarkus, and Micronaut. All of them can produce applications with a small footprint, small memory consumption, and fast start-up time. These parameters are the most important for cloud native services. All of those three frameworks are also capable of building GraalVM native image out of your application. Native images are OS-dependent binaries that can be natively executed. It means that your application will start-up almost instantly and memory consumption will be minimal.

There’s a trade-off in GraalVM. If you use Java Hotspot VM, it knows about the runtime environment and can optimize your code based on the environment. It’s not immediate, but eventually, it can become even faster than the executable code compiled using GraalVM.

So, if your monolith is written using Spring, use Spring Boot for your microservices. If it’s a Java EE application, use Helidon MP because it provides the best compatibility options. It also supports MicroProfile, a modern collection of open source specifications designed to build cloud native services. MicroProfile is hosted at Eclipse Foundation and supported by many vendors, including IBM, Red Hat, Oracle, and others.

A Final Note

If your application doesn’t require it, you don’t need to go the microservices route. However, if it makes sense to convert your existing Java applications to microservices, look for tools that can help make that conversion faster and easier.


by dmitrykornilov at October 01, 2020 08:25 PM

Celebrating One Year as Jakarta EE Developer Advocate

by Ivar Grimstad at October 01, 2020 09:59 AM

Today is exactly one year since I started as the Jakarta EE Developer Advocate at the Eclipse Foundation.

It started out as expected, with a lot of speaking engagement at developer conferences around the World as well as an increased online presence and activity in the community.

Then Covid-19 hit us and everything went virtual. After a period of panic, I think we as a community have adjusted pretty well. I guess that the industry we are in was pretty well equipped to go virtual, thus the community can continue being vibrant and active. But I do miss being on the road and meeting you all out there! Virtual conferences and meetups are all good, but cannot replace the real deal.

As a full-time developer advocate, there is more time for blogging, so I have been able to produce more blog posts this year than ever before. One thing I am especially proud of is the Hashtag Jakarta EE blog series that I started. I hadn’t expected that I would be able to keep up with a weekly cadence, but it has turned out to be enough content being produced out there to keep that going. Please ping me if you want your pet project to be mentioned in one of the upcoming posts.

I also started the Studio Jakarta EE YouTube channel. This channel is a complement to the official Jakarta EE channel. The idea behind Studio Jakarta EE is to have a place for more informal content, such as interviews, chats, small tech tips, and such.

This was just a small peek into what I have been up to. There is plenty of more, but I will stop here to keep this blog post from being too long. In summary, it has been an amazing year, and I look forward to the years to come!


by Ivar Grimstad at October 01, 2020 09:59 AM

JPA @ManyToOne. Keep separate reference by ID and by Entity

September 30, 2020 09:00 PM

Some time you may need to keep reference by class and reference by ID for your JPA @Entity. It can be very helpful, for example, to do some default JSON serialization with no risk to stuck with well known N+1 issue. In this case i would like to avoid @OneToMany and @ManyToOne fields serialization by default and use ID reference instead.

So, below is simple example how to do above.

@Entity
@Table(name = "book")
public class Book {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    @Column(name = "name")
    private String name;

    @JoinColumn(name = "author", insertable = false, updatable = false)
    @ManyToOne(targetEntity = Author.class, fetch = FetchType.LAZY)
    private Author author;

    @Column(name = "author")
    private long authorId;
    ...
    public void setAuthor(Author author) {
        setAuthorId(author.getId());
        this.author = author;
    }
    ...
}

Testing time:

public class ManyToOneTest {
    @Test
    public void relationManyToOneTest() {
        EntityManager em = Persistence.createEntityManagerFactory("myDSTest").createEntityManager();
        this.generateTestData(em);

        List <Book> books =em.createQuery("FROM Book", Book.class).getResultList();
        // lazy loading test
        for (Book b : books) {
            System.out.println("Bookd:" + b.getName());
            System.out.println("AuthorId:" + b.getAuthorId());
            // lazy load
            System.out.println("Author:" + b.getAuthor());
        }
        // JPQL with direct id reference
        books = em.createQuery("FROM Book where authorId = 1", Book.class).getResultList();
        // JPQL with author.id reference
        books = em.createQuery("FROM Book where author.id = 1", Book.class).getResultList();
    }

    private void generateTestData(EntityManager em) {
        em.getTransaction().begin();

        Author author = new Author();
        author.setName("A Name");
        em.persist(author);

        Book book = new Book();
        book.setName("Book Name");
        book.setAuthorId(author.getId());
        //book.setAuthor(author);
        em.persist(book);
        em.getTransaction().commit();
        em.clear();
    }
}

Test Output:

...
Hibernate: select book0_.id as id1_2_, book0_.author as author2_2_, book0_.name as name3_2_ from book book0_
Bookd:Book Name
AuthorId:1
# call book.getAuthor():
Hibernate: select author0_.id as id1_0_0_, author0_.name as name2_0_0_ from author author0_ where author0_.id=?
Author:Author{id=1, name=A Name}

PS: book.getAuthor().getId() will not trigger Author lazy loading, but book.getAuthor().getName() will.

Source code of described application available on GitHub


September 30, 2020 09:00 PM

Simple trick to reload application on Tomcat

September 29, 2020 09:00 PM

Reload tomcat application without accessing to manager console you can just by touch

cd tomcat/webapps/<application>/WEB-INF/
touch web.xml

The trick above will work on other application servers with "hot deploy" support.


September 29, 2020 09:00 PM

Introduction to MapStruct: An Easy and Fast Mapping at Compile Time

by otaviojava at September 29, 2020 04:55 PM

MapStruct: easy mappings between Java beans https://dzone.com/articles/map-struct-jakarta-ee-cloud

by otaviojava at September 29, 2020 04:55 PM

Migrating from Hibernate’s to JPA’s Criteria API

by Thorben Janssen at September 29, 2020 02:49 PM

The post Migrating from Hibernate’s to JPA’s Criteria API appeared first on Thorben Janssen.

As shown in my previous post, Hibernate offers several APIs to query data from the database. If you want to define your query dynamically at runtime, you can use JPA’s Criteria API. In the past, Hibernate also offered its own proprietary Criteria API. It has been deprecated in Hibernate 5, and you should avoid it […]

The post Migrating from Hibernate’s to JPA’s Criteria API appeared first on Thorben Janssen.


by Thorben Janssen at September 29, 2020 02:49 PM

Jakarta EE Talks at EclipseCon 2020

by Ivar Grimstad at September 29, 2020 09:59 AM

You don’t want to miss these Jakarta EE talks at EclipseCon 2020. You may also want to check out the talks in the Cloud Native Java category. Visit the event site for full information about the talks and the speakers.

This year’s EclipseCon is a free, virtual event.

Please register now to reserve your spot!

Follow @EclipseCon on Twitter
Use #EclipseCon on social media


by Ivar Grimstad at September 29, 2020 09:59 AM

Hashtag Jakarta EE #39

by Ivar Grimstad at September 27, 2020 09:59 AM

Welcome to the thirty-ninth issue of Hashtag Jakarta EE!

Here is this week’s Jakarta EE 9 Specification Status.

Since there were no ballots that closed this week, there are still ten approved and two ballots ongoing. These two will end on Tuesday. Eight specifications are almost ready for their ballot, so that’s an increase since last week.

Nine specifications need some more work before they are ready, and there is only one specification that hasn’t created a Pull Request yet:

Jakarta Server Pages

The call-for-paper for JakartaOne LiveStream ends on Wednesday, October 1st. If you haven’t submitted yet, now is the time!

Another event coming up with a lot of Jakarta EE content is EclipseCon 2020. Do register now to reserve your place!

This week, we staged the MVC 1.1.0 API in preparation for our first release as a Jakarta EE specification. The next steps are to stage the TCK and file a certification request for Eclipse Krazo. More to come.


by Ivar Grimstad at September 27, 2020 09:59 AM

Payara Platform October 2020 Roadmap Update

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at September 24, 2020 09:51 AM

We'd like to invite you to join us for the Payara Platform October 2020 Roadmap Update on Thursday, Oct 22, 2020 03:00 PM BST / 10:00 AM EST.


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at September 24, 2020 09:51 AM

General considerations on updating Enterprise Java projects from Java 8 to Java 11

September 23, 2020 12:00 AM

shell11

The purpose of this article is to consolidate all difficulties and solutions that I've encountered while updating Java EE projects from Java 8 to Java 11 (and beyond). It's a known fact that Java 11 has a lot of new characteristics that are revolutionizing how Java is used to create applications, despite being problematic under certain conditions.

This article is focused on Java/Jakarta EE but it could be used as basis for other enterprise Java frameworks and libraries migrations.

Is it possible to update Java EE/MicroProfile projects from Java 8 to Java 11?

Yes, absolutely. My team has been able to bump at least two mature enterprise applications with more than three years in development, being:

A Management Information System (MIS)

Nabenik MIS

  • Time for migration: 1 week
  • Modules: 9 EJB, 1 WAR, 1 EAR
  • Classes: 671 and counting
  • Code lines: 39480
  • Project's beginning: 2014
  • Original platform: Java 7, Wildfly 8, Java EE 7
  • Current platform: Java 11, Wildfly 17, Jakarta EE 8, MicroProfile 3.0
  • Web client: Angular

Mobile POS and Geo-fence

Medmigo REP

  • Time for migration: 3 week
  • Modules: 5 WAR/MicroServices
  • Classes: 348 and counting
  • Code lines: 17160
  • Project's beginning: 2017
  • Original platform: Java 8, Glassfish 4, Java EE 7
  • Current platform: Java 11, Payara (Micro) 5, Jakarta EE 8, MicroProfile 3.2
  • Web client: Angular

Why should I ever consider migrating to Java 11?

As everything in IT the answer is "It depends . . .". However there are a couple of good reasons to do it:

  1. Reduce attack surface by updating project dependencies proactively
  2. Reduce technical debt and most importantly, prepare your project for the new and dynamic Java world
  3. Take advantage of performance improvements on new JVM versions
  4. Take advantage from improvements of Java as programming language
  5. Sleep better by having a more secure, efficient and quality product

Why Java updates from Java 8 to Java 11 are considered difficult?

From my experience with many teams, because of this:

Changes in Java release cadence

Java Release Cadence

Currently, there are two big branches in JVMs release model:

  • Java LTS: With a fixed lifetime (3 years) for long term support, being Java 11 the latest one
  • Java current: A fast-paced Java version that is available every 6 months over a predictable calendar, being Java 15 the latest (at least at the time of publishing for this article)

The rationale behind this decision is that Java needed dynamism in providing new characteristics to the language, API and JVM, which I really agree.

Nevertheless, it is a know fact that most enterprise frameworks seek and use Java for stability. Consequently, most of these frameworks target Java 11 as "certified" Java Virtual Machine for deployments.

Usage of internal APIs

Java 9

Errata: I fixed and simplified this section following an interesting discussion on reddit :)

Java 9 introduced changes in internal classes that weren't meant for usage outside JVM, preventing/breaking the functionality of popular libraries that made use of these internals -e.g. Hibernate, ASM, Hazelcast- to gain performance.

Hence to avoid it, internal APIs in JDK 9 are inaccessible at compile time (but accesible with --add-exports), remaining accessible if they were in JDK 8 but in a future release they will become inaccessible, in the long run this change will reduce the costs borne by the maintainers of the JDK itself and by the maintainers of libraries and applications that, knowingly or not, make use of these internal APIs.

Finally, during the introduction of JEP-260 internal APIs were classified as critical and non-critical, consequently critical internal APIs for which replacements are introduced in JDK 9 are deprecated in JDK 9 and will be either encapsulated or removed in a future release.

However, you are inside the danger zone if:

  1. Your project compiles against dependencies pre-Java 9 depending on critical internals
  2. You bundle dependencies pre-Java 9 depending on critical internals
  3. You run your applications over a runtime -e.g. Application Servers- that include pre Java 9 transitive dependencies

Any of these situations means that your application has a probability of not being compatible with JVMs above Java 8. At least not without updating your dependencies, which also could uncover breaking changes in library APIs creating mandatory refactors.

Removal of CORBA and Java EE modules from OpenJDK

JEP230

Also during Java 9 release, many Java EE and CORBA modules were marked as deprecated, being effectively removed at Java 11, specifically:

  • java.xml.ws (JAX-WS, plus the related technologies SAAJ and Web Services Metadata)
  • java.xml.bind (JAXB)
  • java.activation (JAF)
  • java.xml.ws.annotation (Common Annotations)
  • java.corba (CORBA)
  • java.transaction (JTA)
  • java.se.ee (Aggregator module for the six modules above)
  • jdk.xml.ws (Tools for JAX-WS)
  • jdk.xml.bind (Tools for JAXB)

As JEP-320 states, many of these modules were included in Java 6 as a convenience to generate/support SOAP Web Services. But these modules eventually took off as independent projects already available at Maven Central. Therefore it is necessary to include these as dependencies if our project implements services with JAX-WS and/or depends on any library/utility that was included previously.

IDEs and application servers

Eclipse

In the same way as libraries, Java IDEs had to catch-up with the introduction of Java 9 at least in three levels:

  1. IDEs as Java programs should be compatible with Java Modules
  2. IDEs should support new Java versions as programming language -i.e. Incremental compilation, linting, text analysis, modules-
  3. IDEs are also basis for an ecosystem of plugins that are developed independently. Hence if plugins have any transitive dependency with issues over JPMS, these also have to be updated

Overall, none of the Java IDEs guaranteed that plugins will work in JVMs above Java 8. Therefore you could possibly run your IDE over Java 11 but a legacy/deprecated plugin could prevent you to run your application.

How do I update?

You must notice that Java 9 launched three years ago, hence the situations previously described are mostly covered. However you should do the following verifications and actions to prevent failures in the process:

  1. Verify server compatibility
  2. Verify if you need a specific JVM due support contracts and conditions
  3. Configure your development environment to support multiple JVMs during the migration process
  4. Verify your IDE compatibility and update
  5. Update Maven and Maven projects
  6. Update dependencies
  7. Include Java/Jakarta EE dependencies
  8. Execute multiple JVMs in production

Verify server compatibility

Tomcat

Mike Luikides from O'Reilly affirms that there are two types of programmers. In one hand we have the low level programmers that create tools as libraries or frameworks, and on the other hand we have developers that use these tools to create experience, products and services.

Java Enterprise is mostly on the second hand, the "productive world" resting in giant's shoulders. That's why you should check first if your runtime or framework already has a version compatible with Java 11, and also if you have the time/decision power to proceed with an update. If not, any other action from this point is useless.

The good news is that most of the popular servers in enterprise Java world are already compatible, like:

If you happen to depend on non compatible runtimes, this is where the road ends unless you support the maintainer to update it.

Verify if you need an specific JVM

FixesJDK15

On a non-technical side, under support contract conditions you could be obligated to use an specific JVM version.

OpenJDK by itself is an open source project receiving contributions from many companies (being Oracle the most active contributor), but nothing prevents any other company to compile, pack and TCK other JVM distribution as demonstrated by Amazon Correto, Azul Zulu, Liberica JDK, etc.

In short, there is software that technically could run over any JVM distribution and version, but the support contract will ask you for a particular version. For instance:

Configure your development environment to support multiple JDKs

Since the jump from Java 8 to Java 11 is mostly an experimentation process, it is a good idea to install multiple JVMs on the development computer, being SDKMan and jEnv the common options:

SDKMan

sdkman

SDKMan is available for Unix-Like environments (Linux, Mac OS, Cygwin, BSD) and as the name suggests, acts as a Java tools package manager.

It helps to install and manage JVM ecosystem tools -e.g. Maven, Gradle, Leiningen- and also multiple JDK installations from different providers.

jEnv

jenv

Also available for Unix-Like environments (Linux, Mac OS, Cygwin, BSD), jEnv is basically a script to manage and switch multiple JVM installations per system, user and shell.

If you happen to install JDKs from different sources -e.g Homebrew, Linux Repo, Oracle Technology Network- it is a good choice.

Finally, if you use Windows the common alternative is to automate the switch using .bat files however I would appreciate any other suggestion since I don't use Windows so often.

Verify your IDE compatibility and update

Please remember that any IDE ecosystem is composed by three levels:

  1. The IDE acting as platform
  2. Programming language support
  3. Plugins to support tools and libraries

After updating your IDE, you should also verify if all of the plugins that make part of your development cycle work fine under Java 11.

Update Maven and Maven projects

maven

Probably the most common choice in Enterprise Java is Maven, and many IDEs use it under the hood or explicitly. Hence, you should update it.

Besides installation, please remember that Maven has a modular architecture and Maven modules version could be forced on any project definition. So, as rule of thumb you should also update these modules in your projects to the latest stable version.

To verify this quickly, you could use versions-maven-plugin:

<plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>versions-maven-plugin</artifactId>
      <version>2.8.1</version>
</plugin>

Which includes a specific goal to verify Maven plugins versions:

mvn versions:display-plugin-updates

mavenversions

After that, you also need to configure Java source and target compatibility, generally this is achieved in two points.

As properties:

<properties>
        ...
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>

As configuration on Maven plugins, specially in maven-compiler-plugin:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
        <release>11</release>
    </configuration>
</plugin>

Finally, some plugins need to "break" the barriers imposed by Java Modules and Java Platform Teams knows about it. Hence JVM has an argument called illegal-access to allow this, at least during Java 11.

This could be a good idea in plugins like surefire and failsafe which also invoke runtimes that depend on this flag (like Arquillian tests):

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.0</version>
    <configuration>
        <argLine>
            --illegal-access=permit
        </argLine>
    </configuration>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.22.0</version>
    <configuration>
        <argLine>
            --illegal-access=permit
        </argLine>
    </configuration>
</plugin>

Update project dependencies

As mentioned before, you need to check for compatible versions on your Java dependencies. Sometimes these libraries could introduce breaking changes on each major version -e.g. Flyway- and you should consider a time to refactor this changes.

Again, if you use Maven versions-maven-plugin has a goal to verify dependencies version. The plugin will inform you about available updates.:

mvn versions:display-dependency-updates

mavendependency

In the particular case of Java EE, you already have an advantage. If you depend only on APIs -e.g. Java EE, MicroProfile- and not particular implementations, many of these issues are already solved for you.

Include Java/Jakarta EE dependencies

jakarta

Probably modern REST based services won't need this, however in projects with heavy usage of SOAP and XML marshalling is mandatory to include the Java EE modules removed on Java 11. Otherwise your project won't compile and run.

You must include as dependency:

  • API definition
  • Reference Implementation (if needed)

At this point is also a good idea to evaluate if you could move to Jakarta EE, the evolution of Java EE under Eclipse Foundation.

Jakarta EE 8 is practically Java EE 8 with another name, but it retains package and features compatibility, most of application servers are in the process or already have Jakarta EE certified implementations:

We could swap the Java EE API:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>8.0.1</version>
    <scope>provided</scope>
</dependency>

For Jakarta EE API:

<dependency>
    <groupId>jakarta.platform</groupId>
    <artifactId>jakarta.jakartaee-api</artifactId>
    <version>8.0.0</version>
    <scope>provided</scope>
</dependency>

After that, please include any of these dependencies (if needed):

Java Beans Activation

Java EE

<dependency>
    <groupId>javax.activation</groupId>
    <artifactId>javax.activation-api</artifactId>
    <version>1.2.0</version>
</dependency>

Jakarta EE

<dependency>
    <groupId>jakarta.activation</groupId>
    <artifactId>jakarta.activation-api</artifactId>
    <version>1.2.2</version>
</dependency>

JAXB (Java XML Binding)

Java EE

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.1</version>
</dependency>

Jakarta EE

<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>2.3.3</version>
</dependency>

Implementation

<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.3</version>
</dependency>

JAX-WS

Java EE

<dependency>
    <groupId>javax.xml.ws</groupId>
    <artifactId>jaxws-api</artifactId>
    <version>2.3.1</version>
</dependency>

Jakarta EE

<dependency>
    <groupId>jakarta.xml.ws</groupId>
    <artifactId>jakarta.xml.ws-api</artifactId>
    <version>2.3.3</version>
</dependency>

Implementation (runtime)

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.3.3</version>
</dependency>

Implementation (standalone)

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-ri</artifactId>
    <version>2.3.2-1</version>
    <type>pom</type>
</dependency>

Java Annotation

Java EE

<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

Jakarta EE

<dependency>
    <groupId>jakarta.annotation</groupId>
    <artifactId>jakarta.annotation-api</artifactId>
    <version>1.3.5</version>
</dependency>

Java Transaction

Java EE

<dependency>
    <groupId>javax.transaction</groupId>
    <artifactId>javax.transaction-api</artifactId>
    <version>1.3</version>
</dependency>

Jakarta EE

<dependency>
    <groupId>jakarta.transaction</groupId>
    <artifactId>jakarta.transaction-api</artifactId>
    <version>1.3.3</version>
</dependency>

CORBA

In the particular case of CORBA, I'm aware of its adoption. There is an independent project in eclipse to support CORBA, based on Glassfish CORBA, but this should be investigated further.

Multiple JVMs in production

If everything compiles, tests and executes. You did a successful migration.

Some deployments/environments run multiple application servers over the same Linux installation. If this is your case it is a good idea to install multiple JVMs to allow stepped migrations instead of big bang.

For instance, RHEL based distributions like CentOS, Oracle Linux or Fedora include various JVM versions:

olinux

Most importantly, If you install JVMs outside directly from RPMs(like Oracle HotSpot), Java alternatives will give you support:

hotspot

However on modern deployments probably would be better to use Docker, specially on Windows which also needs .bat script to automate this task. Most of the JVM distributions are also available on Docker Hub:

dockerjava


September 23, 2020 12:00 AM

You need local named classes! – The Two Minutes Tuesday 007

by Markus Karg at September 22, 2020 09:00 PM

Hey guys!

Local named classes are actually valuable, and this video tells you why.

Thank you, Michael Simons, for sending your solution to the question I asked in episode 003 (https://youtu.be/HDjEcV1X4jI)!

CU!


by Markus Karg at September 22, 2020 09:00 PM

5 Talks Java Developers Won’t Want to Miss at EclipseCon 2020

by Tanja Obradovic at September 22, 2020 12:57 PM

Java is a major technology focus area for many members of the Eclipse community, and EclipseCon is always a great opportunity to expand and deepen your knowledge in this space. Last year’s EclipseCon featured about 20 Java-related sessions, and they’ve been popular YouTube replays.

This year’s EclipseCon features another great lineup of Java-related sessions, including talks on Jakarta EE, Eclipse MicroProfile, and Java Development Tools (JDT). To help you plan your EclipseCon 2020 experience, here are brief summaries of five talks you won’t want to miss:

·      Boost your APIs With GraphQL. GraphQL is an open source API query language originally developed by Facebook. Jean-François James will explain how GraphQL relates to REST and how it can be used. To demonstrate the potential, Jean-François will show you an Eclipse MicroProfile GraphQL project.

·      What's New in Java? With its six-month release cycle and preview features, Java evolves at a rapid pace. Manoj Palat will explore Java 14 and Java 15 features, including switch expressions, records, text blocks, pattern InstanceOf, and sealed types to help you understand how and when to use them. Manoj will also review features in upcoming Java releases

·      What's New in JDT? Since last year’s EclipseCon, there have been four Eclipse JDT releases. Jeff Johnston will take you through new JDT features, focusing on those that aren’t part of supporting new Java language features. You’ll learn about new cleanup and quick fixes, enhanced completion support, formatting, and debug enhancements. Jeff will also provide live demos of the features and share related code samples.

·      AdoptOpenJDK — Making Java Free Again. With more than 140 million downloads in the last year, AdoptOpenJDK is a serious contender for production use of Java. Hendrik Eggers and George Adams will explain how they use AdoptOpenJDK to build on more than 15 different platforms, execute more than 87 million tests, and distribute OpenJDK binaries to millions of users. They’ll also explain how AdoptOpenJDK binaries compare to the Java binaries you use today.

·      Make your Microservices as Robust as Mission-Critical Systems With MicroProfile and Jakarta EE. Kenji Kazumura explains how to use and fine-tune Eclipse MicroProfile functions, such as fault tolerance, metrics, and OpenTracing to build microservices for mission-critical enterprise systems. You’ll also learn how to use these parameters in conjunction with Istio and tools such as Grafana and Kiali to monitor microservices.

 

Register for EclipseCon 2020 Today

EclipseCon is a virtual event this year and it’s being held October 19-22. There’s no cost to attend the sessions, but you do need to register. Space is limited, so be sure to register early to reserve your spot.

Get all the registration details and register now.

 For event details, visit eclipsecon.org/2020.

To join the EclipseCon conversation and get the latest updates:

·      Use #EclipseCon on social media

·      Follow @EclipseCon on Twitter

And stay tuned for more insight into EclipseCon 2020. Our upcoming blogs will focus on:

·      Community Day events

·      Tips to get the most out of EclipseCon


by Tanja Obradovic at September 22, 2020 12:57 PM

Hibernate’s Query APIs

by Thorben Janssen at September 22, 2020 12:00 PM

The post Hibernate’s Query APIs appeared first on Thorben Janssen.

When working with Hibernate, you can choose between multiple APIs to query data from your database. Some of them are very flexible and provide almost unlimited options to filter and transform your query results. Others are specifically designed to implement specific tasks as easily and quickly as possible. In this article, I will show you […]

The post Hibernate’s Query APIs appeared first on Thorben Janssen.


by Thorben Janssen at September 22, 2020 12:00 PM

Common Issues with Eclipse GlassFish You Won't Have with Payara Server

by Fabio Turizo at September 21, 2020 01:51 PM

If you're running your applications using Eclipse GlassFish, or one of its older iterations, you may have encountered one of the following common issues that hamper the productivity of your application development and overall server management in some capacity:


by Fabio Turizo at September 21, 2020 01:51 PM

Hashtag Jakarta EE #38

by Ivar Grimstad at September 20, 2020 09:59 AM

Welcome to the thirty-eighth issue of Hashtag Jakarta EE!

Time for this week’s cake, or pie (chart) to be specific…
The current status for Jakarta EE 9 is that ten specifications have been approved, two ballots are ongoing and five are almost ready for ballot.

The only specifications that have not created a Pull Request yet are:

Jakarta Server Pages
Jakarta Standard Tag Library
Jakarta Server Faces

The list is getting shorter! If you are involved in any of these, please do go forward with creating the pull requests. They can be created as draft PRs and be updated along the way up to being ready for ballot. There is absolutely no reason to wait until everything is ready!

Java 15 is available. You can download it wherever you usually get your JDK, for example at AdoptOpenJDK. Check out this blog and video by Markus Karg where he talks about all the changes in the Java language since Java 7.

The new date for JakartaOne LiveStream is December 8, 2020! The Call-for-paper will close on October 1st, so make sure you submit your talk.

It is a pleasure to welcome MicroProfile as a Working Group at the Eclipse Foundation! It has been a long process, but we are finally getting there. Check out the draft charter. It is still in proposal state, but expect more news to come about this shortly.

Still hungry? Check out How To Bring Your Java Microservices To The Cloud by Jadon Ortlepp. There will be pizza…


by Ivar Grimstad at September 20, 2020 09:59 AM

Java Language Evolution

by Markus Karg at September 19, 2020 03:00 PM

Hey guys! How’s it going?

This is not your dad’s Java anymore!

The Java programming language has changed massively since Java 7, after introduction of the keyword var, records, switch expressions, and many more syntax changes. Modern Java feels quite differently and allows new idioms. Time to look into the language changes of nearly one decade, to get an idea how to write modern code style, and to express your ideas more concise. Also, in future we will have even better means to express ourselfs in terms of syntax instead of terms of API or architecture: Valhalla and Loom will further move Java into a readable and well-performing language.

Stay safe and… Party on!

08: lambda expressions, method references, interface default methods, interface static methods, functional interfaces, effectively final variables, repeating annotations

09: https://cr.openjdk.java.net/~iris/se/9/latestSpec/java-se-9-jls-diffs.pdf

10: https://cr.openjdk.java.net/~iris/se/10/latestSpec/java-se-10-jls-diffs.pdf

11: https://cr.openjdk.java.net/~iris/se/11/latestSpec/java-se-11-jls-draft-diffs.pdf

12: https://cr.openjdk.java.net/~iris/se/12/latestSpec/java-se-12-jls-diffs.pdf

13: https://cr.openjdk.java.net/~iris/se/13/latestSpec/java-se-13-jls-diffs.pdf

14: https://cr.openjdk.java.net/~iris/se/14/latestSpec/java-se-14-jls-diffs.pdf

15: https://cr.openjdk.java.net/~iris/se/15/latestSpec/java-se-15-jls-fr-diffs.pdf

Ondro’s Java Language diff: https://ondro.inginea.eu/index.php/new-features-between-java-8-and-java-14/#language-features


by Markus Karg at September 19, 2020 03:00 PM

Jakarta EE Community Update September 2020

by Tanja Obradovic at September 18, 2020 03:33 PM

After a pause with blogs in August, I am happy to report that momentum toward the Jakarta EE 9 final release is building, we have a release date, and there are a number of virtual events that will help you stay up to date on the latest advances in Jakarta EE and the Java ecosystem. Read on for details.
 

The Jakarta EE Working Group Is Growing

We’re very pleased to share the news that Jelastic has joined the Jakarta EE Working Group as a Participant member. Jelastic develops turnkey, multi-cloud Platform as a Service (PaaS) solutions that unify and automate cloud infrastructure management.

Welcome to the Jakarta EE Working Group, Jelastic!

For a complete list of Jakarta EE Working Group members, click here.

 

More Tooling, IDE, and Cloud Providers Are Supporting Jakarta EE

Implementing the new namespace in Jakarta EE 9 allows vendors and solution providers to migrate faster and more cost effectively than waiting until Jakarta EE 10, which will also include new features, enhancements, and other major changes.

 Here are two of the most recent companies to announce their support of Jakarta EE 9:

·  The Jelastic Platform as a Service (PaaS) team is actively integrating Jakarta EE 9 within the Jelastic cloud platform. For details, click here.

·  The IntelliJ IDEA has also been migrated to the new Jakarta EE namespace. To help its users learn more about Jakarta EE 9, IntelliJ hosted a webinar entitled “Jakarta EE 9 and Beyond” by Ivar Grimstad, the Eclipse Foundation’s Jakarta EE developer advocate. To view a replay of the webinar, click here.

To help companies make the transition, the Jakarta EE community has developed a data sheet summarizing the namespace migration challenge and opportunity. You can download the data sheet, here.

 

We Have a Jakarta EE 9 Final Release Date

With more Jakarta EE 9 specifications being approved and many others close to receiving approval, the Jakarta EE 9 final release date has been set for November 20, 2020. Here’s a visual summary of the latest approval status.

 

Save the Date: JakartaOne Livestream Is December 8

To coincide with the Jakarta EE 9 final release, the JakartaOne Livestream event will take place on December 8.

This one-day virtual conference is a great way for everyone in the community to learn more about the technical benefits and architectural advances that become possible with cloud native Java, Jakarta EE, Eclipse MicroProfile, and Java EE technologies.

If you have expertise or insight you’d like to share with attendees, there’s still time to submit a paper. The call for papers (CFP) deadline has been extended to October 1, 2020.

Stay tuned for registration details. In the meantime:

·  Visit the JakartaOne Livestream website

·  Submit a paper

·  Follow @JakartaOneConf on Twitter for live event updates, speaker announcements, news, and more

 

JakartaOne Livestream — Brazil: Watch the Replay

The JakartaOne Livestream event in Brazil on August 29 was a huge success with 330 registered individuals: almost 200 people attending the live event and more than 130 watching the replay. The event included a keynote, vendor talks about compatible implementations by Red Hat, Tomitribe, Payara, and Oracle, and five technical talks.

 To see the session topics, click here.

 To watch the session replays, click here. Note that the sessions are delivered in Portuguese.

 

Upcoming Events 

There are a number of upcoming events related to Jakarta EE. Here are brief summaries to help you choose the ones you want to attend.

September 19: Delhi and NCR JUG Talk

This online event hosted by the Delhi and NCR Java User Group (JUG) will feature a talk on “Jakarta EE 9 and Beyond” by myself and Ivar Grimstad:

·  Time: 6:00 p.m. IST

·  Details and registration: Delhi and NCR JUG Meetup site

·  Twitter: twitter.com/DelhiJUG

October 12: JakartaOne Livestream — Español

·  Event details: jakartaone.org/2020/hispano

·  Registration: Register through Crowdcast

·  Sessions are in Spanish

October 13-14: Virtual Community Booth at the J4K Conference

Because the community has expressed interest in public Steering Committee calls, the next Steering Committee call will take place on October 13 at 1:30 p.m. EDT from the J4K Conference virtual booth.

Also, our next Jakarta EE community update call will take place October 14 at 11:00 a.m. EDT at our virtual booth at the J4K Conference.

Finally, Jakarta EE and MicroProfile community experts will be hosting short talks, demos, and Q&A sessions at the virtual booth.

Be sure to register to visit the virtual booth. We’ll provide the links as soon as they’re available.

 

Join Community Update Calls

Jakarta EE community calls are open to everyone! For upcoming dates and connection details, see the Jakarta EE Community Calendar

The next call will be October 14 at 11:00 a.m. EDT. This month’s call coincides with the virtual J4K Conference so we’ll take the opportunity to open the call to a wider audience by hosting it at the conference.

Topics will include:

·  Progress update on Jakarta EE 9 release

·  New on Jakarta EE 9 from Eclipse Foundation

·  Topics and questions from the community

We know it’s not always possible to join calls in real time, so here are links to the recordings and presentations:

·  September call presentations

·  The complete playlist

 

Stay Connected With the Jakarta EE Community

The Jakarta EE community is very active and there are a number of channels to help you stay up to date with all of the latest and greatest news and information. Subscribe to your preferred channels today:

·  Social media: Twitter, Facebook, LinkedIn Group

·  Mailing lists: jakarta.ee-community@eclipse.org, jakarta.ee-wg@eclipse.org, project mailing lists

·  Newsletters, blogs, and emails: Eclipse newsletter, Jakarta EE blogs

·  Meetings: Jakarta Tech Talks, Jakarta EE Update, Jakarta Town Hall, and Eclipse Foundation events and conferences

 You can find the complete list of channels, here.

 To help shape the future of open source, cloud native Java, get involved in the Jakarta EE Working Group.

 To learn more about Jakarta EE-related plans and check the date for the next Jakarta Tech Talk, be sure to bookmark the Jakarta EE Community Calendar


by Tanja Obradovic at September 18, 2020 03:33 PM

Modern Cloud-Native Jakarta EE Frameworks: Tips, Challenges, and Trends.

by otaviojava at September 16, 2020 01:34 PM

Cloud-native changes impacts applications in ways that weren’t critical before. E.g. cold starts and boot time are now crucial in serverless and microservices. https://dzone.com/articles/modern-cloud-native-jakarta-ee-frameworks

by otaviojava at September 16, 2020 01:34 PM

Pagination with JPA and Hibernate

by Thorben Janssen at September 15, 2020 12:00 PM

The post Pagination with JPA and Hibernate appeared first on Thorben Janssen.

The size of a result set has a huge impact on the performance of a query, the burden it puts on your Java application, and the user experience your UI provides. It’s a general best practice to split huge result sets into multiple parts presented on separate pages. This process is called pagination. The most […]

The post Pagination with JPA and Hibernate appeared first on Thorben Janssen.


by Thorben Janssen at September 15, 2020 12:00 PM

Deploy-Friday: E22 MicroProfile: Optimizing Java for a Microservices Architecture

by otaviojava at September 14, 2020 03:44 PM

A Question and Answer session with guests:  Emily Jiang Roberto Cortez Otavio Santana  Chad Carlson The MicroProfile project defines a programming model for developing microservice applications in an Enterprise Java environment.  In this session, we’ll briefly introduce MicroProfile, then discuss its current technical and community status, including efforts to standardize Java microservices. Try Eclipse MicroProfile: […]

by otaviojava at September 14, 2020 03:44 PM

What's New in the Payara Enterprise Platform September Release?

by Debbie Hoffman at September 14, 2020 01:00 PM

We're happy to announce that Payara Platform Enterprise 5.21.2 (request here) Edition is out today!


by Debbie Hoffman at September 14, 2020 01:00 PM

How To Bring Your Java Microservices To The Cloud

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at September 10, 2020 11:30 AM

All companies are software companies, and businesses will always experience the challenge of keeping integrations between users and applications scalable, productive, fast, and of high quality. To combat this, cloud, microservices, and other modern solutions come up more and more in architectural decisions.

Here is the question: Is Java prepared to deal with these diverse concepts in a corporate environment?

Yes, and to demonstrate how Jakarta EE and Eclipse MicroProfile work very well and in the cloud, the Payara and Platform.sh will work together on this webinar. Watch and make your conclusions.


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at September 10, 2020 11:30 AM

A VERY BAD Decision – The Two Minutes Tuesday 006

by Markus Karg at September 08, 2020 09:00 PM

Hey guys!

Everybody does mistakes – even the Eclipse Foundation’s Jakarta EE Working Group.

They decided BY ACCIDENT that a contributor loses his committer state once his employer is not paying Working Group Membership Fees. That is nuts! But good news: They fixed their mistake already, so everybody can become a committer FOR FREE!

CU!


by Markus Karg at September 08, 2020 09:00 PM

A tiny plug-in based CLI framework ontop of jCommander

by Markus Karg at September 08, 2020 05:02 PM

It is still a very initial beta, but we are rather proud of it: Today we published the source code of our tiny CLI application framework built around the terrific jCommander and ServiceLoader. What our framework provides ontop of jCommander is: It has a launcher which finds plugins on the classpath, so you can write plug-in based externally extensible CLI commands (including sub-commands) in Java. We think it is pretty cool and would be happy if you try it out and provide some feedback:  https://gitlab.com/quipsy/cli-framework ðŸ™‚


by Markus Karg at September 08, 2020 05:02 PM

Five good reasons to use PaaS in your Java Application

by otaviojava at September 08, 2020 04:44 PM

Cloud computing removes concerns about hardware, allowing Java developers to focus solely on their software.. In this article, we’ll talk about five reasons why you should employ a specific cloud computing model, the  Platform-as-a-Service, for your Java application. 1 Less complexity The first point is undoubtedly about reducing complexity within your Java architecture. Container configuration, […]

by otaviojava at September 08, 2020 04:44 PM

Back to the top