Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings about lack of "Hibernate Validator", despite no validation annotations being used #31469

Closed
fedinskiy opened this issue Feb 28, 2023 · 3 comments · Fixed by #31472
Closed
Assignees
Labels
area/hibernate-validator Hibernate Validator kind/bug Something isn't working
Milestone

Comments

@fedinskiy
Copy link
Contributor

fedinskiy commented Feb 28, 2023

Describe the bug

I have an application, which uses quartz,agroal and hibernate-panache and saves data into DB on regular intervals. After update to the latest 999-SNAPSHOT(1d45952) it now shows multiple warnings about jakarta.validation.NoProviderFoundException being thrown. The application doesn't use any code from javax.validation or jakarta.validation packages. Adding quarkus-hibernate-validator solves this problem. Nothing of sorts is mentioned in the migration guide[1].

[1] https://docs.jboss.org/hibernate/orm/6.0/migration-guide/migration-guide.html

Expected behavior

The application should work without warnings, and should not require quarkus-hibernate-validator

Actual behavior

(JPA Startup Thread) Error calling `jakarta.validation.Validation#buildDefaultValidatorFactory`: 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.
	at jakarta.validation.Validation$GenericBootstrapImpl.configure(Validation.java:291)
	at jakarta.validation.Validation.buildDefaultValidatorFactory(Validation.java:103)
	at org.hibernate.boot.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:483)
	at org.hibernate.boot.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:83)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.hibernate.boot.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:140)
	at org.hibernate.internal.SessionFactoryImpl.integrate(SessionFactoryImpl.java:451)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:247)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:200)
	at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:78)
	at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:73)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
	at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
	at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:167)
	at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:68)
	at java.base/java.lang.Thread.run(Thread.java:833)

How to Reproduce?

  1. git clone git@github.com:fedinskiy/beefy-scenarios.git -b reproducer/hibernate-6
  2. beefy-scenarios/017-quartz-cluster
  3. mvn clean verify #exceptions in logs
  4. add <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-hibernate-validator</artifactId> </dependency>
    to pom.xml
  5. Run mvn clean verify # no exceptions in app logs
  6. If command in step 3 uses -Dquarkus.platform.version=3.0.0.Alpha4, then the app works even without hibernate-validator

The app doesn't use any validation: find src/ | xargs grep 'validation'

Output of uname -a or ver

6.0.18-300.fc37.x86_64

Output of java -version

17.0.5, vendor: GraalVM Community

GraalVM version (if different from Java)

No response

Quarkus version or git rev

1d45952

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

Probably related to #31235

@fedinskiy fedinskiy added the kind/bug Something isn't working label Feb 28, 2023
@quarkus-bot quarkus-bot bot added the area/hibernate-validator Hibernate Validator label Feb 28, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Feb 28, 2023

/cc @gsmet (hibernate-validator), @yrodiere (hibernate-validator)

@fedinskiy fedinskiy changed the title [WIP] Warnings about lack of "Hibernate Validator", despite no validation annotations being used Warnings about lack of "Hibernate Validator", despite no validation annotations being used Feb 28, 2023
@yrodiere
Copy link
Member

That's probably related to #30617, though I'll have to investigate to know what's happening exactly

@gsmet
Copy link
Member

gsmet commented Feb 28, 2023

Yes this is known, has been reported, AFAIK fixed in Hibernate ORM and we are waiting for a new version. I will work around it for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-validator Hibernate Validator kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants