Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Extending DateTimeConverter breaks f:convertDateTime in Omnifaces 2.6 #368
I have a @FacesConverter which extends DateTimeConverter:
I reference it using:
this works fine, however, after upgrading from Omnifaces 2.5.1 to 2.6.1, using the normal converter:
now breaks. I get a message that the object is not a LocalDate. It appears that my converter is now called when using <f:convertDateTime>. Here is a abbreviated stack trace:
I have tested with exactly the same code, with the only difference being Omnifaces 2.6.1 versus 2.5.1.
I should note, that another class PCalendarLocalDateConverter extends LocalDateConverter above. One other change that had to be made from 2.5.1 to 2.6.1 was putting @Specializes on the PCalendarLocalDateConverter otherwise I get the AmbiguousResolutionException. Not sure if that is somehow related.
This is Wildfly 10.1.0.Final , so Mojarra 2.2. I also just discovered the "@Specializes" I had to add, causes things to break when using 2.5.1, not positive but the formatting of dates using the "localDateConverter" I think is happening with the "PCalendarLocalDateConverter" in the following scenario:
If I take out the @Specializes, everything starts to work again.
Did the way the converters get instantiated change to using CDI from something else? It kind of seems like the converter is being picked as if it was a forClass specification was used and the converterId is ignored. Not sure if this makes sense, since the converter stuff is still a bit of a black box to me.
Thanks for all the posts on stackoverflow and for Omnifaces, you have been a very valuable resource for figuring this stuff out. I will give the composition workaround a try.