Skip to main content

Payara Platform October 2020 Roadmap Update

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

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


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

Java is #2 / #3 in September 2020

by admin at September 24, 2020 04:16 AM

According to TIOBE Index for September 2020: C is #1 (15.95%,+0.74%), Java is #2 (13.48%, -3.18%) and Python is #3 (10.47%,+0.59%).

The most popular JVM-based language is Groovy with #17 and -0.52%, 0.99% [Source: TIOBE Index for January]

On github (number of pull requests) Java is #3: 10.731% (+0.250%), after Python: 16.108% (-1.694%) and JavaScript 18.789% (-1.133%). C is #10 3.320% (+0.130%).


by admin at September 24, 2020 04:16 AM

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

September 23, 2020 12:00 AM

shell11

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

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

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

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

A Management Information System (MIS)

Nabenik MIS

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

Mobile POS and Geo-fence

Medmigo REP

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

Why should I ever consider migrating to Java 11?

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

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

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

From my experience with many teams, because of this:

Changes in Java release cadence

Java Release Cadence

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

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

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

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

Usage of internal APIs

Java 9

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

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

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

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

However, you are inside the danger zone if:

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

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

Removal of CORBA and Java EE modules from OpenJDK

JEP230

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

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

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

IDEs and application servers

Eclipse

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

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

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

How do I update?

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

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

Verify server compatibility

Tomcat

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

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

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

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

Verify if you need an specific JVM

FixesJDK15

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

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

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

Configure your development environment to support multiple JDKs

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

SDKMan

sdkman

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

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

jEnv

jenv

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

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

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

Verify your IDE compatibility and update

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

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

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

Update Maven and Maven projects

maven

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

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

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

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

Which includes a specific goal to verify Maven plugins versions:

mvn versions:display-plugin-updates

mavenversions

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

As properties:

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

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

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

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

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

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

Update project dependencies

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

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

mvn versions:display-dependency-updates

mavendependency

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

Include Java/Jakarta EE dependencies

jakarta

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

You must include as dependency:

  • API definition
  • Reference Implementation (if needed)

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

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

We could swap the Java EE API:

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

For Jakarta EE API:

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

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

Java Beans Activation

Java EE

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

Jakarta EE

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

JAXB (Java XML Binding)

Java EE

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

Jakarta EE

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

Implementation

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

JAX-WS

Java EE

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

Jakarta EE

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

Implementation (runtime)

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

Implementation (standalone)

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

Java Annotation

Java EE

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

Jakarta EE

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

Java Transaction

Java EE

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

Jakarta EE

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

CORBA

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

Multiple JVMs in production

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

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

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

olinux

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

hotspot

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

dockerjava


September 23, 2020 12:00 AM

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

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

Hey guys!

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

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

CU!


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

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

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

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

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

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

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

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

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

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

 

Register for EclipseCon 2020 Today

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

Get all the registration details and register now.

 For event details, visit eclipsecon.org/2020.

To join the EclipseCon conversation and get the latest updates:

·      Use #EclipseCon on social media

·      Follow @EclipseCon on Twitter

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

·      Community Day events

·      Tips to get the most out of EclipseCon


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

Hibernate’s Query APIs

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

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

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

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


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

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

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

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


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

The Open-Closed Principle and Lots of Magic--airhacks.fm podcast

by admin at September 20, 2020 06:25 PM

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

The #106 airhacks.fm episode with Lincoln Baxter III (@lincolnthree) about:
writing business Java applications, design patterns discussion, code abstractions, Java Server Faces, the simplicity of Java EE 5, PrettyFaces, PrettyTime and enjoying Magic
is available for download.

by admin at September 20, 2020 06:25 PM

Hashtag Jakarta EE #38

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

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

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

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

Jakarta Server Pages
Jakarta Standard Tag Library
Jakarta Server Faces

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

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

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

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

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


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

Java Language Evolution

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

Hey guys! How’s it going?

This is not your dad’s Java anymore!

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

Stay safe and… Party on!

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

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

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

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

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

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

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

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

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


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

CyberJUG-HH: Why is everybody talking about Quarkus?

by admin at September 19, 2020 05:16 AM

In this (Why is everybody talking about Quarkus?) Java User Group Hamburg (CyberJUG-HH) session I highlighted possible reasons for Quarkus' popularity, explained Quarkus' optimisation tricks, the differences between Jakarta EE / J2EE / Java EE application servers and Quarkus, discussed the role of MicroProfile and Jakarta EE, migrated a Java EE application to Quarkus, performed multiple deployments, decompiled some code, measured memory consumption and finally cross compiled the Java service to native code using GraalVM:


by admin at September 19, 2020 05:16 AM

Jakarta EE Community Update September 2020

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

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

The Jakarta EE Working Group Is Growing

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

Welcome to the Jakarta EE Working Group, Jelastic!

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

 

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

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

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

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

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

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

 

We Have a Jakarta EE 9 Final Release Date

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

 

Save the Date: JakartaOne Livestream Is December 8

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

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

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

Stay tuned for registration details. In the meantime:

·  Visit the JakartaOne Livestream website

·  Submit a paper

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

 

JakartaOne Livestream — Brazil: Watch the Replay

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

 To see the session topics, click here.

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

 

Upcoming Events 

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

September 19: Delhi and NCR JUG Talk

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

·  Time: 6:00 p.m. IST

·  Details and registration: Delhi and NCR JUG Meetup site

·  Twitter: twitter.com/DelhiJUG

October 12: JakartaOne Livestream — Español

·  Event details: jakartaone.org/2020/hispano

·  Registration: Register through Crowdcast

·  Sessions are in Spanish

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

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

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

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

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

 

Join Community Update Calls

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

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

Topics will include:

·  Progress update on Jakarta EE 9 release

·  New on Jakarta EE 9 from Eclipse Foundation

·  Topics and questions from the community

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

·  September call presentations

·  The complete playlist

 

Stay Connected With the Jakarta EE Community

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

·  Social media: Twitter, Facebook, LinkedIn Group

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

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

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

 You can find the complete list of channels, here.

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

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


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

Payara, the Unknown protocol: RFB and the Solution

by admin at September 18, 2020 04:28 AM

Macs are using port 5900 for screen sharing, often also used by video conferencing software like Skype or Microsoft Teams.

Payara uses the same port 5900 for the hazelcast grid as starting port. At collision, payara won't start and complain with:


[#|...|WARNING|Payara 5.201|com.hazelcast.nio.tcp.TcpIpConnection|_ThreadID=108;_ThreadName=hz._hzInstance_1_development.IO.thread-in-1;_TimeMillis=1600401135525;_LevelValue=900;|
[...]:4900 [development] [3.12.6] Connection[id=5, /...:63015->/...:5900, qualifier=null, endpoint=[...]:5900, alive=false, type=NONE] closed. 
Reason: Exception in Connection[id=5, /...:63015->/...:5900, qualifier=null, endpoint=[...]:5900, alive=true, type=NONE], thread=hz._hzInstance_1_development.IO.thread-in-1
java.lang.IllegalStateException: Unknown protocol: RFB
    at com.hazelcast.nio.tcp.UnifiedProtocolDecoder.onRead(UnifiedProtocolDecoder.java:107)
    at com.hazelcast.internal.networking.nio.NioInboundPipeline.process(NioInboundPipeline.java:135)
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKey(NioThread.java:369)
    at com.hazelcast.internal.networking.nio.NioThread.processSelectionKeys(NioThread.java:354)
    at com.hazelcast.internal.networking.nio.NioThread.selectLoop(NioThread.java:280)
    at com.hazelcast.internal.networking.nio.NioThread.run(NioThread.java:235)
|#]
    The DAS was stopped    

Solution

  1. Disable screen sharing in "System Preferences->Sharing->Screen Sharing" or:
  2. Change Payara's port by replacing in $PAYARA_HOME/glassfish/domains/domain1/domain.xml the line <hazelcast-runtime-configuration></hazelcast-runtime-configuration> with <hazelcast-runtime-configuration start-port="59000"></hazelcast-runtime-configuration>. Now Payara will use the port 59000 instead of 5900

by admin at September 18, 2020 04:28 AM

Serverless Java #slideless -- Guild42 Session Recordings

by admin at September 17, 2020 03:06 AM

The live, on-stage hacking Guild42 session "Serverless Java #slideless" featuring: fnproject.io, microprofile.io, quarkus.io and several Java (openJDK) and native (GraalVM) deployments to AWS Lambda is available:


by admin at September 17, 2020 03:06 AM

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

by otaviojava at September 16, 2020 01:34 PM

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

by otaviojava at September 16, 2020 01:34 PM

openJDK 11 RAM and Startup Time: openJ9 vs. HotSpot

by admin at September 16, 2020 04:29 AM

openJ9 vs HotSpot: ~48% less memory consumption and ~28% faster startup:


by admin at September 16, 2020 04:29 AM

Pagination with JPA and Hibernate

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

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

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

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


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

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

by otaviojava at September 14, 2020 03:44 PM

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

by otaviojava at September 14, 2020 03:44 PM

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

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

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


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

Hashtag Jakarta EE #37

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

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

This week’s status pie for the Jakarta EE 9 specifications shows that five specifications have been approved, five are ongoing and ten are near being ready for ballot. All the five ongoing ballots will close this upcoming week.

The number of specifications not ready is shrinking, but there are still fifteen that are not ready yet. Out of these, the following four specifications have not created a Pull Request yet:

Jakarta Server Pages
Jakarta Connectors
Jakarta Standard Tag Library
Jakarta Server Faces

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

This Saturday, I hosted a MicroProfile workshop at the JavaDay Istanbul virtual conference. I had a blast during this two-hour live coding session, and I hope the participants enjoyed it as much as I did.

On Wednesday, It is my turn to do a Jakarta Tech Talk. In this talk, I will present the current status of Jakarta MVC. Of course, there will be live coding as well.

In the end, I want to remind you about the JCP 2020 Community Virtual Party & Awards Ceremony on Friday, Sep 18, 2020. This legendary party, usually held in conjunction with Oracle Code One is something you don’t want to miss.


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

How To Bring Your Java Microservices To The Cloud

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

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

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

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


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

A VERY BAD Decision – The Two Minutes Tuesday 006

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

Hey guys!

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

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

CU!


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

A tiny plug-in based CLI framework ontop of jCommander

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

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


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

Five good reasons to use PaaS in your Java Application

by otaviojava at September 08, 2020 04:44 PM

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

by otaviojava at September 08, 2020 04:44 PM

How to change an attribute before INSERT and UPDATE

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

The post How to change an attribute before INSERT and UPDATE appeared first on Thorben Janssen.

In a comment here on the blog, Mehmet asked how he could call a function before inserting or updating an entity in the database. There are several ways you can call a function as part of an SQL INSERT or UPDATE statement. But these are not your only options. To change an attribute’s value before […]

The post How to change an attribute before INSERT and UPDATE appeared first on Thorben Janssen.


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

Hashtag Jakarta EE #36

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

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

This week’s status of the ballots for the Jakarta EE 9 specifications is that there are still three passed, but now there are seven ongoing ballots. Of these seven, two will close this week. Some of those that are close to being ready for ballots will most likely start this week.

Make sure to join the Jakarta EE Community Call on Thursday, September 10 to learn more about the ballots and other Jakarta EE related topics.

We are in the process of planning a Jakarta EE Virtual Tour where we will visit Java User Groups around the World virtually with talks about Jakarta EE. More information about this will be announced shortly, so stay tuned!


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

Multi-Release Jars Made Easy

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

Hey guys! How’s it going?

Multi-Release Jars allow to deliver a fully backwards compatible archive which uses the best implementation for each Java release. In this video I will show you how easy you create it using Maven.

Stay safe and… Party on!


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

The Payara Monthly Catch for August 2020

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

 

I hope you enjoy this month's catch. You may notice I made an effort to try and search for content by authors we had not featured before (and are a little less known), as well as including a few of our prolific favourites. There was also a slight lean towards Kubernetes themed content this month as well.

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


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

Moving your application to Java 11 in the cloud ages

by otaviojava at September 01, 2020 03:05 PM

Java is celebrating 25 years, and with these two decades of improvement comes to the challenge of keeping the JVM updated to continue enjoying all its benefits. Platform.sh provides an easy way to upgrade the JVM, as shown in the video above. Beyond Java 11, Platform.sh has templates for some of the most popular frameworks, […]

by otaviojava at September 01, 2020 03:05 PM

Composite Repositories – Extend your Spring Data JPA Repository

by Thorben Janssen at September 01, 2020 10:08 AM

The post Composite Repositories – Extend your Spring Data JPA Repository appeared first on Thorben Janssen.

Almost all applications have at least a few uses cases that require complex database operations. You can’t define them using a few annotations in a Spring Data JPA repository. You need to create a composite repository. Whenever derived or custom queries are not powerful or flexible enough, you can add your own methods to your […]

The post Composite Repositories – Extend your Spring Data JPA Repository appeared first on Thorben Janssen.


by Thorben Janssen at September 01, 2020 10:08 AM

Hashtag Jakarta EE #35

by Ivar Grimstad at August 30, 2020 09:59 AM

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

Jakarta EE 9 is chugging along. There are three specifications that have passed the ballot for approval by the Jakarta EE Specification Committee and two ballots that are ongoing. More are expected to start this week.

We hit a bump in the road with CDI since we discovered very late in the game that there were some incorrect references to the javax.* namespace left in the specification document. This is an excellent example that shows we need more eyes on these documents. So if you have any time over, please take a look at the pull requests that are approaching ballots. Scroll through the specification document and browse for obvious things that we have missed.

On Thursday, I will present Jakarta EE 9 and Beyond at GIDS.JAVA Live 2020. This is a great conference with an amazing lineup of speakers. I have had the pleasure of speaking at the the conference in Bangalore a couple of times. This time, it will be a virtual appearance.


by Ivar Grimstad at August 30, 2020 09:59 AM

[UNBOXING] Why Canon EOS R6?

by Markus Karg at August 29, 2020 03:00 PM

Hey guys! How’s it going?

I’m unboxing our brand-new Canon EOS R6!

We recently bought a Canon EOS R6 in addition to our older Canon EOS 5D Mark III, as it has some neat features that we urgently wanted to have!

This video tells you the reasons and demonstrates what possibilities this brand new model gives us.

Stay safe and… Party on!


by Markus Karg at August 29, 2020 03:00 PM

New Supported Platforms and JVMs for Payara Enterprise

by Mark Wareham at August 27, 2020 11:30 AM

Payara Enterprise now supports ARM architecture, along with OpenJ9 and Amazon Corretto JVMs!


by Mark Wareham at August 27, 2020 11:30 AM

Obfuscate Your Code NOW! – The Two Minutes Tuesday 005

by Markus Karg at August 25, 2020 09:00 PM

Hey guys!

Assignments within expressions are a great idea if you want to be the only person EVER able to read your code!

CU!


by Markus Karg at August 25, 2020 09:00 PM

Distributed caching with Wildfly/Infinispan and poor JCache support.

August 25, 2020 09:00 PM

Latest trends teach us to do development of stateless applications, and if you can - keep your design stateless. But, by some reason, you may need to cache and share state between nodes.

It would be nice to have JSR 107: JCACHE - Java Temporary Caching API support in Wildfly Application Server, but unfortunately, JCache still not a part of JakartaEE specification (i hope one day it will) and pity to realize that Wildfly does not support JCache by default.

From other point of view many well known vendors like Hazelcast, Infinispan, Ehcache etc, supports JCache API as well. In turn significant Infinispan part integrated into Wildfly Application Server and can be used as distributed cache provider over separate infinispan subsystem configuration.

So, let's design sample Jakarta EE application to see how distrubuted cache looks and works on practice.

First, we need for at least two node Wildfly cluster - please refer to my article about Wildfly domain mode cluster and load balancing from the box. And then we are ready to configure distributed cache for our application:

/profile=full-ha/subsystem=infinispan/cache-container=mycachecontainer:add
/profile=full-ha/subsystem=infinispan/cache-container=mycachecontainer/distributed-cache=mycache:add

After simply server configuration above, we are ready to create our sample application. And as usual with Jakarta EE - build.gradle looks pretty simple and clear :

apply plugin: 'war'
dependencies {
    providedCompile "jakarta.platform:jakarta.jakartaee-api:8.0.0"
    providedCompile "org.infinispan:infinispan-core:10.1.8.Final"
}

Now to use configured above mycache we need to register cache resource in the one from two ways :

@Startup
@Singleton
@LocalBean
public class MyCacheResource {
    @Resource(lookup = "java:jboss/infinispan/cache/mycachecontainer/mycache")
    private org.infinispan.Cache<String, Object> myCache;

OR provide resource reference in your WEB-INF/web.xml descriptor:

<web-app version="2.5"  xmlns="http://java.sun.com/xml/ns/javaee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>JCache API example</display-name>
    <resource-env-ref>
        <resource-env-ref-name>mycache</resource-env-ref-name>
        <lookup-name>java:jboss/infinispan/cache/mycachecontainer/mycache</lookup-name>
    </resource-env-ref>    
</web-app>

I personally prefer second one because it allows move vendor specific code and dependencies from application source level to the descriptor which is designed for. Actually, i recommend to use standard API as much as possible and refer to custom vendor specific stuff very carefully.

Also to help Wildfly avoid casting exception like java.lang.IllegalArgumentException: Can not set org.infinispan.Cache field to org.jboss.as.clustering.infinispan.DefaultCache we need to configure module dependencies over MANIFEST.MF:

Manifest-Version: 1.0
Dependencies: org.infinispan export

OR over jboss-deployment-structure.xml :

<jboss-deployment-structure>
   <deployment>
      <dependencies>
         <module name="org.infinispan" export="TRUE" />
      </dependencies>
   </deployment>
</jboss-deployment-structure>

And again, I prefer second way as vendor specific descriptor is a right place for vendor specific stuff. Please refer to deployment module dependencies explanation for the details

Now when all preparation is complete, - let's implement simple service and JAX-RS resource to check how cache distribution works:

TestCacheService.java:

@Named
public class TestCacheService {

    @Resource(name = "mycache")
    org.infinispan.Cache cache;

    public void putIspnCache(String key, String value) {
        cache.put(key, String.format("%s (%s)", value, new Date()));
    }

    public Object getIspnCache(String key) {
        return cache.get(key);
    }
}

TestCacheEndpoint.java:

@Stateless
@ApplicationPath("/")
@Path("/jcache")
public class TestCacheEndpoint extends Application {

    @Inject
    TestCacheService service;

    @GET
    @Path("/ispn-put")
    public Response putIspn(@QueryParam("key") String key, @QueryParam("value") String value) {
        service.putIspnCache(key, value);
        return Response.ok("ok").build();
    }

    @GET
    @Path("/ispn-get")
    public Response getIspn(@QueryParam("key") String key) {
        return Response.ok(service.getIspnCache(key)).build();
    }
}    

Time to do deploy and test:

[domain@localhost:9990 /] deploy ~/work/kostenko/wildfly-infinispan-example/build/libs/jcache-examples.war --server-groups=backend-servers
curl -o - "http://localhost:8180/jcache-examples/jcache/ispn-put?key=KEY1&value=VALUE1"
ok
curl -o - "http://localhost:8280/jcache-examples/jcache/ispn-get?key=KEY1"
VALUE1 (Mon Aug 24 21:26:56 EEST 2020)
curl -o - "http://localhost:8280/jcache-examples/jcache/ispn-put?key=KEY2&value=VALUE2"
ok
curl -o - "http://localhost:8180/jcache-examples/jcache/ispn-get?key=KEY2"
VALUE2 (Mon Aug 24 21:27:52 EEST 2020)

As you can see from above, value we put on node1 available on node2 and vice versa. Even if we add new node to the cluster - cached values will be available on the fresh node as well:

[domain@localhost:9990 /] /host=master/server-config=backend3:add(group=backend-servers, socket-binding-port-offset=300)
[domain@localhost:9990 /] /host=master/server-config=backend3:start(blocking=true)
curl -o - "http://localhost:8380/jcache-examples/jcache/ispn-get?key=KEY2"
VALUE2 (Mon Aug 24 21:27:52 EEST 2020)

Great! So for now we able to share state between cluster members and, actually, this is enough for lot of typical use cases.
So, what about some standardization of our application ? As was noticed above JCache can be helpful here, but unfortunately enabling last one on Wildfly is not trivial at all.

To get JCache worked you can patch your Wildfly Application Server with Infinispan wildfly modules or just put missed libraries to the your application and exclude transitive ones to avoid conflicts with libraries that already present in the Wildfly.

build.gradle:

...
dependencies {
    providedCompile "jakarta.platform:jakarta.jakartaee-api:8.0.0"
    compile "javax.cache:cache-api:1.0.0"
    compile "org.infinispan:infinispan-jcache:10.1.8.Final"
    compile "org.infinispan:infinispan-cdi-embedded:10.1.8.Final"
}
configurations {
  runtime.exclude group: "org.infinispan", module: "infinispan-core"
  runtime.exclude group: "org.infinispan", module: "infinispan-commons"
  runtime.exclude group: "org.infinispan.protostream", module: "protostream"
}

jboss-deployment-structure.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
           <module name="org.infinispan" export="TRUE" />
           <module name="org.infinispan.commons" export="TRUE" />
           <module name="org.infinispan.protostream" export="TRUE" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

After that you should be able to use JCache in the usual way:

TestCacheService.java:

...
@CacheResult(cacheName = "mycache")
public String getJCacheResult() {
    System.out.println("getJCacheResult");
    return new Date().toString();
}
...

beans.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee  http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" bean-discovery-mode="all">
    <interceptors>
        <class>org.infinispan.jcache.annotation.CacheResultInterceptor</class>
    </interceptors>
</beans>

@CacheResult works and caching the result BUT it is not related to the configured on Wildfly mycache and ignores configured options like lifespans, distributions etc because Infinispan's JCache CachingProvider implementation created caches from an Infinispan native configuration file (based on the provided URI, interpreted as a file path) instead of WF configuration.

I did some digging about possibility to produce custom JCache CachingProvider but unfortunately did not find any workable solution for it. Also refer to my post about ispn distributed cache issues workaround.

As usual samle source code available on GitHub


August 25, 2020 09:00 PM

Speed-up your Query with Parameter Padding

by Thorben Janssen at August 25, 2020 12:00 PM

The post Speed-up your Query with Parameter Padding appeared first on Thorben Janssen.

Most databases put a lot of effort into analyzing SQL statements and finding the optimal execution plan. This often makes the difference between a slow and a blazing fast statement. But this analysis can also be rather complex. That’s why a lot of databases try to cache and reuse the created execution plans. Hibernate and […]

The post Speed-up your Query with Parameter Padding appeared first on Thorben Janssen.


by Thorben Janssen at August 25, 2020 12:00 PM

Monitoring Console Update in Payara Server Community 2020.4 Allows Quick View of Domain Health

by Jan Bernitt at August 25, 2020 11:00 AM

We have been busy bringing new functionality to the monitoring console. The newest Domain RAG Status feature coming in the August 2020 release offers better integration of the Eclipse MicroProfile Health checks. This article will go into the details of the integration and showcase how it can be utilised in the monitoring console.


by Jan Bernitt at August 25, 2020 11:00 AM

Hashtag Jakarta EE #34

by Ivar Grimstad at August 23, 2020 09:59 AM

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

This week, I held a JetBrains Live Webinar titled Jakarta EE 9 and Beyond. The recording of the webinar is embedded below. The highlight of the session, in my opinion, is the Q&A section at the end. So if you don’t have time to watch the entire recording, fast-forward to around 43 minutes where you will find the Q&A.

The forward-looking part of this presentation is heavily inspired by the Guide to Contributing to Jakarta EE 10 document assembled by the Jakarta EE Ambassadors. I encourage you to read this document, particularly the sections(s) covering technologies you are interested in and/or are using. The time to start looking forward is now!

If you still wonder how to participate, do join the Friends of Jakarta EE call on August 26th. The agenda is forming and contains a summary of the process for getting involved.

The agenda for EclipseCon Community Day is now complete! One of the sessions is a Jakarta EE 10 Round Table. You may help to create the content for this session by adding your questions to the panel in the Jakarta EE 10 Round Table Questions document. Thanks to Reza Rahman, Werner Keil, and Thodoris Bais for putting the agenda together!


by Ivar Grimstad at August 23, 2020 09:59 AM

JAX-RS Done Right! (VIII. – Advanced Parameter Topics)

by Markus Karg at August 22, 2020 03:00 PM

Hey guys! How’s it going?

In today’s episode of “JAX-RS Done Right!” we will look into more advanced parameter topics that help us to make our code look much cleaner and support separation of concerns. With the help of a parameter converter provider we will strip all parameter handling from our JAX-RS resource and deal solely with a “purified” domain object.

Code example can be found on Gitlab: https://gitlab.com/mkarg/jaxrs-done-right

Stay safe and… Party on!


by Markus Karg at August 22, 2020 03:00 PM

You lose out Performance! – The Two Minutes Tuesday 004

by Markus Karg at August 18, 2020 09:00 PM

Hey guys!

You’re still using years-old Java versions? Then you definitively lose out performance!

CU!


by Markus Karg at August 18, 2020 09:00 PM

Mapping Arrays with Hibernate

by Thorben Janssen at August 18, 2020 06:22 AM

The post Mapping Arrays with Hibernate appeared first on Thorben Janssen.

Arrays are a common data type in Java and part of the SQL-99 standard. So, it should be easy and quite common to use them with Hibernate, right? No, they aren’t. Most developers try to avoid using arrays in their persistence layers. There are several reasons for that: Not all DBMS support arrays. Because of […]

The post Mapping Arrays with Hibernate appeared first on Thorben Janssen.


by Thorben Janssen at August 18, 2020 06:22 AM

Deploy Friday: E18 Funding Free and Open Source Software

by otaviojava at August 17, 2020 01:13 PM

A Question and Answer session with guests:  Pia Mancini co-founder and CEO of Open Collective Luis Villa, co-founder of Tidelift Otavio Santana Larry Garfield Free Software and Open Source development have taken over the world; virtually every organization runs on Free Software in some capacity, whether it realizes it or not.  But all too often […]

by otaviojava at August 17, 2020 01:13 PM

What's New in the Payara Platform August Release?

by Dominika Tasarz at August 17, 2020 01:00 PM

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

With this patch release of Payara Platform Enterprise, we focus on stability and consolidation of the software components delivering value around your Enterprise subscription. Meanwhile, the Payara Community Edition introduces some security, stability, and monitoring improvements of features for testing, such as Remote EJB Tracing and Monitoring Console Domain RAG Status & Developer Metrics. Read more below to find out the details!


by Dominika Tasarz at August 17, 2020 01:00 PM

Hashtag Jakarta EE #33

by Ivar Grimstad at August 16, 2020 09:59 AM

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

As I mentioned in last week’s Hashtag, the Jakarta EE 9 release will be postponed. We have not decided on a date yet, but I would be very surprised if we are delayed more than a little over a month. We are pretty close to the finishing line as the first ballots to approve specifications have started. Jakarta Dependency Injection 2.0, Jakarta Batch 2.0, Jakarta CDI 3.0, and Jakarta Bean Validation 3.0 started last week.

As a consequence of the pushed Jakarta EE 9 release date, the Jakarta EE working group decided to move JakartaOne Livestream as well. We have therefore extended the call-for-paper. But do submit sooner rather than later!

On Wednesday, I will do a JetBrains Live Webinar about the upcoming Jakarta EE 9 release.


by Ivar Grimstad at August 16, 2020 09:59 AM

Caucho Resin datasource configuration

August 15, 2020 09:00 PM

There is few possible ways to do datasource configuration for Jakarta EE application on Resin Application Server:

Way #1 - Application level. Place JDBC driver to the application classpath and edit WEB-INF/resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin">
    <database jndi-name='jdbc/myds'>
        <driver type="com.microsoft.sqlserver.jdbc.SQLServerDriver">
            <url>jdbc:sqlserver://localhost:1433</url>
            <user>user</user>
            <password>password</password>
        </driver>
    </database>
</web-app>

Way #2 - Application Server level. Put JDBC driver to <resin_home>/lib directory and edit <resin_home>/conf/resin.xml

...
<cluster id="app">
  ...
  <database>
    <jndi-name>jdbc/myds</jndi-name>
    <driver type="com.microsoft.sqlserver.jdbc.SQLServerDriver">
      <url>jdbc:sqlserver://localhost:1433</url>
      <user>user</user>
      <password>password</password>
     </driver>
     <prepared-statement-cache-size>8</prepared-statement-cache-size>
     <max-connections>20</max-connections>
     <max-idle-time>30s</max-idle-time>
   </database>
</cluster>
...

August 15, 2020 09:00 PM

JAX-RS Done Right! (VII. – Parameter Basics)

by Markus Karg at August 15, 2020 03:00 PM

Hey guys! How’s it going?

Let’s provide fine control in our JAX-RS routing using regular expressions and media type selectors.

Code example can be found on Gitlab: https://gitlab.com/mkarg/jaxrs-done-right

Stay safe and… Party on!


by Markus Karg at August 15, 2020 03:00 PM

Payara Server Community 5.2020.4 Makes it Easy to Set Up Custom Metrics in the Monitoring Console

by Jan Bernitt at August 13, 2020 10:52 AM

The focus of the recent improvements for Payara Monitoring Console in the 5.2020.4 release has been on configuration sharing and ease of usage. Here's a brief overview of a couple of new features available in the Monitoring Console.


by Jan Bernitt at August 13, 2020 10:52 AM

Deploy Friday: E17 Enterprise integration patterns with Camel, Broker and Kafka

by otaviojava at August 11, 2020 01:26 PM

A Question and Answer session with guests:  Christina Lin Hugo Guerrero Otavio Santana Larry Garfield Modularity and integration are two sides of the same coin. The same holds for organizations and the architecture of the systems they build. Enterprise Integration Patterns provides an invaluable catalog of several patterns, with real-world solutions that demonstrate formidable messaging […]

by otaviojava at August 11, 2020 01:26 PM

Modeling self-referencing associations with Hibernate

by Thorben Janssen at August 11, 2020 12:00 PM

The post Modeling self-referencing associations with Hibernate appeared first on Thorben Janssen.

When you model a hierarchical data structure, you often have to use self-referencing associations. Both ends of these associations are of the same type. In other words, the entity object on which the association is defined and the one the association references are of the same type. In your database, you model that using a […]

The post Modeling self-referencing associations with Hibernate appeared first on Thorben Janssen.


by Thorben Janssen at August 11, 2020 12:00 PM

Jakarta EE 9 Now Available within Jelastic PaaS

by Tetiana Fydorenchyk at August 11, 2020 08:34 AM

Jakarta EE community has already started the shift to Jakarta EE 9. This tooling release is  focused on implementing a new jakarta.* namespace, and removing...

by Tetiana Fydorenchyk at August 11, 2020 08:34 AM

Hashtag Jakarta EE #32

by Ivar Grimstad at August 09, 2020 09:59 AM

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

I am still enjoying the last couple of days of my vacation, so I will be brief…

We knew that the schedule to get Jakarta EE 9 out was tight, and as it turns out that it was a little too tight. Jakarta EE 9 will not be ready to be released on September 16 as planned. We are very close to starting the process of finalizing the specifications, so I don’t expect it to be delayed much. As soon as a new target date has been decided, I will make sure to make as much noise about it as possible. So stay tuned for an announcement…

On the positive note, Jelastic has come a long way with integrating Jakarta EE 9 to its cloud platform. Container images for Tomcat, TomEE, WildFly, and Jetty are already available. Support for GlassFish and Payara is coming soon.

This is truly impressive and an important step forward to show the industry that the namespace change is coming your way no matter if you like it or not. And now is the time to act!


by Ivar Grimstad at August 09, 2020 09:59 AM

Migration from Wildfly 18 to Wildfly 20

August 05, 2020 09:00 PM

Some time ago i wrote article about migration from Wildfly 10 to Wildfly 18 and application level migration issues. Migration from Wildfly 18 to Wildfly 20 does not provoke any application level issues and can be done in minutes:

git clone https://github.com/wildfly/wildfly-server-migration.git
cd ./wildfly-server-migration/
mvn clean install
cd ./dist/standalone/target/
unzip jboss-server-migration-1.10.0-SNAPSHOT.zip
cd ./jboss-server-migration

./jboss-server-migration.sh -s /opt/wildfly-18.0.0.Final -t /opt/wildfly-20.0.1.Final/

Why should i do migration to Wildfly 20 ?

  • Supports the Eclipse MicroProfile 3.3 platform specifications
  • Possible to use TLS 1.3 with WildFly when running against JDK 11 or higher.
  • RESTEasy (integrated in WildFly via the jaxrs subsystem) can now be configured using MicroProfile Config.
  • Many component upgrades and bug fixes

August 05, 2020 09:00 PM

Payara Roadmap Overview

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at August 05, 2020 01:34 PM

In this new video you can watch Payara CEO and Founder Steve Millidge talk about the plans we have for the Payara Platform, in the near future and beyond; and how this ties in with Jakarta EE 9/10/+ and Eclipse MicroProfile. 


by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at August 05, 2020 01:34 PM

Deploy Friday EP — 16 Micronaut: A Modern Full-Stack Framework for Building Microservice and Serverless

by otaviojava at August 05, 2020 11:52 AM

A Question and Answer session with guests:  Iván López Martín Rodrigo Graciano Otavio Santana Robert Douglas Micronaut is an open-source, JVM-based framework for building full-stack, modular, easily testable microservice and serverless applications. Unlike reflection-based IoC frameworks that load and cache reflection data for every single field, method, and constructor in your code, with Micronaut, your […]

by otaviojava at August 05, 2020 11:52 AM

Unzip without root but with java

August 04, 2020 09:00 PM

If you need to unzip file on the server, where is no root and no unzip installed then time to ask java about:

jar xvf wildfly-20.0.1.Final.zip

August 04, 2020 09:00 PM

Architecting Cloud Computing Solutions with Java | Jakarta Tech Talks

by otaviojava at August 04, 2020 03:47 PM

Cloud-Native has become a big buzzword around the world, a term that is practically used by everyone at all times. But what does it mean? What are the advantages it brings to your application and your day as a software developer or architect? What’s new in the Java world, and what are the steps to […]

by otaviojava at August 04, 2020 03:47 PM

Entity Lifecycle Model in JPA & Hibernate

by Thorben Janssen at August 04, 2020 12:00 PM

The post Entity Lifecycle Model in JPA & Hibernate appeared first on Thorben Janssen.

The entity lifecycle model is one of the core concepts of JPA and all its implementations. Even though it’s not directly visible when working with JPA’s EntityManager, it affects all operations you perform. The different states of the model define how your persistence provider, e.g. Hibernate, handles your entity objects. This includes if it loads […]

The post Entity Lifecycle Model in JPA & Hibernate appeared first on Thorben Janssen.


by Thorben Janssen at August 04, 2020 12:00 PM

The Payara Monthly Catch for July 2020

by Jadon Ortlepp (Jadon.Ortlepp@Payara.fish) at August 03, 2020 11:00 AM

I hope you enjoy the article and news round up this month, as usual their was a lot to talk about in the Jakarta EE & MicroProfile space, as well as Java as a whole. You may notice a slight shift in emphasis towards Security themed articles this month which I hope you find useful.

In this blog 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 August 03, 2020 11:00 AM

Hashtag Jakarta EE #31

by Ivar Grimstad at August 02, 2020 09:59 AM

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

I admit that I haven’t stayed 100% up-to-date on what’s been going on in the Jakarta EE community the last week. It’s vacation time, and my focus has been on other things than staying connected. Things like early morning dip in the ocean…

Make sure to log off your devices and take some time to recharge yourself!

One thing I did notice though, is that the CFP for JakartaOne Livestream has been extended until August 14. Rember to submit your talk earlier rather than later!


by Ivar Grimstad at August 02, 2020 09:59 AM

Back to the top