Skip to content

fix: shade reactive-streams, which Fess no longer ships - #1

Merged
marevol merged 1 commit into
mainfrom
fix/shade-reactive-streams
Sep 15, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/shade-reactive-streams

Conversation

@marevol

@marevol marevol commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Found while verifying 15.9.0. On current Fess main the plugin cannot build an S3 client at all:

java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
	at software.amazon.awssdk.services.s3.DefaultS3BaseClientBuilder.finalizeServiceConfiguration(DefaultS3BaseClientBuilder.java:117)
	at software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder.finalizeChildConfiguration(AwsDefaultClientBuilder.java:170)
	at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.syncClientConfiguration(SdkDefaultClientBuilder.java:206)
	at software.amazon.awssdk.services.s3.DefaultS3ClientBuilder.buildClient(DefaultS3ClientBuilder.java:37)
	...
Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher

Both users of the SDK go through that builder: S3StorageClient (storage.type=s3) and fess-crawler's S3Client#init, which this plugin registers for s3: URLs. With the plugin installed:

  • System > Storage ends on the system error page, and GET /api/admin/storage/list answers with status 2.
  • An s3:// file crawl indexes nothing while the job reports success; the failure URL carries the stack above.

Cause

The shade's artifactSet excludes org.reactivestreams:*, on the assumption written next to it that "reactive-streams arrives there with OpenSearch". It did: reactive-streams 1.0.4 was a direct dependency of org.opensearch:opensearch and so sat in WEB-INF/lib. codelibs/fess#3439 dropped the opensearch jar, and reactive-streams went with it. Neither the war nor this jar has org.reactivestreams.* any more.

Change

  • Remove the org.reactivestreams:* exclude, so the SDK's reactive-streams 1.0.4 (it comes in through http-auth-spi) is shaded.
  • Correct the comment, which now says why reactive-streams is not on the list.

The other excludes were re-checked against mvn dependency:list -DincludeScope=runtime on current Fess main and are all still shipped by the war: httpclient5 5.6.1, httpcore5 and httpcore5-h2 5.4, slf4j-api 1.7.36.

Why shade it rather than put it back in the war

Removing the OpenSearch server jar and what it brought in was deliberate, and Fess itself does not use reactive-streams; the AWS SDK in this plugin does. reactive-streams 1.0.4 is an 11.6 KB jar of four interfaces and the FlowAdapters bridge, with no dependencies. fess-ds-microsoft365 needs it for the same reason and shades the same version; the two copies are byte-identical (same CRC-32 for all 14 entries), so on a class path that has both plugins, whichever copy is found first is the same class.

Compatibility

The jar grows by 10,992 bytes (8,728,399 → 8,739,391). The only new entries are the 14 under org/reactivestreams/; nothing is removed, nothing is duplicated, there is no module descriptor at the root, and the shade's overlap warnings are unchanged.

Verification

  • mvn clean package: 4 tests, 0 failures.
  • Linkage check on a class path made of Fess main's runtime jars (dependency:copy-dependencies -DincludeScope=runtime at codelibs/fess@5bd477e, 191 jars), Fess's own classes and the plugin jar:
    • before: S3Client.builder()...build(), new S3StorageClient(...) and fess-crawler's S3Client#init() each fail with NoClassDefFoundError: org/reactivestreams/Publisher;
    • after: all three succeed, and against a local MinIO S3StorageClient runs ensureBucketExists, isAvailable, uploadObject, listObjects, downloadObject (identical bytes, non-ASCII key), deleteObject and close without error.
  • Class-reference scan of the jar against the same class path: before, the unresolved references are org.reactivestreams and the optional AWS CRT client (software.amazon.awssdk.crt, which neither this plugin nor Fess has ever shipped); after, only the CRT references remain.
  • In the 15.9.0 verification, adding reactive-streams-1.0.4.jar to WEB-INF/lib alone brought back the Storage page, upload, list, download and delete, and the s3:// crawl.

Building an S3 client fails on current Fess main with
NoClassDefFoundError: org/reactivestreams/Publisher, raised from
DefaultS3BaseClientBuilder.finalizeServiceConfiguration. Both
S3StorageClient and fess-crawler's S3Client build through it, so the
storage page, the storage API and s3: crawling all break once the plugin
is installed.

The shade excluded org.reactivestreams:* on the assumption that the war
carries it with OpenSearch. It did until codelibs/fess#3439 dropped the
opensearch jar. Stop excluding it so the SDK's reactive-streams 1.0.4 is
shaded, and correct the comment. The remaining excludes (httpclient5,
httpcore5, httpcore5-h2, slf4j-api) are still shipped by the war.
@marevol marevol added this to the 15.9.0 milestone Sep 15, 2026
@marevol marevol self-assigned this Sep 15, 2026
@marevol
marevol merged commit 1a7ea5d into main Sep 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant