Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude reactive-streams module for runtime classpath #80

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

JohnNiang
Copy link
Member

@JohnNiang JohnNiang commented Oct 7, 2023

Halo modified the class loading order of plugins in 2.10.x to P (Plugin) D (Dependencies) A (Application), resulting in a LinkageError when the current plugin is actually run.

java.lang.LinkageError: loader constraint violation: when resolving method 'reactor.core.publisher.Flux reactor.core.publisher.Mono.thenMany(org.reactivestreams.Publisher)' the class loader org.pf4j.PluginClassLoader @5da2e534 of the current class, run/halo/s3os/S3OsAttachmentHandler, and the class loader org.springframework.boot.loader.LaunchedURLClassLoader @87aac27 for the method's defining class, reactor/core/publisher/Mono, have different Class objects for the type org/reactivestreams/Publisher used in the signature (run.halo.s3os.S3OsAttachmentHandler is in unnamed module of loader org.pf4j.PluginClassLoader @5da2e534, parent loader org.springframework.boot.loader.LaunchedURLClassLoader @87aac27; reactor.core.publisher.Mono is in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader @87aac27, parent loader 'app')
        at run.halo.s3os.S3OsAttachmentHandler.lambda$upload$28(S3OsAttachmentHandler.java:298) ~[na:na]
        at reactor.core.publisher.MonoUsing.subscribe(MonoUsing.java:85) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.Mono.subscribe(Mono.java:4495) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.publisher.MonoSubscribeOn$SubscribeOnSubscriber.run(MonoSubscribeOn.java:126) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) ~[reactor-core-3.5.10.jar:3.5.10]
        at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) ~[reactor-core-3.5.10.jar:3.5.10]
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:na]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]

We just remove the reactive-streams dependency that is already in Halo to resolve the problem.

Fixes halo-dev/halo#4676

/kind bug

修复在 Halo 2.10 中无法正常上传的问题

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Oct 7, 2023
Copy link
Member

@longjuan longjuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
image
image

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2023
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Oct 8, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 8, 2023
@f2c-ci-robot f2c-ci-robot bot merged commit 0116ae6 into halo-dev:main Oct 8, 2023
1 check passed
@JohnNiang JohnNiang deleted the bug/linkage-error branch October 8, 2023 02:49
@ruibaby ruibaby mentioned this pull request Oct 8, 2023
@ruibaby ruibaby mentioned this pull request Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

附件上传问题
3 participants