Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions blog_tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"blog_tags": [
{
"name": "announcements",
"posts": ["25.0.0.9", "25.0.0.9-beta",
"posts": ["25.0.0.10-beta", "25.0.0.9", "25.0.0.9-beta",
"25.0.0.8", "25.0.0.7",
"25.0.0.7-beta", "25.0.0.6",
"25.0.0.6-beta", "25.0.0.5",
Expand Down Expand Up @@ -169,7 +169,7 @@
},
{
"name": "java-se",
"posts": ["25.0.0.6", "25.0.0.6-beta", "25.0.0.4",
"posts": ["25.0.0.10-beta", "25.0.0.6", "25.0.0.6-beta", "25.0.0.4",
"25.0.0.4-beta", "24.0.0.10",
"24.0.0.10-beta", "24.0.0.4",
"24.0.0.4-beta", "24.0.0.3",
Expand All @@ -188,7 +188,7 @@
},
{
"name": "release",
"posts": ["25.0.0.9", "25.0.0.9-beta",
"posts": ["25.0.0.10-beta","25.0.0.9", "25.0.0.9-beta",
"25.0.0.8", "25.0.0.7",
"25.0.0.7-beta", "25.0.0.6",
"25.0.0.6-beta", "25.0.0.5",
Expand Down Expand Up @@ -261,7 +261,8 @@
},
{
"name": "beta",
"posts": ["25.0.0.9-beta", "25.0.0.7-beta", "25.0.0.6-beta",
"posts": ["25.0.0.10-beta","25.0.0.9-beta",
"25.0.0.7-beta", "25.0.0.6-beta",
"25.0.0.4-beta", "25.0.0.3-beta",
"25.0.0.2-beta", "25.0.0.1-beta",
"24.0.0.12-beta", "24.0.0.11-beta",
Expand Down
253 changes: 253 additions & 0 deletions posts/2025-09-23-25.0.0.10-beta.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
---
layout: post
title: "Support for override library in the application classloader and support for Java 25 in 25.0.0.10-beta"
# Do NOT change the categories section
categories: blog
author_picture: https://avatars3.githubusercontent.com/IsmathBadsha
author_github: https://github.com/IsmathBadsha
seo-title: Support for override library in the application classloader and support for Java 25 in 25.0.0.10-beta - OpenLiberty.io
seo-description: Support for the override library in the application classloader that allows fixing applications without rebuilding them, and Java 25 compatibility are introduced in version 25.0.0.10-beta.
blog_description: Support for the override library in the application classloader that allows fixing applications without rebuilding them, and Java 25 compatibility are introduced in version 25.0.0.10-beta.
open-graph-image: https://openliberty.io/img/twitter_card.jpg
open-graph-image-alt: Open Liberty Logo
---
= Support for override library in the application classloader and support for Java 25 in 25.0.0.10-beta
Ismath Badsha <https://github.com/IsmathBadsha>
:imagesdir: /
:url-prefix:
:url-about: /
//Blank line here is necessary before starting the body of the post.

// // // // // // // //
// In the preceding section:
// Do not insert any blank lines between any of the lines.
// Do not remove or edit the variables on the lines beneath the author name.
//
// "open-graph-image" is set to OL logo. Whenever possible update this to a more appropriate/specific image (For example if present an image that is being used in the post). However, it
// can be left empty which will set it to the default
//
// "open-graph-image-alt" is a description of what is in the image (not a caption). When changing "open-graph-image" to
// a custom picture, you must provide a custom string for "open-graph-image-alt".
//
// Replace TITLE with the blog post title eg: MicroProfile 3.3 is now available on Open Liberty 20.0.0.4
// Replace IsmathBadsha with your GitHub username eg: lauracowen
// Replace DESCRIPTION with a short summary (~60 words) of the release (a more succinct version of the first paragraph of the post).
// Replace Ismath Badsha with your name as you'd like it to be displayed,
// eg: LauraCowen
//
// For every link starting with "https://openliberty.io" in the post make sure to use
// {url-prefix}. e.g- link:{url-prefix}/guides/GUIDENAME[GUIDENAME]:
//
// If adding image into the post add :
// -------------------------
// [.img_border_light]
// image::img/blog/FILE_NAME[IMAGE CAPTION ,width=70%,align="center"]
// -------------------------
// "[.img_border_light]" = This adds a faint grey border around the image to make its edges sharper. Use it around screenshots but not
// around diagrams. Then double check how it looks.
// There is also a "[.img_border_dark]" class which tends to work best with screenshots that are taken on dark backgrounds.
// Change "FILE_NAME" to the name of the image file. Also make sure to put the image into the right folder which is: img/blog
// change the "IMAGE CAPTION" to a couple words of what the image is
// // // // // // // //

Support for the override library in the application classloader that allows fixing applications without rebuilding them, and Java 25 compatibility are introduced in version 25.0.0.10-beta.

// // // // // // // //
// Change the RELEASE_SUMMARY to an introductory paragraph. This sentence is really
// important because it is supposed to grab the readers attention. Make sure to keep the blank lines
//
// Throughout the doc, replace 25.0.0.10-beta with the version number of Open Liberty, eg: 22.0.0.2-beta
// // // // // // // //

The link:{url-about}[Open Liberty] 25.0.0.10-beta includes the following beta features (along with link:{url-prefix}/docs/latest/reference/feature/feature-overview.html[all GA features]):

* <<overrideLibrary, OverrideLibrary support for application classloader>>
* <<beta_support_java25, Beta support for Java 25>>

// // // // // // // //
// In the preceding section:
// Change SUB_FEATURE_TITLE to the feature that is included in this release and
// change the SUB_TAG_1/2/3 to the heading tags
//
// However if there's only 1 new feature, delete the previous section and change it to the following sentence:
// "The link:{url-about}[Open Liberty] 25.0.0.10-beta includes SUB_FEATURE_TITLE"
// // // // // // // //

See also link:{url-prefix}/blog/?search=beta&key=tag[previous Open Liberty beta blog posts].

// // // // DO NOT MODIFY THIS COMMENT BLOCK <GHA-BLOG-TOPIC> // // // //
// Blog issue: https://github.com/OpenLiberty/open-liberty/issues/32778
// Contact/Reviewer: tjwatson
// // // // // // // //
[#overrideLibrary]
== OverrideLibrary support for application classloader

The 25.0.0.10-beta release introduces a new type of library reference for configuring an application’s `<classloader/>` that can be used to configure an the override library reference. The override library reference is similar to a private library reference because class instances remain unique to the application’s classloader. The key difference is the search order. With an override library reference, the library class path is searched before the application’s own class path, this allows the library path to override classes that are already included in the application.

For example, suppose a `<webApplication/>` contains a class such as `org.acme.needs.fix.SomeImpl` that must be overridden to resolve an issue. If rebuilding the application to include the fix is difficult or undesirable, you can instead build a new library JAR (for example, someImplFix.jar) with the corrected class files. The following `server.xml` configuration shows how to use an `overrideLibraryRef` to apply the fix without rebuilding the application:

[source, xml]
----
<webApplication location="appThatNeedsFix.war">
<classloader overrideLibraryRef="someImplFix"/>
</webApplication>

<library id="someImplFix">
<path name="someImplFix.jar"/>
</library>
----


// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>

// // // // DO NOT MODIFY THIS COMMENT BLOCK <GHA-BLOG-TOPIC> // // // //
// Blog issue: https://github.com/OpenLiberty/open-liberty/issues/32681
// Contact/Reviewer: gjwatts
// // // // // // // //
[#beta_support_java25]
== Beta support for Java 25

Java 25, the latest Long-Term Support (LTS) release, contains many new features and enhancements over previous versions of Java.
There are 18 new features (JEPs) in link:https://openjdk.org/projects/jdk/25/[Java 25]: 6 are test features and 12 are fully delivered.

**Test features**

* 470: link:https://openjdk.org/jeps/470[PEM Encodings of Cryptographic Objects (Preview)]
* 502: link:https://openjdk.org/jeps/502[Stable Values (Preview)]
* 505: link:https://openjdk.org/jeps/505[Structured Concurrency (Fifth Preview)]
* 507: link:https://openjdk.org/jeps/507[Primitive Types in Patterns, instanceof, and switch (Third Preview)]
* 508: link:https://openjdk.org/jeps/508[Vector API (Tenth Incubator)]
* 509: link:https://openjdk.org/jeps/509[JFR CPU-Time Profiling (Experimental)]

**Delivered features**

* 503: link:https://openjdk.org/jeps/503[Remove the 32-bit x86 Port]
* 506: link:https://openjdk.org/jeps/506[Scoped Values]
* 510: link:https://openjdk.org/jeps/510[Key Derivation Function API]
* 511: link:https://openjdk.org/jeps/511[Module Import Declarations]
* 512: link:https://openjdk.org/jeps/512[Compact Source Files and Instance Main Methods]
* 513: link:https://openjdk.org/jeps/513[Flexible Constructor Bodies]
* 514: link:https://openjdk.org/jeps/514[Ahead-of-Time Command-Line Ergonomics]
* 515: link:https://openjdk.org/jeps/515[Ahead-of-Time Method Profiling]
* 518: link:https://openjdk.org/jeps/518[JFR Cooperative Sampling]
* 519: link:https://openjdk.org/jeps/519[Compact Object Headers]
* 520: link:https://openjdk.org/jeps/520[JFR Method Timing & Tracing]
* 521: link:https://openjdk.org/jeps/521[Generational Shenandoah]

When you use the `CompletableFuture` and `SubmissionPublisher` classes in Java 25 without an explicit Executor backing these classes, they default to using `ForkJoinPool.commonPool`. This pool sets its parallelism value to the number of available processors minus one (# available processors - 1). If the application runs on a system with two or fewer processors, there is a possibility of running into concurrency issues as Java 25 uses only a single thread by default. In earlier Java versions, this was not a problem because the JDK overlooked the parallelism value and created an additional thread.

You can avoid this issue by using one of the following approaches:

. Use the `CompletableFuture` class provided in Liberty’s Jakarta Concurrency implementation, which does not have this limitation.You can use the `CompletableFuture` class with a link:https://www.ibm.com/docs/en/was-liberty/core?topic=manually-configuring-managed-executors[DefaultManagedExecutorService] instance and either the link:https://jakarta.ee/specifications/concurrency/3.1/apidocs/jakarta.concurrency/jakarta/enterprise/concurrent/managedexecutorservice#supplyAsync(java.util.function.Supplier)[supplyAsync] method or the runAsync method.
. Explicitly set the `ForkJoinPool.commonPool` parallelism value to whatever you need, `-Djava.util.concurrent.ForkJoinPool.common.parallelism=N` (where N is the minimum number of threads needed)
. Explicitly set the `ForkJoinPool.commonPool` parallelism value to the desired number of threads by using the system property,
`-Djava.util.concurrent.ForkJoinPool.common.parallelism=N` (where N is the minimum number of threads required).
. Use an explicit backing `Executor`.

For more information on this change, see the following links:
https://bugs.openjdk.org/browse/JDK-8362881
https://bugs.openjdk.org/browse/JDK-8319447
https://bugs.openjdk.org/browse/JDK-8360593

Take advantage of the changes in Java 25 in Open Liberty now and get more time to review your applications, microservices, and runtime environments on your favorite server runtime!

Just link:https://jdk.java.net/25/[download the latest release of Java 25], download and install the link:https://openliberty.io/downloads/#runtime_betas[25.0.0.10-beta] version of Open Liberty, edit your Liberty server's link:https://openliberty.io/docs/latest/reference/config/server-configuration-overview.html#server-env[server.env] file with JAVA_HOME set to your Java 25 installation directory and start testing!

For more information on Java 25, see the Java 25 link:https://jdk.java.net/25/release-notes[release notes page], link:https://download.java.net/java/early_access/jdk25/docs/api/[API Javadoc page] or link:https://jdk.java.net/25/[download page].
For more information on Open Liberty,see our link:https://openliberty.io/docs[documentation page].


// DO NOT MODIFY THIS LINE. </GHA-BLOG-TOPIC>

[#run]
=== Try it now

To try out these features, update your build tools to pull the Open Liberty All Beta Features package instead of the main release. The beta works with Java SE 21, Java SE 17, Java SE 11, and Java SE 8.
// // // // // // // //
// In the preceding section:
// Check if a new non-LTS Java SE version is supported that needs to be added to the list (21, 17, 11, and 8 are LTS and will remain for a while)
// https://openliberty.io/docs/latest/java-se.html
//
// In the following section:
// Check if a new MicroProfile or Jakarta version is in beta that could replace the example values in the codeblock
// // // // // // // //

If you're using link:{url-prefix}/guides/maven-intro.html[Maven], you can install the All Beta Features package using:

[source,xml]
----
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.11.5</version>
<configuration>
<runtimeArtifact>
<groupId>io.openliberty.beta</groupId>
<artifactId>openliberty-runtime</artifactId>
<version>25.0.0.10-beta</version>
<type>zip</type>
</runtimeArtifact>
</configuration>
</plugin>
----

You must also add dependencies to your pom.xml file for the beta version of the APIs that are associated with the beta features that you want to try. For example, the following block adds dependencies for two example beta APIs:

[source,xml]
----
<dependency>
<groupId>org.example.spec</groupId>
<artifactId>exampleApi</artifactId>
<version>7.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>example.platform</groupId>
<artifactId>example.example-api</artifactId>
<version>11.0.0</version>
<scope>provided</scope>
</dependency>
----

Or for link:{url-prefix}/guides/gradle-intro.html[Gradle]:

[source,gradle]
----
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'io.openliberty.tools:liberty-gradle-plugin:3.9.5'
}
}
apply plugin: 'liberty'
dependencies {
libertyRuntime group: 'io.openliberty.beta', name: 'openliberty-runtime', version: '[25.0.0.10-beta,)'
}
----
// // // // // // // //
// In the preceding section:
// Replace the Maven `3.8.2` with the latest version of the plugin: https://search.maven.org/artifact/io.openliberty.tools/liberty-maven-plugin
// Replace the Gradle `3.6.2` with the latest version of the plugin: https://search.maven.org/artifact/io.openliberty.tools/liberty-gradle-plugin
// TODO: Update GHA to automatically do the above. If the maven.org is problematic, then could fallback to using the GH Releases for the plugins
// // // // // // // //

Or if you're using link:{url-prefix}/docs/latest/container-images.html[container images]:

[source]
----
FROM icr.io/appcafe/open-liberty:beta
----

Or take a look at our link:{url-prefix}/downloads/#runtime_betas[Downloads page].

If you're using link:https://plugins.jetbrains.com/plugin/14856-liberty-tools[IntelliJ IDEA], link:https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext[Visual Studio Code] or link:https://marketplace.eclipse.org/content/liberty-tools[Eclipse IDE], you can also take advantage of our open source link:https://openliberty.io/docs/latest/develop-liberty-tools.html[Liberty developer tools] to enable effective development, testing, debugging and application management all from within your IDE.

For more information on using a beta release, refer to the link:{url-prefix}docs/latest/installing-open-liberty-betas.html[Installing Open Liberty beta releases] documentation.

[#feedback]
== We welcome your feedback

Let us know what you think on link:https://groups.io/g/openliberty[our mailing list]. If you hit a problem, link:https://stackoverflow.com/questions/tagged/open-liberty[post a question on StackOverflow]. If you hit a bug, link:https://github.com/OpenLiberty/open-liberty/issues[please raise an issue].