Skip to content

Consumer side Validation SPI is wrongly activated while setting validation=true for provider #1386

Closed

Description

@Sunshow

ATT.

this case consumer leads to throw

Caused by: java.lang.NoClassDefFoundError: javax/validation/Validation

even while calling no validation method, unless add all validation dependencies to consumer,

that's not awesome.

one more question about ValidationFilter:

why the condition check is isNotEmpty:
ConfigUtils.isNotEmpty(invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.VALIDATION_KEY))

and previous version check true or false:
if (invoker.getUrl().getMethodParameter(invocation.getMethodName(), Constants.VALIDATION_KEY, false))

Activity

  1. beiwei30 commented on Mar 5, 2018

    @beiwei30
    Member

    @Sunshow can you provide a small sample to demo how to reproduce?

  2. chickenlj commented on Mar 6, 2018

    @chickenlj
    Contributor

    ATT.

    this case consumer leads to throw

    Caused by: java.lang.NoClassDefFoundError: javax/validation/Validation

    even while calling no validation method, unless add all validation dependencies to consumer,

    that's not awesome.

    I think it is reasonable to check validation conditions on consumer side before params passed to provider side as this can be more efficient. If we keep it this way, we will meet the problem in your case: all consumers have to be aware of provider side validation configurations, for example when provider opened validation check, consumer side have to add necessary dependencies.

    Please, send this problem to [email protected], and subscribe to this email address. We can decide which way to go after a full discussion.

  3. Sunshow commented on Mar 7, 2018

    @Sunshow
    Author

    @chickenlj
    thanks, just sent the mail.

  4. added this to the 2.6.3 milestone on Jul 23, 2018
  5. added a commit that references this issue on Sep 9, 2019
    404408b
  6. added a commit that references this issue on Sep 10, 2019
    116c9c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions