question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hibernate Validator warnings are displayed when optional ResourceBundles are missing

See original GitHub issue

Describe 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?

  1. Clone https://github.com/quarkusio/registry.quarkus.io
  2. 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Jan 10, 2022

Your problem is due to the fact that there is a messages resource bundle in the Kotlin compiler jar:

jar:file:/home/gsmet/.m2/repository/org/jetbrains/kotlin/kotlin-compiler/1.6.10/kotlin-compiler-1.6.10.jar!/messages

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).

0reactions
gsmetcommented, Jan 17, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found