Skip to main content

Jakarta EE: Multitenancy with JPA on WildFly, Part 1

by Rhuan Henrique Rocha at July 12, 2020 10:49 PM

In this two-part series, I demonstrate two approaches to multitenancy with the Jakarta Persistence API (JPA) running on WildFly. In the first half of this series, you will learn how to implement multitenancy using a database. In the second half, I will introduce you to multitenancy using a schema. I based both examples on JPA and Hibernate.

Because I have focused on implementation examples, I won’t go deeply into the details of multitenancy, though I will start with a brief overview. Note, too, that I assume you are familiar with Java persistence using JPA and Hibernate.

Multitenancy architecture

Multitenancy is an architecture that permits a single application to serve multiple tenants, also known as clients. Although tenants in a multitenancy architecture access the same application, they are securely isolated from each other. Furthermore, each tenant only has access to its own resources. Multitenancy is a common architectural approach for software-as-a-service (SaaS) and cloud computing applications. In general, clients (or tenants) accessing a SaaS are accessing the same application, but each one is isolated from the others and has its own resources.

A multitenant architecture must isolate the data available to each tenant. If there is a problem with one tenant’s data set, it won’t impact the other tenants. In a relational database, we use a database or a schema to isolate each tenant’s data. One way to separate data is to give each tenant access to its own database or schema. Another option, which is available if you are using a relational database with JPA and Hibernate, is to partition a single database for multiple tenants. In this article, I focus on the standalone database and schema options. I won’t demonstrate how to set up a partition.

In a server-based application like WildFly, multitenancy is different from the conventional approach. In this case, the server application works directly with the data source by initiating a connection and preparing the database to be used. The client application does not spend time opening the connection, which improves performance. On the other hand, using Enterprise JavaBeans (EJBs) for container-managed transactions can lead to problems. As an example, the server-based application could do something to generate an error to commit or roll the application back.

Implementation code

Two interfaces are crucial to implementing multitenancy in JPA and Hibernate:

  • MultiTenantConnectionProvider is responsible for connecting tenants to their respective databases and services. We will use this interface and a tenant identifier to switch between databases for different tenants.
  • CurrentTenantIdentifierResolver is responsible for identifying the tenant. We will use this interface to define what is considered a tenant (more about this later). We will also use this interface to provide the correct tenant identifier to MultiTenantConnectionProvider.

In JPA, we configure these interfaces using the persistence.xml file. In the next sections, I’ll show you how to use these two interfaces to create the first three classes we need for our multitenancy architecture: DatabaseMultiTenantProvider, MultiTenantResolver, and DatabaseTenantResolver.

DatabaseMultiTenantProvider

DatabaseMultiTenantProvider is an implementation of the MultiTenantConnectionProvider interface. This class contains logic to switch to the database that matches the given tenant identifier. In WildFly, this means switching to different data sources. The DatabaseMultiTenantProvider class also implements the ServiceRegistryAwareService, which allows us to inject a service during the configuration phase.

Here’s the code for the DatabaseMultiTenantProvider class:

public class DatabaseMultiTenantProvider implements MultiTenantConnectionProvider, ServiceRegistryAwareService{
    private static final long serialVersionUID = 1L;
    private static final String TENANT_SUPPORTED = "DATABASE";
    private DataSource dataSource;
    private String typeTenancy ;

    @Override
    public boolean supportsAggressiveRelease() {
        return false;
    }
    @Override
    public void injectServices(ServiceRegistryImplementor serviceRegistry) {

        typeTenancy = (String) ((ConfigurationService)serviceRegistry
                .getService(ConfigurationService.class))
                .getSettings().get("hibernate.multiTenancy");

        dataSource = (DataSource) ((ConfigurationService)serviceRegistry
                .getService(ConfigurationService.class))
                .getSettings().get("hibernate.connection.datasource");


    }
    @SuppressWarnings("rawtypes")
    @Override
    public boolean isUnwrappableAs(Class clazz) {
        return false;
    }
    @Override
    public <T> T unwrap(Class<T> clazz) {
        return null;
    }
    @Override
    public Connection getAnyConnection() throws SQLException {
        final Connection connection = dataSource.getConnection();
        return connection;

    }
    @Override
    public Connection getConnection(String tenantIdentifier) throws SQLException {

        final Context init;
        //Just use the multi-tenancy if the hibernate.multiTenancy == DATABASE
        if(TENANT_SUPPORTED.equals(typeTenancy)) {
            try {
                init = new InitialContext();
                dataSource = (DataSource) init.lookup("java:/jdbc/" + tenantIdentifier);
            } catch (NamingException e) {
                throw new HibernateException("Error trying to get datasource ['java:/jdbc/" + tenantIdentifier + "']", e);
            }
        }

        return dataSource.getConnection();
    }

    @Override
    public void releaseAnyConnection(Connection connection) throws SQLException {
        connection.close();
    }
    @Override
    public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException {
        releaseAnyConnection(connection);
    }
}

As you can see, we call the injectServices method to populate the datasource and typeTenancy attributes. We use the datasource attribute to get a connection from the data source, and we use the typeTenancy attribute to find out if the class supports the multiTenancy type. We call the getConnection method to get a data source connection. This method uses the tenant identifier to locate and switch to the correct data source.

MultiTenantResolver

MultiTenantResolver is an abstract class that implements the CurrentTenantIdentifierResolver interface. This class aims to provide a setTenantIdentifier method to all CurrentTenantIdentifierResolver implementations:

public abstract class MultiTenantResolver implements CurrentTenantIdentifierResolver {

    protected String tenantIdentifier;

    public void setTenantIdentifier(String tenantIdentifier) {
        this.tenantIdentifier = tenantIdentifier;
    }
}

This abstract class is simple. We only use it to provide the setTenantIdentifier method.

DatabaseTenantResolver

DatabaseTenantResolver also implements the CurrentTenantIdentifierResolver interface. This class is the concrete class of MultiTenantResolver:

public class DatabaseTenantResolver extends MuiltiTenantResolver {

    private Map<String, String> regionDatasourceMap;

    public DatabaseTenantResolver(){
        regionDatasourceMap = new HashMap();
        regionDatasourceMap.put("default", "MyDataSource");
        regionDatasourceMap.put("america", "AmericaDB");
        regionDatasourceMap.put("europa", "EuropaDB");
        regionDatasourceMap.put("asia", "AsiaDB");
    }

    @Override
    public String resolveCurrentTenantIdentifier() {


        if(this.tenantIdentifier != null
                && regionDatasourceMap.containsKey(this.tenantIdentifier)){
            return regionDatasourceMap.get(this.tenantIdentifier);
        }

        return regionDatasourceMap.get("default");

    }

    @Override
    public boolean validateExistingCurrentSessions() {
        return false;
    }

}

Notice that DatabaseTenantResolver uses a Map to define the correct data source for a given tenant. The tenant, in this case, is a region. Note, too, that this example assumes we have the data sources java:/jdbc/MyDataSource, java:/jdbc/AmericaDB, java:/jdbc/EuropaDB, and java:/jdbc/AsiaDB configured in WildFly.

Configure and define the tenant

Now we need to use the persistence.xml file to configure the tenant:

<persistence>
    <persistence-unit name="jakartaee8">

        <jta-data-source>jdbc/MyDataSource</jta-data-source>
        <properties>
            <property name="javax.persistence.schema-generation.database.action" value="none" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgresPlusDialect"/>
            <property name="hibernate.multiTenancy" value="DATABASE"/>
            <property name="hibernate.tenant_identifier_resolver" value="net.rhuanrocha.dao.multitenancy.DatabaseTenantResolver"/>
            <property name="hibernate.multi_tenant_connection_provider" value="net.rhuanrocha.dao.multitenancy.DatabaseMultiTenantProvider"/>
        </properties>

    </persistence-unit>
</persistence>

Next, we define the tenant in the EntityManagerFactory:

@PersistenceUnit
protected EntityManagerFactory emf;


protected EntityManager getEntityManager(String multitenancyIdentifier){

    final MuiltiTenantResolver tenantResolver = (MuiltiTenantResolver) ((SessionFactoryImplementor) emf).getCurrentTenantIdentifierResolver();
    tenantResolver.setTenantIdentifier(multitenancyIdentifier);

    return emf.createEntityManager();
}

Note that we call the setTenantIdentifier before creating a new instance of EntityManager.

Conclusion

I have presented a simple example of multitenancy in a database using JPA with Hibernate and WildFly. There are many ways to use a database for multitenancy. My main point has been to show you how to implement the CurrentTenantIdentifierResolver and MultiTenantConnectionProvider interfaces. I’ve shown you how to use JPA’s persistence.xml file to configure the required classes based on these interfaces.

Keep in mind that for this example, I have assumed that WildFly manages the data source and connection pool and that EJB handles the container-managed transactions. In the second half of this series, I will provide a similar introduction to multitenancy, but using a schema rather than a database. If you want to go deeper with this example, you can find the complete application code and further instructions on my GitHub repository.


by Rhuan Henrique Rocha at July 12, 2020 10:49 PM

Hashtag Jakarta EE #28

by Ivar Grimstad at July 12, 2020 09:59 AM

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

The CFP for JakartaOne Livestream 2020 is open! It will close on July 31, so submit sooner rather than later. We will be reviewing abstracts continuously.

I am happy to announce that my talk Jakarta EE 9 and Beyond is scheduled for EclipseCon 2020. All speakers are given the option to record their talks in advance for this year’s all virtual conference. Given that the planned release date for Jakarta EE 9 is September 16 and pre-recorded talks must be submitted by September 7, this talk will be a live session.

On Wednesday, July 15, there is a new Jakarta EE Update call. Check the Jakarta EE Community Calendar for details.

Tip: Click on in the lower right corner to add this calendar to your Google Calendar. That way, you won’t miss out on anything.

Trying out Jakarta EE 9

It is only a couple of weeks since the Jakarta EE 9 milestone was released, and the implementations supporting it are releasing builds frequently adding more support.

I have added a simple servlet here that you can now run on Tomcat, GlassFish, and Jetty. More implementations to come…

package com.demo.simple;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "hello", urlPatterns = {"/hello"})
public class SimpleHello  extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
     
        resp.setContentType("text/html;charset=UTF-8");
        resp.getWriter().println( "Hello Jakarta EE 9!");
    }
}

The pom.xml file has the

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.demo</groupId>
    <artifactId>simple-hello</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>simple-hello-1.0-SNAPSHOT</name>
    
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>

    <build>
        <finalName>simple-hello</finalName>
    </build>
  
    <dependencies>
        <dependency>
            <groupId>jakarta.platform</groupId>
            <artifactId>jakarta.jakartaee-api</artifactId>
            <version>9.0.0-RC2</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    
</project>

If you haven’t made your Jakarta EE 9 Milestone cupcake yet, take a look at this awesome video by Markus Karg in his blog post, Jakarta EE 9 M1 Sneak Peak to be inspired.


by Ivar Grimstad at July 12, 2020 09:59 AM

Long Coding Nights, ShrinkWrap, Arquillian and Testing--airhacks.fm podcast episode

by admin at July 11, 2020 03:54 AM

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

The #96 airhacks.fm episode with Andrew Lee Rubinger (@alrubinger) about:
JBoss and backend Java EE excitement, long coding nights, ShrinkWrap, Arquillian, testing strategies, developer's experience and "ease of use"
is available for download.

by admin at July 11, 2020 03:54 AM

Jakarta Security and REST in the Cloud Part 3: Knowing the OAuth2

by otaviojava at July 10, 2020 02:05 PM

Security is generally a topic that is left out when talking about software architecture, but that doesn’t mean that it is not essential. To talk more about it, we created this series on Java API security with Jakarta EE. In this third part, we will talk about the OAuth2 authentication process, moving it quickly to […]

by otaviojava at July 10, 2020 02:05 PM

Jakarta EE Developer Survey, EJB to Quarkus, Jakarta EE vs. MicroProfile, Jakarta MVC--76th airhacks.tv

by admin at July 10, 2020 08:19 AM

76th airhacks.tv with 15+ questions and topics like:
"Jakarta EE Developer Survey, JobRunr EJB to Quarkus, Jakarta EE vs. MicroProfile, Multi-Tenancy, Singletons, Jakarta MVC's future, JWT and access policies"

...and the breaking news: microprofile.training is available:

Any questions left? Ask now: https://gist.github.com/AdamBien/bb28a209f2e1255b305d2b3c9357854e and get the answers at the next airhacks.tv.

Future episodes are also going to be also announced at: Airhacks Meetup Group.


by admin at July 10, 2020 08:19 AM

Securing Your Applications Running on Payara Platform (JAX-RS Endpoints)

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at July 09, 2020 01:45 PM

Securing your application is a very important aspect of the development of your application. You not only need to make sure that the application has the intended functionality but also that this functionality can only be executed by the appropriate people. You not only need to make sure that updates to data are restricted to the correct people, but it is also important that end users only see data they are allowed to see. And in case of sensitive data, this is even more important.


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at July 09, 2020 01:45 PM

Getting Good Ideas From .net--an airhacks.fm podcast episode

by admin at July 08, 2020 12:44 PM

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

The #95 airhacks.fm episode with Ronald Dehuysser (@rdehuyss) about:
xtreme programming done right, good ideas in .net, testing strategies and jobrunr library
is available for download.

by admin at July 08, 2020 12:44 PM

Jakarta Security and REST in the Cloud: Part 2 Getting to Know the Basics

by otaviojava at July 07, 2020 12:16 PM

Security is generally a topic that we always leave out when we talk about software architecture, but that does not mean that it is not essential. To talk more about the subject, we created this series on Java API security with Jakarta EE. In this second part, we will speak of the BASIC authentication process, […]

by otaviojava at July 07, 2020 12:16 PM

How to use Ehcache as Hibernate’s 2nd Level Cache

by Thorben Janssen at July 07, 2020 12:00 PM

The post How to use Ehcache as Hibernate’s 2nd Level Cache appeared first on Thorben Janssen.

Using JPA’s and Hibernate’s 2nd level cache can improve the performance of your persistence layer. It acts as a session-independent entity store. Hibernate uses it whenever you call the find method on your EntityManager or traverse an association to fetch a cached entity. Instead of executing a database query, Hibernate gets the entity object from […]

The post How to use Ehcache as Hibernate’s 2nd Level Cache appeared first on Thorben Janssen.


by Thorben Janssen at July 07, 2020 12:00 PM

Authentication and Authorization Stores in Payara Platform

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at July 07, 2020 10:17 AM

Securing your application is a very important aspect of development. You not only need to make sure that the application has the intended functionality but also that this functionality can only be executed by the appropriate people. It is critical to ensure that updates to data are restricted to the correct people, and that end users only see data they are allowed to see. And in case of sensitive data, this is even more important.


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at July 07, 2020 10:17 AM

Jakarta EE Cookbook

by Elder Moraes at July 06, 2020 07:19 PM

About one month ago I had the pleasure to announce the release of the second edition of my book, now…

by Elder Moraes at July 06, 2020 07:19 PM

Jakarta EE Developer Survey, Testing BCE and Jakarta EE, EJB to Quarkus migrations, Singletons, Multi-Tenancy, Jakarta EE vs. MicroProfile--or 76th airhacks.tv

by admin at July 06, 2020 12:09 PM

Topics (https://gist.github.com/AdamBien/ed9b266efa084a74864b0e9f5512f29c) for the 76th airhacks.tv episode:
  1. 2020 Jakarta EE Developer Survey Report results discussion
  2. Jakarta MVC's future
  3. JobRunr review
  4. Testing BCE applications
  5. private method testing
  6. Sharing constants between JS and Java
  7. How to test Java EE applications
  8. EJB to quarkus migration
  9. Thoughts on Singletons and ApplicationScoped classes
  10. Multi-Tenant Jakarta EE 8 applications
  11. How to dynamically switch between DBs?
  12. How to switch between EntityManagers at runtime
  13. How to share JPA entities between projects
  14. What is the difference between Jakarta EE and MicroProfile server?

Join meetup.com/airhacks/ to get notified about future JUGs, sessions and airhacks.tv.

Any questions left? Ask now: https://gist.github.com/AdamBien/ed9b266efa084a74864b0e9f5512f29c and get the answers at the next airhacks.tv.


by admin at July 06, 2020 12:09 PM

Hashtag Jakarta EE #27

by Ivar Grimstad at July 05, 2020 09:59 AM

Welcome to the twenty-seventh issue of Hashtag Jakarta EE!

Last week was a shorter week due to the holidays in North America, but the work with Jakarta EE 9 continues. It is a pretty tight schedule, so any help is appreciated.

Work on Jakarta MVC progresses as well. We have now contributed the TCK, which is now available under EE4J on GitHub. The specification document and Javadoc have been prepared and ready for a Jakarta MVC 1.1 release. Now we just need to set up some build jobs and run the TCK against Krazo

The date is set for JakartaOne Livestream 2020. It will take place on September 16, 2020. We are planning for a 12-hour live streaming event of the same format as last year. The call-for-paper will open any day now. Stay tuned and get ready to submit your awesome proposal!

Make sure to follow @JakartaOneConf on Twitter so you don’t miss out on any information.


by Ivar Grimstad at July 05, 2020 09:59 AM

Deploy Friday: E12 Java Enterprise Applications

by otaviojava at July 03, 2020 11:50 AM

Several trends have been changing the world of software development in recent years, such as serverless, cloud-native, and microservices vs monoliths. Meanwhile, many tried and true concepts are still vital, such as DDD, testing, and clean code. What does “good” software architecture look like in 2020, and how does Java fit in the modern world? […]

by otaviojava at July 03, 2020 11:50 AM

Jakarta EE, MicroProfile and the iPhone Problem--airhacks.fm podcast episode

by admin at July 03, 2020 04:19 AM

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

The #94 airhacks.fm episode with Kevin Sutter (@kwsutter) about:
Jakarta EE 9 features, Jakarta EE / MicroProfile dynamics, Eclipse Transformer and MicroProfile platform.
is available for download.

by admin at July 03, 2020 04:19 AM

The Payara Monthly Catch for June 2020

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at July 02, 2020 11:04 AM

As usual, it was a busy month. With some big announcements from Microsoft and Oracle (see News section), the Jakarta EE 9 release, as well as Developer Survey results published by JetBrains, Eclipse and Snyk. We also had a major release ourselves. Sifting through the content I had a sense of renewed optimism and progress in the Java community. 

Below you will find a curated list of some of the most interesting news, articles and videos from the last month. Cant wait until the end of the month? then visit our twitter page where we post all these articles as we find them! 


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at July 02, 2020 11:04 AM

JakartaEE Uygulamaları için Gömülü Entegrasyon ve E2E Test Geliştirimi

by Hüseyin Akdogan at July 01, 2020 05:00 AM

Kurumsal uygulamalarda uçtan uca testler(end-to-end), gerçek kullanım durumlarını kapsadığı sürece önemlidir. Bu nedenle, şirketler daha çok entegrasyon testlerine odaklansalar da, uçtan uca testler ihmal edilmemektedir. Günümüzde Sistem Entegrasyon Testi olarak adlandırılan bir diğer yaygın ihtiyaç, bir yazılım sisteminin modülleri arasındaki etkileşimleri doğrulamaktır.

Dürüst olmak gerekirse, geliştirici ortamının dışında (örneğin bir CI/CD pipeline’nında), tüm bu ihtiyaçları karşılamak Spring Framework ile karşılaştırıldığında JakartaEE’de (daha önce Java EE) biraz daha zordur. Yerleşik gömülü sunucu desteği olmadığı(doğal olarak) için, ek bağımlılıklar ve yapılandırmalar sağlamanız gerekir. Bu makalede, Arquillian ve MicroShed test çerçevelerini tanıtmaya, yukarıda değinmeye çalıştığım ihtiyaçları karşılama noktasında nasıl kullanabileceğinizi açıklamaya çalışacağım. Ele alacağım örneği GitHub’da bulabilirsiniz.

 

Başlamadan

Yukarıda belirtilen ihtiyaçları somutlaştırmak için iki servisten oluşan bir microservice örneğini ele alacağız.

  • Order Servisi
  • Validation Servisi

Order servisi, istemciden aldığı talep nesnesi içindeki kredi kartı numarası Validation servisine doğrulandıktan sonra, nesneyi veritabanına kazımaktan sorumludur. Validation servisi, Order servisi’nden iletilen kredi kartı numarasını doğrulamaktan sorumludur. Kısa bir bilgi ile, numaranın doğrulanıp onaylanmadığına dair bir bayrak döndürür.

Validation servisinin görevi nedeniyle başka bir hizmete veya sistem bileşenine bağımlı olmadığı hemen fark edilebilir. Tersine, Order servisi Validation servisine bağımlıdır ve ek olarak onaylanmış nesneyi veritabanına kazımakla yükümlüdür. Dolayısıyla, Validation servisinin belirtilen işlevsel gereksinimle uyumluluğunu değerlendirmek için bir entegrasyon testine ihtiyacımız varken, Order servisinde, servis diğer sistem bileşenlerine bağımlı olduğu için, entegrasyon testiyle yetinemeyiz. Sistemin tüm katmanlardaki hataları tespit etmek için uçtan uca bir teste ihtiyacımız var.

Bu nedenlerle entegrasyon testi için Arquillian ve uçtan uca test için MicroShed Test kullanacağız.

 

Arquillian ile Gömülü Testler Nasıl Yazılır?

Arquillian, Java uygulamaları için bir test çerçevesidir. Başlıca faydası, uygulama sunucusu yaşam döngüsünü sizin için işlemektir. Bunu konteyner adaptörleri ile sağlanmaktadır. Arquillian’ın birçok konteyner adaptörü var. Adaptör, kullanmak istediğiniz uygulama sunucusuna bağlı olduğundan, adaptörlerin ayrıntıları ve bunların nasıl yapılandırılacağı bu makalenin kapsamı dışındadır. Arquillian konteyner adaptörleri hakkında daha fazla bilgiyi burada bulabilirsiniz.

Ele alacağımız örnekte, Arquillian bağımlılıklarını ve Arquillian Yönetilen Kapsayıcı kurulumunu yönetmek için Liberty Maven plug-in‘i ile Liberty Yönetilen Konteyner Bağdaştırıcısını kullandım. Tüm bu yapılandırma ayrıntılarını depoda bulabilirsiniz.

Şimdi Arquillian ile nasıl test yazılacağına odaklanalım. Validation servisini bir end-point ve OrderController sınıfının işlevleri açısından doğrulamak için test geliştireceğiz. Test aşağıdaki gibi görünür:

@RunWith(Arquillian.class) //(1)
public class ValidationServiceIT 
{
   private final Client client;
   private static final String PATH = "api/validation/{cardNumber}";  
   
   public ValidationServiceIT() {
       this.client = ClientBuilder.newClient();
       client.register(JsrJsonpProvider.class);
   }

   @ArquillianResource //(2)
   private URL baseURL;

   @Deployment //(3)
   public static WebArchive createDeployment() {
       final WebArchive archive = ShrinkWrap.create(WebArchive.class,
               "arquillian-validation-service.war") //(4)
               .addClasses(ValidationController.class, ValidationService.class); //(5)
       return archive;
   }

   @Test
   @RunAsClient //(6)
   @InSequence(1) //(7)
   public void invalidCardNumberTest() {
       final WebTarget webTarget = client.target(baseURL.toString()).path(PATH)
               .resolveTemplate("cardNumber", "hello");
       final Response response = webTarget.request().get();
       final JsonObject result = response.readEntity(JsonObject.class);
       Assert.assertFalse(result.getBoolean("approval"));
   }

   @Test
   @RunAsClient
   @InSequence(2)
   public void validCardNumberTest() {
       final WebTarget webTarget = client.target(baseURL.toString()).path(PATH)
               .resolveTemplate("cardNumber", "12345");
       final Response response = webTarget.request().get();
       final JsonObject result = response.readEntity(JsonObject.class);
       Assert.assertTrue(result.getBoolean("approval"));
   }
}

Numaralandırılmış bölümleri açıklayarak kodu ayrıntılı biçimde inceleyelim.

1) İlk olarak, @RunWith ek açıklaması ile JUnit’e testleri Arquillian kullanarak çalıştırmasını söyleriz, böylece JUnit testleri JUnit koşucusu yerine Arquillian koşucusu ile çalıştırır.

2) Ana bilgisayar adı, bağlantı noktası ve web arşivi bilgilerini hardcoded tanımlamak için @ArquillianResource ek açıklamasını kullanırız. Bu sayede temel URL’yi elde ederiz (örneğimizde http://localhost:9090/arquillian-validation-service/) .

3) Uygulamamızı kullandığımız sunucuya(örneğimizde Open Liberty) deploy etmek için web arşivi döndüren bir metoda tanımlamalıyız. Yönteme @Deployment notasyonu uygulanmalı ve erişim belirteçleri public static olup, argüman almamalıdır. createDeployment metodu bu gereksinimleri karşılar.

4) ShrinkWrap.create yönteminin ikinci parametresi olarak iletilen arquillian-validation-service.war adına dikkat edin. Rastgele oluşturulmuş bir web arşivi adı istemiyorsanız bir ad sağlamalısınız.

5) Enjeksiyon başarısızlıklarından kaçınmak için, testimizin ihtiyaç duyduğu bağımlılıkları eklemeliyiz çünkü Arquillian, unit testlerin aksine tüm sınıfyoluna(classpath) bakmıyor. AddClass, addClassess, addPackages, addAsResource, addAsWebInfResourc, vb. metotları kullanarak test bağımlılıklarını ekleyebiliriz.

6) Validation servisini bir end-point olarak doğrulamak istediğimiz için, invalidCardNumberTest ve validCardNumberTest metotlarına @RunAsClient notasyonunu uyguladık. Notasyon, test senaryolarının istemci tarafında çalıştırılacağını belirtir, bu nedenle bu testler yönetilen kapsayıcıya karşı yürütülür.

7) Test sırasını garanti etmek için @InSequence notasyonunu kullanıyoruz.

Hem invalidCardNumberTest hem de validCardNumberTest metotlarında, kart numarasını doğrulamak için kart numaralarını baseURL + api / validation / {cardNumber} end-pointine göndeririz. Test, sayıların geçerliliğini end-pointten döndürülen nesnenin onay alanına göre kontrol eder.

Hepsi bu. Test senaryoları çalışmaya hazırdır. Mvn verfy komutunu çalıştırdıktan sonra, konsol çıktısında testlerin geçildiğini görebilirsiniz.

 

MicroShed Testi ile E2E Testleri Nasıl Yazılır?

Başka bir test çerçevesi, Java mikro hizmet uygulamaları için MicroShed’dir. Testcontainers üzerine bina edilmiştir, böylece uygulamanız bir Docker konteynerinin içinde çalışır. MicroShed’in ana yararı bu noktada ortaya çıkar, konteynırize edilmiş uygulamanızı konteyner dışından kullanmanıza izin verir, böylece true-to-production testler yapılmasını sağlar.

Örneğimizde, Order servisinin Validation servisine ve bir veritabanına bağımlı olduğunu unutmayın. Bu örnek için MicroShed’i tam olarak bu yüzden seçtik, çünkü bu bileşenleri Docker konteynerlerinde çalıştırarak Validation servisi ve veritabanına test ortamında erişmemizi sağlıyor.

MicroShed testi için minimum gereksinimler @MicroShedTest notasyonuna sahip bir sınıf ve erişim belirteçleri public static olan bir ApplicationContainer nesnesidir.

Yapılandırma ve test sınıflarımızı inceleyelim.

public class AppContainerConfig implements SharedContainerConfiguration // (1)
{
   private static final String IMAGE_NAME = "hakdogan/validation-service:01"; 
   private static final String SERVICE_NAME = "validation-service"; 
   private static final String POSTGRES_NETWORK_ALIASES = "postgres";
   private static final String POSTGRES_USER = "testUser";
   private static final String POSTGRES_PASSWORD = "testPassword";
   private static final String POSTGRES_DB = "orderDB";
   private static final int VALIDATION_SERVICE_HTTP_PORT = 9080;
   private static final int VALIDATION_SERVICE_HTTPS_PORT = 9443;
   private static final int APPLICATION_SERVICE_HTTP_PORT = 9082;
   private static final int APPLICATION_SERVICE_HTTPS_PORT = 9445;
   private static final int POSTGRES_DEFAULT_PORT = 5432;

   private static Network network = Network.newNetwork();

   @Container //(2)
   public static GenericContainer validationService = new GenericContainer(IMAGE_NAME) //(3)
                   .withNetwork(network) //(4)
                   .withNetworkAliases(SERVICE_NAME) //(5)
                   .withEnv("HTTP_PORT", String.valueOf(VALIDATION_SERVICE_HTTP_PORT)) //(6)
                   .withEnv("HTTPS_PORT", String.valueOf(VALIDATION_SERVICE_HTTPS_PORT)) //(7)
                   .withExposedPorts(VALIDATION_SERVICE_HTTP_PORT) //(8)
                   .waitingFor(Wait.forListeningPort()); //(9)

   @Container
   public static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>() //(10)
           .withNetwork(network)
           .withNetworkAliases(POSTGRES_NETWORK_ALIASES)
           .withUsername(POSTGRES_USER)
           .withPassword(POSTGRES_PASSWORD)
           .withDatabaseName(POSTGRES_DB)
           .withExposedPorts(POSTGRES_DEFAULT_PORT);

   @Container
   public static ApplicationContainer app = new ApplicationContainer() //(11)
           .withNetwork(network)
           .withEnv("POSTGRES_HOSTNAME", POSTGRES_NETWORK_ALIASES)
           .withEnv("POSTGRES_PORT", String.valueOf(POSTGRES_DEFAULT_PORT))
           .withEnv("POSTGRES_USER", POSTGRES_USER)
           .withEnv("POSTGRES_PASSWORD", POSTGRES_PASSWORD)
           .withEnv("POSTGRES_DB", POSTGRES_DB)
           .withEnv("VALIDATION_SERVICE_HOSTNAME", SERVICE_NAME)
           .withEnv("HTTP_PORT", String.valueOf(APPLICATION_SERVICE_HTTP_PORT))
           .withEnv("HTTPS_PORT", String.valueOf(APPLICATION_SERVICE_HTTPS_PORT))
           .withExposedPorts(APPLICATION_SERVICE_HTTP_PORT)
           .withAppContextRoot("/")
           .waitingFor(Wait.forListeningPort())
           .dependsOn(validationService, postgres); //(12)
}

Numaralandırılmış bölümleri açıklayarak kodu ayrıntılı biçimde inceleyelim.

1) Her test sınıfı için yeni bir kapsayıcı başlatmamak adına SharedContainerConfiguration nesnesini implement eden bir nesne kullanıyoruz. Bu şekilde, birden fazla test sınıfı aynı kapsayıcı örneklerini paylaşabilir.

2) @Container notasyonu, Testcontainers tarafından yönetilmesi gereken konteynerleri işaretlemek için kullanılır. Uygulama konteyneri dışında, Order servisinin bağımlı olduğu bileşenler için bu ortak yapılandırma sınıfında iki konteyner tanımladık, bunlar Validation servisi ve Postgresql veritabanı. Notasyonun hepsinde kullanıldığına dikkat edin.

3) IMAGE_NAME değişkeni, önceden konteynırize edilmiş Validation servisinin Docker imaj adını içerir.

4) Network nesnesini özel bir ağ oluşturmak için kullanıyoruz çünkü uygulamamızın bağımlı bileşenleriyle iletişim kurması gerekiyor. Bu nedenle, bu bileşenleri uygulama konteyneri ile aynı ağa yerleştiriyoruz.

5) SERVICE_NAME değişkeni, uygulama konteynerinde, Validation servisine erişmek için kullanılacak ismi içerir.

6–7) HTTP_PORT ve HTTPS_PORT ortam değişkenleri, uygulama sunucusuna (örneğimizde Open Liberty) hangi bağlantı noktalarının kullanılacağını bildirir. Bunlar daha önce server.xml dosyasına yer tutucu olarak eklenmiştir.

8) Testcontainers’a Validasyon servisinin HTTP portunu erişilebilir kılmasını söylüyoruz.

9) Testcontainers’a, bekleme stratejisi olarak, konteynerin kullanılmaya hazır olup olmadığını kontrol etmek için dışa açılan portları dinlemesini söylüyoruz.

10) Başlangıç parametreleriyle bir Postgres konteyneri tanımlıyoruz.

11) Uygulamamızın(Order servisi) kapsayıcısını tanımlıyoruz. Bunu çeşitli şekillerde tanımlayabilirsiniz. Reponuza bir Dockerfile eklemek veya imaj adını bir argüman olarak ApplicationContainer nesnesinin yapıcısına iletmek veya uygulama kapsayıcısı oluşturmak için varsayılan mantığı sağlayacak bir çalışma zamanı seçeneği olarak satıcıya özgü bağdaştırıcılar kullanmak seçenekleriniz arasında. Biz bu örnekte, otomatik olarak test edilebilir bir konteyner imajı oluşturmak için pom.xml dosyasına microshed-testing-liberty bağımlığı ekleyerek son seçeneği kullandık. Burada, MicroShed’in diğer çalışma zamanı seçeneklerini bulabilirsiniz.

12) Bu ayarla, uygulama konteynırının Validasyon servisi ve Postgres konteynerlerine bağımlı olduğunu belirtiyoruz.

Şimdi test sınıfımızı inceleyelim. Aşağıdaki gibi görünüyor.

 

@MicroShedTest //(1)
@SharedContainerConfig(AppContainerConfig.class) //(2)
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) //(3)
public class SystemTest
{
   @RESTClient //(4)
   public static OrderController orderController;
   
   @Test
   @Order(1)
   public void invalidCardNumberTest(){
       final OrderDemand order = new OrderDemand(1, 1, "", "hello");
       final Response response = orderController.saveOrder(order);
       Assert.assertEquals(false, response.readEntity(JsonObject.class).getBoolean("approval"));
   }

   @Test
   @Order(2)
   public void validCardNumberTest(){
       final OrderDemand order = new OrderDemand(1, 1, "", "1234567");
       final Response response = orderController.saveOrder(order);
       Assert.assertNotNull(response.readEntity(OrderDemand.class).getId());
   }
  
   @Test
   @Order(3)
   public void getAllOrderTest(){
       final Response response = orderController.getAllOrders();
       final List list = response.readEntity(List.class);
       Assert.assertFalse(list.isEmpty());
   }

   @Test
   @Order(4)
   public void getAllOrderByProductIdTest(){
       final Response response = orderController.getAllOrdersByProductId(1);
       final List list = response.readEntity(List.class);
       Assert.assertFalse(list.isEmpty());
    }
}

Numaralandırılmış bölümleri açıklayarak kodu ayrıntılı biçimde inceleyelim.

1) Notasyon ile test sınıfının MicroShed Testing kullandığını belirtiyoruz.

2) Test sınıfı tarafından kullanılacak paylaşılan yapılandırmamızı tanımlıyoruz.

3) MicroShed Testing, JUnit Jupiter ile çalışıyor. Test sırasını garanti etmek için order metodunu kullanacağımızı TestMethodOrder notasyonuyla tanımlıyoruz.

4) Notasyon, JAX-RS REST Client’ı için bir enjeksiyon noktası tanımlar. Enjekte edilen nesneye yapılan herhangi bir metot çağrısı HTTP üzerinden eşdeğer bir REST isteğine çevrilecektir. Notasyonlu alan public statik tanımlanmalı ve final olmamalıdır.

Hem invalidCardNumberTest hem de validCardNumberTest metotlarında, api/order/save end-pointini @RESTClient notasyonlu orderController referansı ile çağırırız. Bu end-point, Validasyon hizmetini çağırarak doğrulama işlemini tetikler, ardından kart numarası geçerliyse istek gövdesi ile iletilen nesneyi veritabanına kazır.

Hem getAllOrderTest hem de getAllOrderByProductIdTest yöntemlerinde, geçerli kredi kartı numarasını içeren test durumundan sonra, nesnenin veritabanına kazınıp kazınmadığını kontrol ederiz.

Bu şekilde uçtan uca bir testi gerçekleştirmiş olduk. Mvn verfy komutunu çalıştırdıktan sonra, konsol çıktısında testlerin geçildiğini görebilirsiniz.

 

Sonuç

Gömülü testler, günümüzün microservice ve çok katmanlı mimariler dünyasında, özellikle CI/CD ortamlarında neredeyse vazgeçilmezdir. Arquillian ve MicroShed gibi test çerçeveleri (elbette ve Testcontainers) JakartaEE uygulamaları için bu önemli ihtiyaca cevap verir. İki çerçeveyi karşılaştırırsak, bazı farklılıkları çabucak gözden geçirebiliriz.

Arquillian, CDI konteyneri tarafından yönetilen tüm nesneleri test sınıfınıza enjekte etmenizi sağlar. MicroShed, test sınıfına sadece JAX-RS Resource nesnelerini enjekte eder. Arquillian’da XML yapılandırması uzun ve ayrıntılıdır, MicroShed, XML yapılandırması gerektirmez. Arquillian, uygulamanızın bağımlı olduğu sistem bileşenlerini test etme seçeneği sunmaz, ancak MicroShed sunar. Arquillian’ın güçlü bir topluluğu olduğunu söyleyebiliriz, ancak MicroShed için aynı şeyi söyleyemeyiz.

 

Referanslar

Arquillian Guides

MicroShed Testing


by Hüseyin Akdogan at July 01, 2020 05:00 AM

DevNexus 2020 Video Interview with Emily Jiang & David Blevins

by David Blevins at June 30, 2020 02:02 PM

At the end of February, right before the Covid-19 pandemic shut down all USA conferences, a few Tribers enjoyed the DevNexus week.  Watch below a candid 20 minutes video  David Blevins and Emily Jiang conversation that shares an insight on topics such as: 
We hope you enjoy it! 
 
Video Credits:  
The video was first published on May 13th by the IBM Developer youtube channel & shared via IBM Developer Advocate  Mary Grygleski‘s tweet on May 14th.

The post DevNexus 2020 Video Interview with Emily Jiang & David Blevins appeared first on Tomitribe.


by David Blevins at June 30, 2020 02:02 PM

Lombok & Hibernate: How to Avoid Common Pitfalls

by Thorben Janssen at June 30, 2020 12:53 PM

The post Lombok & Hibernate: How to Avoid Common Pitfalls appeared first on Thorben Janssen.

Lombok is a popular framework among Java developers because it generates repetitive boilerplate code like getter and setter methods, equals and hashCode methods, and the default constructor. All you need to do is add a few annotations to your class and Lombok will add the required code at compile time. This works reasonably well for […]

The post Lombok & Hibernate: How to Avoid Common Pitfalls appeared first on Thorben Janssen.


by Thorben Janssen at June 30, 2020 12:53 PM

Jakarta Security and REST in the Cloud Part 1: Hello World

by otaviojava at June 29, 2020 11:41 AM

Despite being a crucial aspect of any application, security is a topic that few discuss in the software development industry. As a consequence, many decisions are made without taking this issue into account. https://dzone.com/articles/jax-rs-security-cloud

by otaviojava at June 29, 2020 11:41 AM

Hashtag Jakarta EE #26

by Ivar Grimstad at June 28, 2020 09:59 AM

Welcome to the twenty-sixth issue of Hashtag Jakarta EE!

In Memory of Bill Shannon

Tuesday this week, we celebrated the Jakarta EE 9 Milestone release with an online cupcake party. Here is a photo of my creation.

I also posted a superfast (6 seconds) timelapse of the cupcake production in Studio Jakarta EE. The description contains the recipe if anyone is interested. Please continue the party by posting sharing cupcake picture using the hashtag #JakartaEE.

The first friends call happened this Wednesday. This call is an informal chat among peers mimicking the hallway discussions usually happening at conferences and events. The next call is July 22!

The delivery of Jakarta EE 9 Milestone was a major effort, but this community doesn’t rest. The work with delivering a final version of Jakarta EE 9 on September 16 continues. The schedule is tight, but I am confident we will make it.

We made the initial contribution of Jakarta MVC, and the work with preparing the specification document for a Jakarta MVC 1.1 release is ongoing. Please join our mailing list to participate.


by Ivar Grimstad at June 28, 2020 09:59 AM

How to create a Servlet

by Theodor Augustin Dumitrescu at June 25, 2020 05:28 PM

In a Web Application a Servlet can be defined in three ways:

  • using the WebServlet annotation
  • writing the configuration in the deployment descriptor
  • programmatically using ServerContext and ServletRegistration.Dynamic APIs

Using the WebServlet annotation

The WebServlet annotation can be used only on classes that inherit HttpServlet.

@WebServlet(name="Foo", urlPatterns={"/foo"})
public class FooService extends HttpServlet {
	// servlet code
}

A class annotated with WebService will be found by the container at deploy time. The corresponding Servlet will be available at the specified URL patterns with the using the parameter urlPatterns . If urlPatterns is the only parameter used, then we can use the value parameter e.g:

@WebServlet("/foo")
public class FooService extends HttpServlet {
	// servlet code
}

The name parameter is optional. If it's not specified is the fully qualified class name of the Servlet (e.g com.thadumi.FooService) will be used as default.

For the full list of parameters check out the JakartaEE documentation.

Creating a Servlet using the deployment descriptor

In the above section, we saw that for using the WebServlet annotation we must inherit from HttpServlet. However, a Servlet could also inherit from GenericServlet or implement the Servlet interface. So, who can we deploy these kinds of servlets?

public class FooService extends GenericServlet {
	// servlet code
}

For deploying a Servlet of any kind we can use the deployment descriptor. It is the file named web.xml, and located inside the app's WAR under ./WEB-INF/web.xml. The configuration syntax is given by the deployment descriptor schema. The next snipet is an example of how to write the configuration for FooService.

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.1"
         xmlns="https://jakarta.ee/xml/ns/jakartaee/"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee/ https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd">
         
    <servlet>
            <servlet-name>Foo</servlet-name>
            <servlet-class>com.thadumi.FooService</servlet-class>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>Foo</servlet-name>
        <url-pattern>/foo</url-pattern>
    </servlet-mapping>

</web-app>

Programmatically using the APIs

We are not going to discuss in-depth this approach here. It should be used only when we are writing a framework or complex libraries.

In short, we can implement the ServletContextListener for creating a context listener. This allows us to be notified about the ServletContext lifecycle changes. Thus, when the web application initialization process is starting we can access the ServletContext and add to it further servlets programmatically.

@WebListener
public class ContextListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext ctx = sce.getServletContext();

        ServletRegistration.Dynamic srd = ctx.addServlet("Foo", "com.thadumi.FooService");
        srd.addMapping("/foo");
        srd.setLoadOnStartup(1);
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        // ...
    }
}

References

  1. https://docs.oracle.com/javase/tutorial/java/annotations/basics.html
  2. https://jakarta.ee/specifications/platform/9/platform-spec-9-SNAPSHOT.html
  3. https://jakarta.ee/specifications/servlet/5.0/servlet-spec-5.0-SNAPSHOT.html

by Theodor Augustin Dumitrescu at June 25, 2020 05:28 PM

Helidon 2.0 is out

by dmitrykornilov at June 25, 2020 02:00 AM

After almost a year of development, three milestones, and two release candidates, Helidon 2.0 is finally out of the development cage and ready for GA. Yay!

Helidon 2.0 brings many new features in both Helidon SE and Helidon MP, such as the highly anticipated GraalVM native-image support in Helidon MP and CORS support. You can see the full list of features on the pictures below.

Note that some of the new APIs are still experimental and may change in the following minor releases.

There are also some changes in the build profiles and tooling to improve usability and to make Helidon even more enjoyable to work with.

We believe that the release of Helidon 2.0 was the right time to introduce some backwards incompatible changes. We tried to minimize these changes to make the migration to Helidon 2.0 as smooth as possible. For a complete list of changes, see the release notes.

Please try Helidon 2.0 and give us your feedback as a comment here, through Twitter, or join our official Slack channel.  


by dmitrykornilov at June 25, 2020 02:00 AM

Jakarta EE 9 Milestone Release, 2020 Jakarta EE Developer Survey

by Will Lyons at June 23, 2020 11:10 PM

Today the Eclipse Foundation and the Jakarta EE Working Group announced the initial milestone release of Jakarta EE 9, and the results of the 2020 Jakarta EE Developer Survey.   

Jakarta EE 9 transforms the use of the javax.* namespace in Jakarta EE 8 to use of the jakarta.* namespace.   Jakarta EE 9 is intended primarily as a tooling release to enable tools vendors to support the platform, to enable vendors and developers to begin delivery of implementations and applications, and to provide a platform for future innovation.  See the Jakarta EE 9 Release Plan scope description for more information.   

The Jakarta EE 9 Milestone release provides an initial release of the platform including draft specification docs, Javadoc, APIs, TCKs and the Eclipse GlassFish 6.0 compatible implementation.  Congratulations and thanks to all who have contributed to this community-wide effort including my Oracle colleagues who continue to be leading contributors according to the Eclipse Foundation.   We are targeting a final release in September.   Check out the recording of the Jakarta EE 9 Release Party held this morning for presentations from project leaders.

I recommend you review the 2020 Jakarta EE Developer Survey yourself to gain insight into developer directions.   Tom Snyder, VP of Engineering, Oracle Enterprise Cloud Native Java, highlighted some of our major takeaways: "The survey findings reinforce what we're hearing from our customers - requirements to run existing enterprise Java applications AND Java microservices in cloud native Kubernetes environments. This is driving our investment in WebLogic Server support for Jakarta EE and Kubernetes, in Helidon releases leveraging Jakarta EE and MicroProfile, and Coherence CE and Verrazzano projects coming soon. We remain committed to work with the enterprise developer community to grow the future of Jakarta EE."

To hear more about the Coherence CE and Helidon, you still have time to register for our Coherence CE and Helidon 2.0 announcement event on June 25. See my last blog

Please register now for one of these webinars, at the time that works for you.

June 25, 2020, Webinar for Asia-Pacific time zones

June 25, 2020, Webinar for Europe, Middle East, Africa and Americas time zones

Looking forward to seeing you there.

 


by Will Lyons at June 23, 2020 11:10 PM

Database Migration with Spring Boot

by Thorben Janssen at June 23, 2020 12:00 PM

The post Database Migration with Spring Boot appeared first on Thorben Janssen.

All applications that get deployed to production should use an automated approach to migrate their database. It makes your job a lot easier. It also ensures you don’t miss any changes during the update process. That’s, of course, also true if you develop your application based on Spring Boot. The integration of Flyway and Liquibase […]

The post Database Migration with Spring Boot appeared first on Thorben Janssen.


by Thorben Janssen at June 23, 2020 12:00 PM

Payara's Involvement in the Jakarta EE 9 Milestone Release

by Steve Millidge at June 23, 2020 11:17 AM

As a leading contributor to Jakarta EE, we're happy to announce the Eclipse Foundation Jakarta EE 9 Milestone Release and the results of their 2020 Jakarta EE Developer Survey. 

The Jakarta EE 9 Milestone Release demonstrates the significant progress made toward the final release later this year, and offers an opportunity for the industry to try the new namespace and start migrating their frameworks. 

The 2020 Jakarta EE Developer Survey features responses from thousands of enterprise Java developers around the world, with results showing significant growth of Jakarta EE 8 use and interest in cloud-native Java.  The 2020 Jakarta EE Developer Survey results can be downloaded in their entirety here.

 


by Steve Millidge at June 23, 2020 11:17 AM

Jakarta EE Is Taking Off

by Mike Milinkovich at June 23, 2020 11:03 AM

With the results of the 2020 Jakarta EE survey and the initial milestone release of the Jakarta EE 9, it’s clear the community’s collective efforts are resonating with the global Java ecosystem.

Before I get to the survey results, I want to say a huge thank you to everyone who took the time to participate in the survey. We received nearly 2,200 responses from software developers, architects, and decision-makers around the world — an increase of almost 20 percent over last year’s survey. With your insight, we’ve gained a clear and comprehensive view of enterprise Java strategies and priorities globally, which in turn we are freely sharing with the ecosystem.

Jakarta EE Adoption and Compatible Implementations Are on the Rise

Less than a year after its initial release, Jakarta EE has emerged as the second-place cloud native framework with 35 percent of respondents saying they use it. While the Spring and Spring Boot frameworks are still the leading choices for building cloud native applications, their usage share dropped 13 percent to 44 percent in the 2020 survey results.

Combined, Java EE 8 and Jakarta EE 8 hit the mainstream with 55 percent adoption. Jakarta EE 8 was responsible for 17 percent of that usage, despite only shipping for the first time in September 2019. This is truly significant growth.

We’re also seeing a strong uptick in Jakarta EE 8 compatible products. Companies including IBM, Red Hat, Payara, Primeton, TmaxSoft, and Apusic now have Jakarta EE 8 Full Platform compatible products. Since January 2020, we’ve had four new Full Platform compatible implementations and one new Web Profile compatible implementation. In addition to Eclipse GlassFish 5.1, this brings Jakarta EE 8 adoption to 12 compatible products. This is an outstanding achievement for the Jakarta EE community to have more full platform compatible products in 8 months than Java EE 8 had in over 2 years. You can see the complete list here.

You can also expect to see additional compatible implementations in the coming months as more applications are passing Technology Compatibility Kit (TCK) tests and are well on their way to becoming certified as Jakarta EE 8-compatible products.

Architectural Approaches Are Evolving

This year’s Jakarta EE survey also showed a slight drop in the popularity of using a microservices architecture for implementing Java systems in the cloud compared to last year. At the same time, use of monolithic architectures for implementing Java systems in the cloud nearly doubled since last year’s survey and is now at 25 percent.

These results may indicate that companies are pragmatically choosing to simply “lift and shift” existing applications to the cloud instead of rearchitecting them as microservices.

Interestingly, the survey also indicated the Jakarta EE community would like to see better support for microservices in the platform. When you combine this fact with the rise of Jakarta EE, it’s reasonable to believe developers may be starting to favor vendor-neutral standards for building Java microservices over single-vendor microservices frameworks.

The Industry Is Moving to the New Jakarta EE Namespace

The support we’re seeing for the adoption of the new namespace in Jakarta EE 9 reinforces the value the industry sees in Jakarta EE. Technology leaders are already investing to ensure their software supports the Jakarta EE 9 namespace changes and others have indicated they will do the same. Some of these implementations include:

  • Eclipse GlassFish 6.0 milestone release is available to download
  • Jetty 11.0.0-alpha0 milestone release is available to download
  • Apache Tomcat 10.0 M6 milestone release is available to download
  • Payara Platform 6 milestone release coming in Q4 2020
  • OpenLiberty 20.0.0.7 Beta release is available with basic Web application support to download
  • Apache TomEE 9.0 milestone release using Eclipse Transformer project tools is available to download
  • WildFly 21 is planning a milestone release for fall 2020
  • Piranha Micro p20.6.1 milestone release is available to download.

While the Jakarta EE 9 tooling release doesn’t include new features, it’s a very important and necessary step on the road to Jakarta EE 10 and the next era of innovation using cloud native technologies for Java. With the full Jakarta EE 9 release in fall this year, Jakarta EE will be ideally positioned to drive true open source, cloud native innovation using Java.

Diversity, Achieved

One of the items that I am particularly happy about is the achievement of establishing Jakarta EE as a vendor-neutral, community-led technology platform. When we started the process of moving Java EE from Oracle to the Eclipse Foundation there were some who doubted that it could be accomplished successfully. The numbers tell the story: Oracle’s contributions are still leading the pack at 27%, but the community-at-large is

JakartEEDev v2
now over 40%. Contributions from our other members are led by Payara, VMware (Pivotal), Red Hat, and IBM. Based on these results, it is clear that Jakarta EE has truly achieved its original objective of becoming a vendor-neutral, community-led industry initiative. A lot of people worked very hard to achieve this, and I’m thrilled by the results.

Discover Jakarta EE

Here are three ways to learn more about Jakarta EE and understand why it’s gaining mainstream adoption so quickly:

  • Join the community at the Jakarta EE 9 Milestone Release Virtual Party and networking opportunity on Tuesday, June 23 at 11:00 a.m. EDT. To register for the event, click here.
  • Find out more about the Jakarta EE 9 milestone release here.
  • Review the complete 2020 Jakarta EE Survey results here.

Edit: Reflect IBM’s contributions
Edit #2: Add link to Apache TomEE download


by Mike Milinkovich at June 23, 2020 11:03 AM

Jakarta EE 9 Milestone and Apache TomEE 9.0.0 M1

by David Blevins at June 23, 2020 09:35 AM

Today the new jakarta namespace enters our lives at mass scale with the release of Jakarta EE 9 Milestone 1.

This Milestone release not only includes over 30 specifications, APIs and TCKs migrated from javax to jakarta, but also several implementations including Apache Tomcat 10.0.0-M6, Jetty 11.0.0-alpha0, OpenLiberty 20.0.0.7-beta and many more all supporting the `jakarta` namespace.

As a proud member of the Apache TomEE community we’re of course very excited to also announce the release of Apache TomEE 9.0.0 M1 supporting the new jakarta namespace.

Faster Through Tooling (technical)

A major challenge of this namespace change is impact in maintenance. Once you change your code over from javax-to-jakarta you can no longer use simple git merges to move fixes between branches. Any attempt to backport a patch would most likely result in a merge conflict where javax-to-jakarta namespace migrations have occurred.

In the Apache TomEE community several of us have been solving this problem at the bytecode level using two tools primarily: the Eclipse Transformer, the TomEE Patch Plugin.

The Eclipse Transformer is a bytecode transformation tool originally prototyped by BJ Hargrave using BND to specialize in the javax-to-jakarta namespace change. Intended as a way to migrate applications, we’ve been stretching the limits putting it to use to transform the entire Apache TomEE server distribution from javax-to-jakarta. We’re proud to now be one of the contributors to the project with special thanks to our own Jonathan Gallimore for his contribution of a Maven Plugin and several fixes. We’re excited about the strength this codebase is showing in solving this very difficult problem.

The TomEE Patch Plugin is a supplemental bytecode transformation tool we’ve been working on in the TomEE community based on ASM to handle edge cases where find/replace is not possible and arbitrary edits are needed. It’s currently applying about 16 very targeted patches to third-party libraries to account for specific needs in the namespace transition.

Throughout the process we’ve been using tools in ASM to express bytecode as text (ASMifier) so we can audit all 147,182 files across the four TomEE zip files as text. We checked all that text into git so on each change to the Eclipse Transformer or TomEE Patch Plugin that introduces new bytecode, we can spit it back to text, commit it to git and get a full diff in Github providing 100% visibility on any change to any class or file in any jar over all our distributions. In the end, it’s like working with source code.

After several weeks of work we were able to achieve what appears to be a 90% pass rate on the Jakarta EE 9 Milestone 1 Web Profile TCK.

Jakarta EE 8 and Jakarta EE 9 in parallel

While tales of bytecode are either very exciting or very boring for you, the most important win is that we will be able to work on and support Jakarta EE 8 compliance (javax.*) and Jakarta EE 9 compliance (jakarta.*) at the same time in the same codebase. No branches. No forks. No merge-conflict hell. Just two separate binaries from the same source; TomEE 8x for javax users: TomEE 9x for jakarta users.

Apache TomEE has been behind on achieving Jakarta EE 8 Web Profile TCK compliance and this technique not only allows us to keep this focus, but to pursue eventual Jakarta EE 9 compliance essentially for free. We are very hopeful to see a Jakarta EE 8 and Jakarta EE 9 certified distribution a few months after the Jakarta EE 9 final release in fall 2020.

Paving the Way

The effort we’re going through pales in comparison to the millions of affected jars and apps using the retired javax namespace built over the last 20 years. The world does not have the means to snap its fingers, increase the global workforce temporarily by 3x and do nothing but manually transform 20 years of code. The way we get through this is not by making more people, but by making more tools.

We are extremely thrilled to be on the front-line pushing the edges on tooling and techniques we will all need to unlock a successful future in the jakarta namespace. While this namespace change is an incredible challenge, it also is an incredible opportunity for innovation.

When you have a forcing function that requires change on 20 years worth of code we all use, there is no way for this tidal wave to come and go without leaving behind tremendous necessity-driven innovations in the industry. For now, we are barely even wet.

Enjoy the stone-in-the pond that is the Jakarta EE 9 Milestone release. Take hope in the good news of tools to help us all. Celebrate the exciting TomEE 9.0.0-M1 binaries as a sign of strength in our tooling story and how challenges can bring positive outcomes.

And above all, get ready because the best is yet to come.

The post Jakarta EE 9 Milestone and Apache TomEE 9.0.0 M1 appeared first on Tomitribe.


by David Blevins at June 23, 2020 09:35 AM

Choose Things That Work And Solve The Problem--an airhacks.fm episode

by admin at June 22, 2020 01:18 PM

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

The #93 airhacks.fm episode with Erik Costlow (@costlow) about:
Java, security, scanning, agents, instrumentation and productivity with Quarkus and MicroProfile.
is available for download.

by admin at June 22, 2020 01:18 PM

Hashtag Jakarta EE #25

by Ivar Grimstad at June 21, 2020 09:59 AM

Welcome to the twenty-fifth issue of Hashtag Jakarta EE!

Next week is a big week for Jakarta EE! Releasing a milesone release of Jakarta EE 9 is a big milestone for the Jakarta EE community. It’s only 9 months since Jakarta EE 8 was released, so we are on track for the release of Jakarta EE 9 in September. I’m seeing a pattern emerging here; A release cadence of one year, meaning a yearly release of Jakarta EE.

Join the Milestone Release Party on Tuesday June 23!

The major deliverable of Jakarta EE 9 is the namespace switch from javax.* to jakarta.*, so we can say that the transfer to Eclipse Foundation is now finally finalized and we can look forward to more functionality coming. The Jakarta EE Ambassadors have started creating a document with stuff they see as important to start working on.

On Wednesday June 24, the first Friends of Jakarta EE call is happening. See the details below for how to join.

I’ll finish off this post with the exciting news that AdoptOpenJDK is coming to the Eclipse Foundation where it will continue the important work of making binary distributions of OpenJDK available for free to everyone under the name Eclipse Adoptium.


by Ivar Grimstad at June 21, 2020 09:59 AM

Join us for the Payara Platform Release Overview Webinar

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at June 19, 2020 01:50 PM

We'd like to invite you to join us for the Payara Platform Release Overview Webinar on Wednesday the 24th of June at 4pm BST / 11am EST.


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at June 19, 2020 01:50 PM

Jakarta EE Community Update June 2020

by Tanja Obradovic at June 17, 2020 08:23 PM

As always, there’s a lot going on in the Jakarta EE community, but the Jakarta EE 9 milestone release is definitely the highlight!

 

Get Involved in Jakarta EE 9 Milestone Release Activities

We invite all Jakarta EE developers and Java User Group (JUG) members to help us celebrate the Jakarta EE 9 milestone release and test the software.

Please register for the Jakarta EE Milestone Release party today!

 We’ll start with the celebration. On June 23 at 11:00 EDT, we’re hosting a virtual release party for the entire Jakarta EE community. To mark the occasion, and as it is a milestone release - we’ll celebrate with a small cake - cupcake! We’re encouraging everyone to do the same, but even more so, once you start trying out the milestone release, please  make your own cupcake (recipe suggestions chocolate or vanilla), complete it with a celebratory Jakarta EE flag, and share a selfie picture of it on social media (tag it with #JakartaEE or use our handle @JakartaEE). If cupcakes are not your thing, you can take a selfie with the flag only as well! You can also use the example Twitter card below illustrates the idea.

Help ensure the Jakarta EE 9 software is ready for full release in fall 2020! You will have all details after the Milestone Release party on the June 23th, so you be able to 

·      Download the milestone release and run/ test your application and plan the work namespace changes if needed

·      Use the Eclipse Transformer project for the namespace changes. 

·      Report issues you come across

·      Also, review the Jakarta EE 9 specification documents to make sure all “Jakartafication” is done properly

_________________________________

 

Subscribe to Jakarta EE Mailing Lists

Simply scan the QR code below to choose the mailing lists you want to subscribe to. You can also access the complete listing here

_________________________________

 

Get a First-Time Contributor’s Perspective

Ken Fogel’s Jakarta Tech Talk — My First Pull Request: The Jakarta EE Examples Adventure — is ideal for anyone who is new to the Jakarta EE community and wondering how to make their first contribution.

 We have a great lineup of Jakarta Tech Talks scheduled. To stay up to date on our latest talks, visit the Jakarta Tech Talks webpage.

_________________________________

 

NEW: Friends of Jakarta EE Monthly Call

Exciting news for the Community: We have now set up Friends of Jakarta EE monthly calls that will be held on the fourth Wednesday of every month. This call is by the community, for the community. The call plays no formal role in Jakarta EE Working Group activities, it’s simply an opportunity for the community to get together virtually, set their own agenga and talk once a month.

 On this call, the people who attend are the right people, the topics discussed are the right topics, and the outcomes are the right outcomes.

 Here are the details for our first call:

·      Date: Wednesday, June 24 at 11:00 a.m. EDT

·      Agenda: https://bit.ly/2zkgQWc

·      Zoom: https://eclipse.zoom.us/j/92996495448

·      Calendar: https://bit.ly/2XKpcQa

 _________________________________

 

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 July 8 at 11:00 a.m. EDT and topics will include:

·      Update on TCK work: Scott Marlow, Cesar Hernandez

●  Jakarta EE 9 release update: Kevin Sutter

●  Tools support for Jakarta EE 9 and help from the community: Neil Patterson

●  Update from the Eclipse Foundation: Ivar Grimstad, Shabnam Mayel, Tanja Obradovic

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

·      June 10 call and presentation.

·      The complete playlist.

 _____________________________

 

Participate in Upcoming JUG Meetups

Check the list below for the JUG meetup that works best for you:

·      Niš JUG (Niš, Serbia) and MKJUG (Macedonia): Thursday, June 18 at 6:00 p.m. CEST with speaker Tanja Obradovic from the Eclipse Foundation.

·  KCJUG (Kansas City, United States): Thursday, June 18 at 5:30 p.m. CDT with speakers Kevin Sutter and Billy Korando from IBM.

 For the complete list of JUG meetups, locations, and times, click here.

 _________________________________

 

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.

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

 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 June 17, 2020 08:23 PM

Deploy Friday: E09 Spring Framework – Java in Focus

by otaviojava at June 17, 2020 12:44 PM

A Question and Answer session with guests:  Josh Long. Loiane Groner. Otavio Santana. Robert Douglass. Spring Framework is by far the most popular framework for writing Java applications. Why is Spring so dominant, and how will it hold its ground against newer frameworks? We’ll ask our guests those and other questions on this week’s Deploy […]

by otaviojava at June 17, 2020 12:44 PM

Changes to Payara Platform Community Versioning System

by Debbie Hoffman at June 17, 2020 12:30 PM

As the recent June release (download here!) marks the first official release since splitting our product into two separate software editions, Payara Platform Enterprise and Payara Platform Community, you may notice the versioning has been updated.


by Debbie Hoffman at June 17, 2020 12:30 PM

The New Release of Payara Platform is Here!

by Matthew Gill at June 16, 2020 01:00 PM

We're happy to announce that Payara Platform Community (5.2020.2) and Payara Platform Enterprise (5.20.0) Editions are out today! The Community Release includes 28 bug fixes, 13 improvements, 3 new features, and 5 component upgrades. You can download it here! 

Here's some detail of what's included in the 5.2020.2 Community release:


by Matthew Gill at June 16, 2020 01:00 PM

Java Text Blocks – Using Multiline Strings with Hibernate & JPA

by Thorben Janssen at June 16, 2020 12:00 PM

The post Java Text Blocks – Using Multiline Strings with Hibernate & JPA appeared first on Thorben Janssen.

JPA and Hibernate require you to write lots of Strings. You use them to create ad-hoc and named queries with JPQL, to define native SQL queries and to specify the fetching behavior in an EntityGraph. Until Java 13, the lack of multiline Strings in Java made all of these tasks either annoying to implement or […]

The post Java Text Blocks – Using Multiline Strings with Hibernate & JPA appeared first on Thorben Janssen.


by Thorben Janssen at June 16, 2020 12:00 PM

Upcoming JUGs, Online Conferences, Virtual Workshops

by admin at June 16, 2020 07:31 AM

  1. Von Java Entwickler zu Web (Components) / PWA / SPA Guru [online event]
    JUG Oberpfalz session 17 Jun 2020 https://www.meetup.com/JUG-Oberpfalz/events/268801392/
  2. IBM Cloud Dev: Productivity without Drawbacks and Esoterics with MicroProfile and Jakarta EE #slideless [online event]
    free conference session 18 Jun 2020 https://ibm-clouddev.bemyapp.com
  3. Web For Java Devs [online event]
    JUG Switzerland session 25 Jun 2020 https://www.jug.ch/eventpreview.php?id=701
  4. jpoint: Ignoring fashion trends with Jakarta EE and MicroProfile [online event]
    jpoint conference session 30 Jun 2020 https://jpoint.ru/en/2020/talks/6m2ous2iilbdqr0odnikl6/
  5. building applications with native web components, redux and lit-html [online event]
    live virtual workshop 9 Jul 2020 https://airhacks.live

NEW: airhacks events are also available from: meetup.com/airhacks/


by admin at June 16, 2020 07:31 AM

What’s Coming in Payara Enterprise 5.20.0: Integrated TLS Certificate Management

by Andrew Pielage at June 15, 2020 01:42 PM

Integrated TLS Certificate Management  is the first feature added to Payara Server Enterprise (coming soon!) since the Payara Platform was split into Payara Community and Payara Enterprise Editions. 
 

by Andrew Pielage at June 15, 2020 01:42 PM

Hashtag Jakarta EE #24

by Ivar Grimstad at June 14, 2020 09:59 AM

Welcome to the twenty-fourth issue of Hashtag Jakarta EE!

This has been a week of meetings. In addition to the regular Jakarta EE and MicroProfile calls, we also had the public JCP Executive Committee Meeting on Tuesday. The topic of this call was Java in Education. The presentation concludes with a callout to Java User Groups around the World to reach out to students and faculty in computer science programs and encourage them to join your JUG. Useful tips are to hold a JUG meeting on campus as well as arrange seminars specifically targeting teachers/professors to get them involved.

Wednesday, it was time for the monthly Jakarta EE Update Call, where we got an update on the TCK Work from Scott Marlow and Cesar Hernandes, Jakarta EE 9 release update from Kevin Sutter as well as an update around Tools support for Jakarta EE 9 from Neil Patterson.

We also had the pleasure to announced the Friends of Jakarta EE Monthly Call. The details for how to join this call can be found below.

I am looking very much forward to the first call on June 24 and see what can come out of this initiative!


by Ivar Grimstad at June 14, 2020 09:59 AM

Quickly Grow Your Java application in the Cloud With Platform.sh

by otaviojava at June 11, 2020 02:34 PM

Moving to the cloud and scaling applications is a top priority for many businesses. However, migrating on-premise code to the cloud isn’t always easy, especially because Infrastructure-as-a-Service (IaaS), for example, does not eliminate the maintenance of databases, performing backups, etc. In this webinar you will learn how you can quickly grow your Java application in […]

by otaviojava at June 11, 2020 02:34 PM

Register Now for Coherence CE and Helidon 2.0 Webinars on June 25

by Will Lyons at June 10, 2020 05:15 PM

We hope you have been tracking the steady progress being made on delivery of Eclipse GlassFish 6.0 and Jakarta EE 9.   One of the major consumers of GlassFish component technologies is Helidon, a set of Java libraries for developing microservices, that leverages existing Eclipse GlassFish 5.1 components, along with Jakarta EE and MicroProfile APIs.   Helidon is lightweight, fast, and easy to use by Java SE, Java EE and Jakarta EE developers building microservices.   In two webinars delivered on June 25th, one for Asia-Pacific timezones, and one for Europe, Middle East, Africa and Americas timezones, we will be introducing Helidon 2.0 with exciting new features and capabilities for microservices delivered on-premises, or on Oracle Cloud, and with the Oracle Database and Database Cloud Services.

We will also be introducing Coherence CE.   You may be familiar with Oracle Coherence as the leading In-Memory Data Grid technology.  Oracle Coherence provides a highly reliable, scalable and performant data store that can be accessed by Java EE and Jakarta EE applications and polyglot microservices, and that also provides in memory processing of data stored in a massively scalable data grid.   Developers of traditional Java EE and Jakarta EE applications, and developers of lightweight microservices that must meet enterprise reliability, scalability and performance requirements will be very interested in what we have to say about Coherence CE, including demonstrations of how it can be used with Helidon 2.0 and GraalVM in innovative ways.

Please register now for one of these webinars, at the time that works for you.

June 25, 2020, Webinar for Asia-Pacific time zones

June 25, 2020, Webinar for Europe, Middle East, Africa and Americas time zones

Looking forward to seeing you there.


by Will Lyons at June 10, 2020 05:15 PM

In the June Release of Payara Platform: MicroProfile 3.3 Compatibility

by Jan Bernitt at June 10, 2020 09:25 AM

With the June Payara Platform releases, Payara Platform will support version 3.3 of the MicroProfile (MP) standard. This blog summarises what changed since 3.2 and how this affects the Payara Platform.


by Jan Bernitt at June 10, 2020 09:25 AM

Java Records – How to use them with Hibernate and JPA

by Thorben Janssen at June 09, 2020 12:05 PM

The post Java Records – How to use them with Hibernate and JPA appeared first on Thorben Janssen.

A lot of developers complain that Java is too verbose. And I can understand that, especially for all classes that are supposed to be a basic data structure, like JPA/Hibernate entities or DTOs. So, it was no surprise that I got a lot of questions about JDK’s records feature and how you can use it […]

The post Java Records – How to use them with Hibernate and JPA appeared first on Thorben Janssen.


by Thorben Janssen at June 09, 2020 12:05 PM

Hibernate’s ResultTransformer in Hibernate 4, 5 & 6

by Thorben Janssen at June 09, 2020 12:00 PM

The post Hibernate’s ResultTransformer in Hibernate 4, 5 & 6 appeared first on Thorben Janssen.

Hibernate implements JPA’s standardized constructor expressions and @SqlResultSetMappings to map the results of your queries. And it also supports proprietary ResultTransformers. They provide a powerful and flexible way to map the result of your JPQL, Criteria, and native SQL query to a specific object structure. This can be entity or DTO objects, java.util.List or java.util.Map […]

The post Hibernate’s ResultTransformer in Hibernate 4, 5 & 6 appeared first on Thorben Janssen.


by Thorben Janssen at June 09, 2020 12:00 PM

Deploy Friday: E06 Quarkus Supersonic Subatomic Java

by otaviojava at June 08, 2020 04:18 PM

A Question and Answer session with guests:  Karina M. Varela Edson Yanaga Burr Sutter Otavio Santana Robert Douglass Try Quarkus on Platform.sh: https://bit.ly/3bBUmNs More resources: https://community.platform.sh/t/quarkus-for-platform-sh/564

by otaviojava at June 08, 2020 04:18 PM

Payara Platform Release Stream and Software Changes

by Debbie Hoffman at June 08, 2020 11:15 AM

Starting with our June 2020 release (coming soon!), we’re rolling out separate editions of Payara Server and Payara Micro - collectively known as the Payara Platform.


by Debbie Hoffman at June 08, 2020 11:15 AM

Hashtag Jakarta EE #23

by Ivar Grimstad at June 07, 2020 09:59 AM

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

This week, I started a series of Community Chats on the Studio Jakarta EE YouTube Channel. The first chat was with Ken Fogel. You can see the entire chat in the video below.

https://youtu.be/ny6of9zK6kA

Don’t hesitate to reach out to me if you are interested in participating in a Jakarta EE Community Chat! It is, as you see, very informal and low key.

We are making progress with Jakarta EE 9. The platform specification is almost done as you can see in this issue. The Milestone release is just around the corner and we are planning to host a release party to celebrate this milestone (pun intended 🙂). Stay tuned for updates by following JakartaEE and/or me on Twitter.


by Ivar Grimstad at June 07, 2020 09:59 AM

Bolivia JUG April 2020 Meetup

by Cesar Hernandez at June 03, 2020 02:02 PM

In April 2020, the Bolivia Java User Group held a virtual meetup with Latin American JUG’s participants. The event covered Java cloud-native and microservice development, infrastructure, and contribution to the Open Source ecosystem distributed in three sessions:

It’s Easy! Contributing to Open Source

César Hernández, from Guatemala JUG, provided a session about how to contribute and become a valuable part of any open source community. Examples of how to learn and apply soft and hard skills were presented based on Eclipse MicroProfile and Apache TomEE Open Source projects. Attendees were able to learn how to access and navigate the culture of open source projects, understand expected behaviors and attitudes toward new contributors; how to start small, take risks, ask lots of questions; and how to get started with standard open-source tools like Maven, Git, and JIRA.

 

Video [Spanish]

 

 

Architecting Cloud Computing Solutions in Java

Otavio Santana, from SouJava Brazillian community, presented the advantages and challenges cloud computing brings to existing and new architectures along with a step-by-step guide to guide you through implementing Cloud computing services effectively and efficiently.

 

Video [Spanish]

 

Deploying Java Applications to Azure

Reza Rahman, from Philadelphia JUG, conducted a demo-driven session that showed the many ways of effectively deploying a Java EE application to IaaS, PaaS, Docker and Kubernetes Azure services. During the session, attendees discussed the trade-offs of each approach and offered guidelines to deploy applications on the cloud. 

 

Video [English]

 

 

The post Bolivia JUG April 2020 Meetup appeared first on Tomitribe.


by Cesar Hernandez at June 03, 2020 02:02 PM

The Payara Monthly Catch for May 2020

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at June 01, 2020 12:00 PM

 

Alot went down in May! notably Java's 25th anniversary and a whole swathe of articles, webinars and podcasts that went with it! It felt like there was a webinar everyday!

Below you will find a curated list of some of the most interesting news, articles and videos from the last month. Cant wait until the end of the month? then visit our twitter page where we post all these articles as we find them! 


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at June 01, 2020 12:00 PM

Hashtag Jakarta EE #22

by Ivar Grimstad at May 31, 2020 09:59 AM

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

The work with Jakarta EE 9 is progressing, and we are looking forward to a milestone release at the end of June. There are so many moving parts in putting such a release together. All help is appreciated!

Here is a Jakarta EE 9 tracking sheet distributed on the Jakarta EE Ambassadors mailing list by Theodor Augustin Dumitrescuheo.

Jakarta MVC has been adopted by SOUJava. We encourage Java User Groups all over the world to participate in the Adopt-a-Spec program.

To wrap it up, here is a recording of a chat I had with Armel Nene on his #OffTheChain podcast last week.

#OffTheChain with Ivar Grimstad

by Ivar Grimstad at May 31, 2020 09:59 AM

Deploy Friday: E05 Open Source and Personal Networking for an Amazing Career

by otaviojava at May 28, 2020 11:54 AM

A Question and Answer session with guests:  Otavio Santana  Bruno Souza  Yara Senger  Robert Douglass

by otaviojava at May 28, 2020 11:54 AM

Quickly grow your Java application in the cloud with Platform.sh

by otaviojava at May 26, 2020 12:25 PM

Moving to the cloud and scaling applications is a top priority for many businesses. However, migrating on-premise code to the cloud isn’t always easy, especially because Infrastructure-as-a-Service (IaaS), for example, does not eliminate the maintenance of databases, performing backups, etc. In this webinar you will learn how you can quickly grow your Java application in […]

by otaviojava at May 26, 2020 12:25 PM

Cloud and an Architectural Perspective Between Risk and Services

by otaviojava at May 25, 2020 10:22 AM

In this article, we discuss the various risks associated with different type of application architecture in the cloud. https://dzone.com/articles/cloud-and-an-architectural-perspective-between-ris

by otaviojava at May 25, 2020 10:22 AM

Hashtag Jakarta EE #21

by Ivar Grimstad at May 24, 2020 09:59 AM

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

It is tempting to jump a couple of numbers and call this hashtag issue number 25 to match the 25 year anniversary or Java. But I decided that I will stay true to the numbering scheme to avoid confusion and leave the craziness to when we are celebrating 25 years of Jakarta EE…

The Jakarta EE Working Group elections have completed. The newly elected committee members are as follows:

Steering Committee
Participant Member: Martijn Verburg
Committer Member: Arjan Tijms

Specification Committee
Participant Member: Marcelo Ancelmo
Committer Member: Werner Keil

Marketing Committee
Participant Member: Wei Yong Sen
Committer Member: VACANT

Jakarta MVC was approved by the Specification Committee and is now listed among the other Jakarta EE specifications. As soon as the final paperwork has been processed and the project fully provisioned, we will make the initial contribution and immediately start planning for the first release under Jakarta EE which will be Jakarta MVC 1.1.


by Ivar Grimstad at May 24, 2020 09:59 AM

25 Years of Java!

by Ivar Grimstad at May 23, 2020 07:21 AM

25 years and still going strong! Java is everywhere. It is the #1 programming language in the World. And it continues to evolve! Java has been a part of my entire professional career. Let’s get together and celebrate the past 25 years and look ahead for the next 25!

My #movedbyJava timeline

1996: Wrote my first Hello, World! in Java
1998: Started my professional career as a Java programmer
1999: My first JavaOne
2007: Joined the Java Community Process (JCP)
2013: First time presenting at JavaOne
2016: Became Java Champion
2016: Elected into the JCP Executive Committee
2016: Got a Duke tattoo
2020: Still coding Java


by Ivar Grimstad at May 23, 2020 07:21 AM

Jakarta EE 2020 Working Group Committee Elections Results are here!

by Tanja Obradovic at May 20, 2020 07:21 PM

We are very excited to announce the 2020-21 elected representatives!

This year, we used a secure online voting system to elect new members to the three Jakarta EE Working Group committees — Steering, Specification, Marketing and Branding. Email ballots were sent to the company representative for each Jakarta EE member company and to Jakarta EE committer members. The voting period was open May 1and closed on Friday, May 15, 2020. Results are now available!

The elected representatives for the Jakarta EE Committees are:

Committee

Participant Member Candidates

Committer Member Candidates

Steering

Martijn Verburg

Arjan Tijms

Specification

Marcelo Ancelmo

Werner Keil*

Marketing and Brand

Wei Yong Sen*

N/A

* Acclaimed to the role as the only candidate.

For each Participant Representative in the Committees 50% voted, and for the Committer Representative 23% voted.

Congratulations to those who have been elected and thanks to everyone who participated and voted in the election!


by Tanja Obradovic at May 20, 2020 07:21 PM

10 YouTube Channels You Should Follow in 2020

by Thorben Janssen at May 19, 2020 12:00 PM

The post 10 YouTube Channels You Should Follow in 2020 appeared first on Thorben Janssen.

For the last 2 years, I have shared a list of the Java-related YouTube channels that I find the most enjoyable or useful. And based on the popularity of these articles, it seems like I’m not the only one who enjoys watching good lectures and conference talks on YouTube. That’s especially the case in the […]

The post 10 YouTube Channels You Should Follow in 2020 appeared first on Thorben Janssen.


by Thorben Janssen at May 19, 2020 12:00 PM

Keeping Brazil’s Medical Industry Safe with MicroProfile & JakartaEE – Jakarta Tech Talks

by Cesar Hernandez at May 19, 2020 09:31 AM

At Oracle Code One 2019  Rafael Guimares, Otavio Santana, and I presented this 45 minutes session for the first time. We provided a case of cloud migration and modernization of a widely use monolithic system with the help of MicroProfile, Jakarta EE, TomEEand Tribestream API Gateway in the Brazilian medical Industry that involved several challenges such as the fifth-largest population and largest territory in the world; technical complexity; and diversity, both geographic and economic.

At the beginning of 2020, we were invited via the Jakarta EE Community Forum signed up sheet here to present the session as part of the Jakarta Tech Talk series. Then, we did not anticipate the turn around the world would be in due to the COVID-19 pandemic and the role Java technologies would be playing to help the Brazil’s medical Industry. 

The revised session covers how the modern architecture is being used in the base systems allowing a quick timing and agile technical response to implement a series of new services for the Brazillian medical industry in response to the COVID-19 pandemic that involved population, pharmacies, medical research databases, doctors, and government agencies. Security and B2B integrations, scalability, and monitoring were critical baselines that allowed complex service development within a time frame of 5 days.

 

The 1hr video from the session is available HERE 


If you are interested in learning more about Jakarta EE, catch up via its youtube channel and subscribe to its mailing lists here

The post Keeping Brazil’s Medical Industry Safe with MicroProfile & JakartaEE – Jakarta Tech Talks appeared first on Tomitribe.


by Cesar Hernandez at May 19, 2020 09:31 AM

Jakarta EE Community Update May 2020

by Tanja Obradovic at May 17, 2020 03:20 PM

Jakarta EE 2020 Working Group Committee Elections

With just a few days until the Jakarta EE election results are announced on May 21, I want to start this month’s newsletter with a quick update on the overall process.

This year, we used a secure online voting system to elect new members to the three Jakarta EE Working Group committees — Steering, Specification, Marketing and Brand. Email ballots were sent to the company representative for each Jakarta EE member company and to Jakarta EE committer members. The voting period was open May 1-15. Results are tabulated by the system and remain anonymous.

 The table below lists the candidates and provides links to their biographies. Thank you to all candidates for your interest and participation!

Committee

Participant Member Candidates

Committer Member Candidates

Steering

Martijn Verburg

Jeff Zhang

Otavio Santana

Arjan Tijms

Specification

Marcelo Ancelmo

Patrick Huang

Werner Keil*

Marketing and Brand

Wei Yong Sen*

N/A

* Acclaimed to the role as the only candidate.

For a list of the winning candidates, keep an eye on our social media posts, mailing lists, and my June Jakarta EE update blog.

 _________________________________

 Thank you for your participation in the 2020 Jakarta EE Developer Survey

Thank you to everyone who took the time to participate in the 2020 Jakarta EE Developer Survey. We had great community engagement, and received more than 2,100 responses from developers around the world.

With your input, everyone in the Java ecosystem will have a better understanding of how the cloud native world for enterprise Java is unfolding and what that means for their strategies and businesses. And the Jakarta EE community will have a better understanding of developers’ top priorities for future Jakarta EE releases.

Stay tuned for the survey results in late June.

_________________________________

JakartaOne Livestream CN4J Replays Are Available Online

We hosted a very successful JakartaOne Livestream Cloud Native for Java (CN4J) event on May 12, with eight hours of great content, including two keynotes, and seven technical talks.

 The virtual event featured a mix of interesting talks, demos, and thought-provoking discussions focused on enterprise applications implemented using Jakarta EE and Eclipse MicroProfile specifications on Kubernetes. The complete event agenda is available here.

 So far, about 550 people have registered to watch the sessions so we know the topics are resonating with the community. You can check out the complete playlist and register to watch session replays here.  

_________________________________

The Jakarta EE Compatible Products List Is Growing

We’re very pleased to tell you the Apusic AAS Application Server version 10.1, from Kingdee Apusic cloud computing, is now certified as a Jakarta EE 8 full platform compatible product.

 In addition, more and more applications are passing Technology Compatibility Kit (TCK) tests and are well on their way to becoming certified as Jakarta EE 8 compatible products. The Oracle WebLogic Server 14c (14.1.1) is just one great example.

 For a complete list of Jakarta EE 8 compatible products, and access to download links, visit the Jakarta EE Compatible Products webpage.

 ________________________________

 Content Resources for the Jakarta EE Presentations

If you’re creating a Jakarta EE presentation for virtual Java User Group (JUG) meetings, conferences, or other events, feel free to incorporate the information in our Jakarta EE presentation deck. We recently updated the content based on your feedback.

 Also, please let us know when and where the presentation will be made so we can promote the speaker and the event on Jakarta EE channels. You can email me directly, or use this webform to provide the event details.

For additional Jakarta EE content and programs, including Crowdcast (virtual meetup tool)  for JUGs and Jakarta EE update presentations, visit our community folder.

 _________________________________

 Get the Latest Updates on Jakarta EE 9 Progress

Keep an eye out for Steve Millidge’s article in the May community newsletter for updates on Jakarta EE 9 delivery progress. You can also check our progress here

Here is the short summary of great progress the community is making:

  • API Release Candidates available for all specs

  • Milestone implementations for all components 

  • Growing number of component TCKs

  • Eclipse GlassFish 6.0 building

  • “Nucleus” GlassFish runtime booting

  • Jersey, HK2, Grizzly and core kernel capabilities

 For additional insight into Jakarta EE 9, see the:

·      Jakarta EE Platform specification page

·      GitHub page

_________________________________

 Join Community Update Calls

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

 The next call will be June 10 at 11:00 a.m. EDT. The call in May was cancelled due to the JakartaOne Livestream event on May 12, and all key Jakarta EE news were covered in Will Lyons’ keynote.

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

·       The complete playlist.

·      April 8 call and presentation, featuring Ivar’s update on contributing to Jakarta EE 9, as well as updates on Jakarta EE events, new compatible implementations, the Jakarta EE Developer Survey, election time, and programs for JUGs from Shabnam Mayel, Tanja Obradovic, and Ivar Grimstad.

 _________________________________

 Upcoming Events

With the impact of COVID-19 on events and conferences, we’re focusing on virtual events:

·      On August 29, we’re hosting JakartaOne Livestream Brazil.

·      In September, we’ll be hosting the annual JakartaOne Livestream event and will provide details when they’re available.

_________________________________

 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

·  Youtube: Jakarta EE channel

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

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

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

 You can find the complete "Stay connected" list here.

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

 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 May 17, 2020 03:20 PM

Hashtag Jakarta EE #20

by Ivar Grimstad at May 17, 2020 09:59 AM

Welcome to the twentieth issue of Hashtag Jakarta EE!

The web page for the Starter for Jakarta EE is launched! So far, it is pretty limited, but we hope that the community can join us in making start.jakarta.ee the absolutely best place to get started with Jakarta EE.

Please check out our project pages for resources about how to get involved.

Earlier this week, we hosted the JakartaOne Livestream: Cloud Native for Java event. The talks are published on the Jakarta EE Youtube channel.

I also recorded a short video showing how to check the third-party dependencies with a tool called dash-licences. The tool is developed by Wayne Beaton and he describes the background for it in his blog post Revising the Eclipse Due Diligence Process for Third Party Content.

Never Stop Learning

If you’re not tired by now, read this interview of me by Bob Rhubart that was published earlier this week.


by Ivar Grimstad at May 17, 2020 09:59 AM

Back to the top

Submit your event

If you have a community event you would like listed on our events page, please fill out and submit the Event Request form.

Submit Event