Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING: javax.persistence.spi::No valid providers found

Tags:

java

hibernate

I am getting the warning

WARNING: javax.persistence.spi::No valid providers found.

I have code with JPA annotations, but I need them only to use with JOOQ.

How to remove this warning?

Adding my gradle file:

dependencies {
    compile project(':common:packages:autogenerated_dao')
    externalLib group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_databind_version
    externalLib group: 'javax.validation', name: 'validation-api', version: javax_validation_version
    externalLib group: 'org.hibernate', name: 'hibernate-validator', version: hibernate_validator_version
    externalLib group: 'javax.el', name: 'javax.el-api', version: javax_el_version
    externalLib group: 'org.glassfish', name: 'javax.el', version: glassfish_el_version
    externalLib group: 'javax.persistence', name: 'javax.persistence-api', version: javax_persistence_version
}
like image 915
parthivrshah Avatar asked Oct 12 '25 03:10

parthivrshah


2 Answers

Mentioned warning raised because javax.persistence-api dependency present in build file, but obviously here is no implementations for it. To get rid from warning, remove javax.persistence-api dependency. Bean Validation provided by validation-api and its implementation hibernate-validator, so you will be fine.

like image 161
Sergey Prokofiev Avatar answered Oct 14 '25 17:10

Sergey Prokofiev


I was having the same problem, but for my case was problems with org.hibernate and javax-api version compatibility , so do not use hibernate-core 6.0.0.final versión but maximum 'Alpha' versión. As per documentación says: '6.0 moves from Java Persistence as defined by the Java EE specs to Jakarta Persistence as defined by the Jakarta EE spec. The most immediate impact of this change is that applications would need to be updated to use the Jakarata Persistence classes (jakarta.persistence.) instead of the Java Persistence ones (javax.persistence.).'

like image 32
ROB Avatar answered Oct 14 '25 17:10

ROB



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!