Java 25 netty warning

Open
#93 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
networking

Research direction

Start with the dependency configuration for ChromeDevToolsClient and compare the current HorizonNing and Netty versions with the Netty Java 24 guidance linked in the issue. Resolve the duplicate Netty versions while upgrading to Netty 4.2.3, and verify that the Java 25 warning is addressed with the required native-access setting.

Written by the indexing model from the issue text.

Description

Since the Java 25 release, I am seeing this in the logs:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.hubspot.horizon.shaded.com.ning.http.client.providers.netty.chmv8.ConcurrentHashMapV8 (file:/Users/davidcockbill/.m2/repository/com/hubspot/HorizonNing/0.1.1/HorizonNing-0.1.1.jar)
WARNING: Please consider reporting this to the maintainers of class com.hubspot.horizon.shaded.com.ning.http.client.providers.netty.chmv8.ConcurrentHashMapV8
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

The issue is with the way netty (an asynchronous event-driven network application framework) uses memory by bypassing the heap (and garbage collection). Since Java 24 the use of the unsafe methods produces the warning shown.

Netty have tried to fix, but had performance issues, so pulled the fix.

https://github.com/netty/netty/wiki/Java-24-and-sun.misc.Unsafe

So from Netty 4.2.2 onward (providing you are running in Java 25 onwards) they have replaced with using MemorySegments. However looks like we want to use 4.2.3 with the following JVM argument: --enable-native-access=io.netty.common
So we need the chromedevtools-client to upgrade netty to 4.2.3.

I believe HorizonNing 0.5.1 updated the netty version. I tried building with this new version, but got duplicate netty version errors.

Dominant language
Java
Stars
48
Forks
19
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HubSpot/ChromeDevToolsClient

All issues in HubSpot/ChromeDevToolsClient

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.