Skip to content

HDDS-14858. OM request fails with ClassNotFoundException: java.lang.constant.Constable#9945

Open
adoroszlai wants to merge 1 commit intoapache:masterfrom
adoroszlai:HDDS-14858
Open

HDDS-14858. OM request fails with ClassNotFoundException: java.lang.constant.Constable#9945
adoroszlai wants to merge 1 commit intoapache:masterfrom
adoroszlai:HDDS-14858

Conversation

@adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Running Ozone 2.1.0 (from release binaries) with JDK 11 or lower, key put (and probably some other requests) results in:

RemoteException: java/lang/constant/Constable
	at org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerRatisUtils.createClientRequest(OzoneManagerRatisUtils.java:353)
...
Caused by: java.lang.ClassNotFoundException: java.lang.constant.Constable

Constable is introduced in JDK 12, and it appears (at least) in BucketLayoutAwareOMKeyRequestFactory.

javap -verbose hadoop-ozone/ozone-manager/target/classes/org/apache/hadoop/ozone/om/request/BucketLayoutAwareOMKeyRequestFactory.class | grep Constable
  #324 = Class              #325          // java/lang/constant/Constable
  #325 = Utf8               java/lang/constant/Constable
          stack = [ class java/lang/StringBuilder, class java/lang/constant/Constable ]

This PR sets aspectj-maven-plugin's release property

to make sure that not only the generated byte code conforms to the target level but also the code is compiled against a specific JDK's API

Profile is created to set release, because aspectj-maven-plugin, unlike maven-compiler-plugin, does not support using it with Java 8.

https://issues.apache.org/jira/browse/HDDS-14858

How was this patch tested?

Checked (as described above) that BucketLayoutAwareOMKeyRequestFactory does not have reference to Constable.

CI:
https://github.com/adoroszlai/ozone/actions/runs/23246182813

@adoroszlai adoroszlai self-assigned this Mar 18, 2026
@adoroszlai adoroszlai added the build Pull request that modifies the build process label Mar 18, 2026
@adoroszlai adoroszlai requested review from errose28 and symious March 18, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull request that modifies the build process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant