-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Client Side Bean Validation: HV000250: Uninitialized locale #216
Comments
Let me check this out. |
Verified its not working for me either. I have to step through the JS code to find out why not. |
I haven't forgotten about this just debugging trying to figure out what is going on. |
I appreciate this very much! No rush though :) This forced me to put some real effort into the REST API validation/error handling. |
OK got to the bottom of it. Primefaces scans your bean for constraints so it can put them on the client side but this class is returning no results when running in Quarkus: https://github.com/primefaces/primefaces/blob/master/primefaces/src/main/java/org/primefaces/metadata/BeanValidationMetadataExtractor.java I am sure this has to do with Quarkus, reflection, or the Hibernate Validator implemented differently for Quarkus. I am afraid this feature probably will not work with Quarkus. |
Looks like we are not alone vaadin/flow#15352 |
I will see if I can ask on the mailing list to see if anyone knows if there is a way to do what we need |
I got to the bottom of the JS errors when running the "Basic" CSV scenario not the "Bean" scenario and fixing it in PFE: primefaces-extensions/primefaces-extensions#1010 |
Also posted on the Dev mailing list: https://groups.google.com/g/quarkus-dev/c/KUHY1q8AfuE |
@zeppelinux I got to the bottom of it and fixed it! primefaces/primefaces#9546 |
You Rock! |
Quarkus + Hibernate team admitted its a bug on their end and is fixing it for Quarkus 2.15.2 See: quarkusio/quarkus#30139 |
Upgraded to Quarkus 2.15.2 and still getting this:
Probably something else. |
Are you getting it in your own project or in this showcase? |
My own project, which was created using showcase (i.e. should behave the same, but something is different). |
Yep something is not the same. But this error is very strange. It's saying you are missing a locale. |
Had to introduce this to fix it in my project:
|
That is very bizarre. I wonder why I don't have to do that here on this showcase? |
try changing the pom.xml
|
Oh good idea. I will report back! |
Hmmm bumped to JDK17 and its still working fine.
And are you sure you are just using this dependency? <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
</dependency> |
Confirmed, I can consistently make quarkus-faces to fail (at least in my environment) on the same exception by setting/downgrading <primefaces-extensions.version>12.0.2</primefaces-extensions.version> It doesn't fixes it for my project (without ValidatorFactoryCustomizer), unfortunately. I have bunch of other dependencies, something is still on the way. |
i feel like something else is colliding. Can you post your pom.xml here ? |
Sure, but let's see if we can both reproduce it in quarkus-faces first. When you change the pom.xml line 23 to and
Does it fail for you? |
Well, this is 'interesting'... because i'm not doing any other change to the quarkus-faces, here is my Mac OS Java runtime: dimas@Jam quarkus-faces % java -version |
I just updated to Adoptium 17.0.5 from Oracle 17.0 and still no issue. I can't imagine its JDK related?
|
Found this really old Quarkus ticket from 2019 but says its fixed: quarkusio/quarkus#5882 |
can you do |
dimas@Jam quarkus-faces % mvn --version Here is screen capture video: |
OK can you do me a favor and grab that Entire stack trace. I am wondering if its somehow a MyFaces issue I want to look through the stack and walk back through it to see if I can see anything strange. |
Here it is:
|
OK I am stumped unless its some kind of timing or threading issue because the code from MyFaces and Hibernate both look fine. But it checks a ConcurrentHashmap to see if its loaded so I guess its possibly some weird timing issue. My machine is pretty fast so I wonder if that is why I dont see it? |
Most likely. And there is an easy workaround... Hopefully this, whatever it is, doesn't show it's ugly face anywhere else. Thanks a lot for looking into it 🍻 |
@zeppelinux I as able to reproduce your issue and got to the bottom of it. Can you add these two properties to your # default bean validation locale
quarkus.default-locale=en
# The list of all the supported MyFaces locales
quarkus.locales=ar,ca,cs,de,en,en_US,es,fr,it,ja,mt,nl,pl,pt,pt_BR,ru,sk,uk,zh_CN,zh_HK,zh_TW |
Confirmed it works in my proj @melloware, Thanks! |
Bean Validation doesn't seem to kick in in showcase (/ui/csv/bean.xhtml).
I have slightly different problem, it kicks in for my dto/bean, but fails with:
2022-12-13 00:41:39,451 SEVERE [org.pri.app.exc.PrimeExceptionHandler] (executor-thread-6) HV000250: Uninitialized locale: en. Please register your locale as a locale to initialize when initializing your ValidatorFactory.: javax.validation.ValidationException: HV000250: Uninitialized locale: en. Please register your locale as a locale to initialize when initializing your ValidatorFactory. at org.hibernate.validator.resourceloading.PlatformResourceBundleLocator.getResourceBundle(PlatformResourceBundleLocator.java:181) at org.hibernate.validator.messageinterpolation.AbstractMessageInterpolator.resolveMessage(AbstractMessageInterpolator.java:449) at org.hibernate.validator.messageinterpolation.AbstractMessageInterpolator.lambda$interpolateMessage$0(AbstractMessageInterpolator.java:399) at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) at org.hibernate.validator.messageinterpolation.AbstractMessageInterpolator.interpolateMessage(AbstractMessageInterpolator.java:399) at org.hibernate.validator.messageinterpolation.AbstractMessageInterpolator.interpolate(AbstractMessageInterpolator.java:355) at org.apache.myfaces.core.api.shared.FacesMessageInterpolator.interpolate(FacesMessageInterpolator.java:47) at org.hibernate.validator.internal.engine.validationcontext.AbstractValidationContext.interpolate(AbstractValidationContext.java:322)
The text was updated successfully, but these errors were encountered: