# Bean validation in a custom SPI

**URL:** <https://forum.keycloak.org/t/bean-validation-in-a-custom-spi/22836>\
**Category:** Getting advice\
**Created:** [June 22, 2023, 5:51pm UTC](https://forum.keycloak.org/t/bean-validation-in-a-custom-spi/22836 "2023-06-22T17:51:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![widehusk](https://avatars.discourse-cdn.com/v4/letter/w/22d042/32.png) [@widehusk](https://forum.keycloak.org/u/widehusk)\
**Post date:** [June 22, 2023, 5:51pm UTC](https://forum.keycloak.org/t/bean-validation-in-a-custom-spi/22836/1 "2023-06-22T17:51:14Z")

</div>

I have deployed a custom SPI into the Quarkus distribution of Keycloak.  
I noticed that lots of features that would work in a standalone Quarkus application (with autoconfiguration), don’t work in a custom SPI.  
In this case, I’m not able to validate a REST request body with **jakarta.validation**.  
Annotations like **@Valid** , and **@NotNull** are ignored.  
Tried to inject a **Validator** object manually, but such a bean does not exist.  
Also tried to call **Validation.buildDefaultValidatorFactory()** but it says **“jakarta.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath”**.  
Is there any solution to this?  
thanks!

---

<div class="post-metadata">

**Author:** ![angelomelonas](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/angelomelonas/32/11123_2.png) [@angelomelonas](https://forum.keycloak.org/u/angelomelonas)\
**Post date:** [August 26, 2024, 8:32am UTC](https://forum.keycloak.org/t/bean-validation-in-a-custom-spi/22836/2 "2024-08-26T08:32:29Z")

</div>

You can try the workaround solution proposed [here](https://github.com/keycloak/keycloak/discussions/22687#discussioncomment-8484254).
