Hibernate Validator warnings are displayed when optional ResourceBundles are missing
See original GitHub issueDescribe the bug
When an app depending on the Hibernate Validator extension is package using the native build, the following messages are printed to the output:
The bundle named: ContributorValidationMessages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
The bundle named: ValidationMessages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
The bundle named: messages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
Although that does no harm to the build, it may lead to confusion giving that those bundles are optional.
Expected behavior
Do not print any message if the bundle does not exist in the user’s application
Actual behavior
The message is printed.
How to Reproduce?
- Clone https://github.com/quarkusio/registry.quarkus.io
- run
mvn clean package -Dnative -DskipTests
Output of uname -a
or ver
Fedora 35
Output of java -version
11
GraalVM version (if different from Java)
21
Quarkus version or git rev
2.5.0.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Maven 3.8.4
Additional information
This issue was originated from a chat in Zulip.
Also it seems that this snippet may need to be enhanced to check if the bundle really exists
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Hibernate Validator 8.0.0.Final - Jakarta Bean Validation ...
This chapter will show you how to get started with Hibernate Validator, the reference implementation (RI) of Jakarta Bean Validation.
Read more >Spring Validation Example - Spring MVC Form Validator
Apart from standard Spring MVC artifacts, we have validation-api and hibernate-validator dependencies in the project.
Read more >Hibernate validation does not fail on missing fields
I am using hibernate.ddl-auto=validate in my spring boot ... my User class is missing the "name" field, hibernate validation does not alert ......
Read more >Jakarta Bean Validation specification
Support for java.util.Optional. Support for the property types declared by JavaFX. Support for custom container types by plugging in additional ...
Read more >Validation with Hibernate Validator - Quarkus
To create a Gradle project, add the --gradle or --gradle-kotlin-dsl option. For more information about how to install the Quarkus CLI and use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Your problem is due to the fact that there is a
messages
resource bundle in the Kotlin compiler jar:and when we are testing if a
messages
is around before adding it to the native resource bundles, this resource is accessible but it is not accessible at runtime anymore.@aloubyansky @stuartwdouglas while not critical, this is yet another occurrence of the CL used to test if classes/resources are available at build time being polluted with the build artifacts. What we usually want to do is to test if the thing will be available at runtime (I remember I posted something somewhere about the Infinispan test server polluting the classpath big time).
https://github.com/quarkusio/quarkus/pull/22938 will fix it once and for all.