You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@bval.apache.org by Francesco Chicchiriccò <il...@apache.org> on 2022/01/07 07:27:38 UTC

bval-jsr 2.0.5 not loading META-INF/services/javax.validation.ConstraintValidator ?

Hi,
at Syncope we are having troubles while making Spring Cloud Gateway 3.1.0 working with BVal 2.0.5 (rather than Hibernate Validator, which seems to be their default).

Essentially, the issue is with this annotation [1] leading to startup errors like as [2].

I have reached out to the Spring Cloud Gateway project, and they are claiming [3] the issue being on BVal not correctly loading their META-INF/services/javax.validation.ConstraintValidator [4].

Can you shed some light? Is it actually a bug on BVal or some kind of misconfiguration on their side?

TIA.
Regards.

[1] https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java#L100
[2] https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006773344
[3] https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006781216
[4] https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/resources/META-INF/services/javax.validation.ConstraintValidator

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Re: bval-jsr 2.0.5 not loading META-INF/services/javax.validation.ConstraintValidator ?

Posted by Francesco Chicchiriccò <il...@apache.org>.
FYI they have re-opened the original issue, renaming it as "Add support for Apache BVal" and adding tag "waiting for votes":

https://github.com/spring-cloud/spring-cloud-gateway/issues/2303

Regards.

On 2022/01/07 14:30:13 Francesco Chicchiriccò wrote:
> Thanks for your insight, Matt.
> 
> I linked your reply from
> 
> https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1007445164
> 
> Regards.
> 
> On 07/01/22 15:21, Matt Benson wrote:
> > It looks to me as though this is an implementation-specific feature of Hibernate Validator [1]. The BV specification v2.0 makes no mention of loading constraint validators from META-INF/services.
> >
> > Matt
> >
> > [1] https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#_constraint_definitions_via_code_serviceloader_code <https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#_constraint_definitions_via_code_serviceloader_code>
> >
> > On Fri, Jan 7, 2022 at 1:27 AM Francesco Chicchiriccò <ilgrosso@apache.org <ma...@apache.org>> wrote:
> >
> >     Hi,
> >     at Syncope we are having troubles while making Spring Cloud Gateway 3.1.0 working with BVal 2.0.5 (rather than Hibernate Validator, which seems to be their default).
> >
> >     Essentially, the issue is with this annotation [1] leading to startup errors like as [2].
> >
> >     I have reached out to the Spring Cloud Gateway project, and they are claiming [3] the issue being on BVal not correctly loading their META-INF/services/javax.validation.ConstraintValidator [4].
> >
> >     Can you shed some light? Is it actually a bug on BVal or some kind of misconfiguration on their side?
> >
> >     TIA.
> >     Regards.
> >
> >     [1] https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java#L100 <https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java#L100>
> >     [2] https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006773344 <https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006773344>
> >     [3] https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006781216 <https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006781216>
> >     [4] https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/resources/META-INF/services/javax.validation.ConstraintValidator <https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/resources/META-INF/services/javax.validation.ConstraintValidator>
> >
> -- 
> Francesco Chicchiriccò
> 
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
> 
> Member at The Apache Software Foundation
> Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
> http://home.apache.org/~ilgrosso/
> 
> 

Re: bval-jsr 2.0.5 not loading META-INF/services/javax.validation.ConstraintValidator ?

Posted by Francesco Chicchiriccò <il...@apache.org>.
Thanks for your insight, Matt.

I linked your reply from

https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1007445164

Regards.

On 07/01/22 15:21, Matt Benson wrote:
> It looks to me as though this is an implementation-specific feature of Hibernate Validator [1]. The BV specification v2.0 makes no mention of loading constraint validators from META-INF/services.
>
> Matt
>
> [1] https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#_constraint_definitions_via_code_serviceloader_code <https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#_constraint_definitions_via_code_serviceloader_code>
>
> On Fri, Jan 7, 2022 at 1:27 AM Francesco Chicchiriccò <ilgrosso@apache.org <ma...@apache.org>> wrote:
>
>     Hi,
>     at Syncope we are having troubles while making Spring Cloud Gateway 3.1.0 working with BVal 2.0.5 (rather than Hibernate Validator, which seems to be their default).
>
>     Essentially, the issue is with this annotation [1] leading to startup errors like as [2].
>
>     I have reached out to the Spring Cloud Gateway project, and they are claiming [3] the issue being on BVal not correctly loading their META-INF/services/javax.validation.ConstraintValidator [4].
>
>     Can you shed some light? Is it actually a bug on BVal or some kind of misconfiguration on their side?
>
>     TIA.
>     Regards.
>
>     [1] https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java#L100 <https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java#L100>
>     [2] https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006773344 <https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006773344>
>     [3] https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006781216 <https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006781216>
>     [4] https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/resources/META-INF/services/javax.validation.ConstraintValidator <https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/resources/META-INF/services/javax.validation.ConstraintValidator>
>
-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Re: bval-jsr 2.0.5 not loading META-INF/services/javax.validation.ConstraintValidator ?

Posted by Matt Benson <gu...@gmail.com>.
It looks to me as though this is an implementation-specific feature of
Hibernate Validator [1]. The BV specification v2.0 makes no mention of
loading constraint validators from META-INF/services.

Matt

[1]
https://docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#_constraint_definitions_via_code_serviceloader_code

On Fri, Jan 7, 2022 at 1:27 AM Francesco Chicchiriccò <il...@apache.org>
wrote:

> Hi,
> at Syncope we are having troubles while making Spring Cloud Gateway 3.1.0
> working with BVal 2.0.5 (rather than Hibernate Validator, which seems to be
> their default).
>
> Essentially, the issue is with this annotation [1] leading to startup
> errors like as [2].
>
> I have reached out to the Spring Cloud Gateway project, and they are
> claiming [3] the issue being on BVal not correctly loading their
> META-INF/services/javax.validation.ConstraintValidator [4].
>
> Can you shed some light? Is it actually a bug on BVal or some kind of
> misconfiguration on their side?
>
> TIA.
> Regards.
>
> [1]
> https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/HttpClientProperties.java#L100
> [2]
> https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006773344
> [3]
> https://github.com/spring-cloud/spring-cloud-gateway/pull/2389#issuecomment-1006781216
> [4]
> https://github.com/spring-cloud/spring-cloud-gateway/blob/v3.1.0/spring-cloud-gateway-server/src/main/resources/META-INF/services/javax.validation.ConstraintValidator
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Member at The Apache Software Foundation
> Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
> http://home.apache.org/~ilgrosso/
>
>