Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5
-
None
Description
Hello,
A user posted an issue with the Converter's here:
https://stackoverflow.com/questions/58825333/facesconverter-is-null-jsf-2-3-cdi-2-0
I investigated the issue, and it is caused by the beanManger#getBeans inside the /org/apache/myfaces/cdi/util/CDIUtils.java file. The getBeans returns an empty set instead of the converter bean. It searches by class, but it should also check by type. Since it's an problem with MyFaces code, I thought I'd open an issue here.
I've provided a patch (overloading the CDIUtil.java methods to accept a type) and sample app (borrowed from StackOverflow).
I only modified the code to search by type (1) when using getBeans. Type is obtained from creating a TypeLiteral (2).
Since Validators don't check by type as Converters, I can make another fix if you don't have any issues with this patch.
Please let me know if you have questions or suggestions for the code.
2) https://javaee.github.io/javaee-spec/javadocs/javax/enterprise/util/TypeLiteral.html
Attachments
Attachments
Issue Links
- links to