-
Notifications
You must be signed in to change notification settings - Fork 110
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
The @FacesValidator, @FacesComponent, @FacesConverter and @FacesBehavior injection is not supported #4645
Comments
You need @FacesValidator(..., managed=true). If that works, please close the issue here. |
Thank you for your reply! |
Hi,I think I found the reason. https://github.com/javaserverfaces/mojarra/commit/93011dc57a07063094d70906dae12ec760904614#diff-92a6ce2db2d9b6ac520aea86b4fcaf84 com/sun/faces/application/ApplicationImpl.java if (map.hasAnnotations(key)) { InjectionProvider injectionProvider = associate.getInjectionProvider(); try { injectionProvider.invokePostConstruct(result); } catch (InjectionProviderException ex) { LOGGER.log(Level.SEVERE, "Unable to invoke @PostConstruct annotated method on instance " + key, ex); throw new FacesException(ex); } try { injectionProvider.inject(result); } catch (InjectionProviderException ex) { LOGGER.log(Level.SEVERE, "Unable to inject instance" + key, ex); throw new FacesException(ex); } } But,I'm not sure why it was deleted . |
There is the (old) open bug entry #4245 about that. This thread also contains a workaround (Jul 30, 2017). However, it would be nice to have a real fix. Chris |
For Mojarra 2.3 and earlier please contact your vendor for support (RedHat, IBM, Oracle, Omnifish, Payara, etceteras) |
Environment Details
Problem Description
I referenced the following link to build a java test.
https://github.com/javaserverfaces/mojarra/blob/2.2.7/jsf-ri/systest/src/com/sun/faces/annotation/AnnotatedValidator.java
The test code is shown as following.
I run the test code in GlassFish4.1(JSF 2.2.7), and turns out that it can get the value of "welcomeMessage" which is defined in web.xml by using the @resource.
However, I run the same code in GlassFish5.1(JSF 2.3.9), there is no value setted for the "welcomeMessage"."welcomeMessage" becomes null.
It's the same result when I use @FacesComponent, @FacesConverter or @FacesBehavior annotation in java test code.
Now that, I have the question:
Why the @FacesValidator, @FacesComponent, @FacesConverter and @FacesBehavior injection is not supported in GlassFish5.1?
The text was updated successfully, but these errors were encountered: