简体   繁体   中英

The last Spring boot validation not working

I'm a beginner in spring boot and I found a problem with validation It doesn't work and I tried spring validation also hibernate dependency. I have the last version of spring boot 2.7.2 I add
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId> </dependency> to my pom.xml but when I add @NotNull to my bean gave me an error, and showed me there's not a @NonNull Annotation.

I faced the same issue. In my case, there was a problem with my pom. I had a dependency on the hibernate-validator. So I removed and worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM