Question

I installed OmniFaces 1.6, and I created Classes annotated @FacesConverter(forClass=MyClass.class)

during the project deployment in GlassFish i have several wornigs:

INFO: Initialisation de Mojarra 2.2.2 ( 20130809-1625 https://svn.java.net/svn/mojarra~svn/tags/2.2.2@12376) pour le contexte «/ErpCCFWEB»
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
INFO: Running on PrimeFaces 4.0.RC1

I have 3 annotated Classes, , one of them is the following:

@FacesConverter(forClass = Commune.class)
public class CommuneConverter implements Converter {

    private static final Logger LOG = Logger.getLogger(CommuneConverter.class.getName());
    @EJB
    private ReferentielDaoLocal myService;
    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {
        if (value == null) {
            return null;
        } else {
            try {
               // ReferentielDaoLocal myService = (ReferentielDaoLocal) new InitialContext().lookup("java:global/ErpCCF/ErpCCF-ejb/ReferentielDaoImpl");
                return myService.findCommuneByCode(value);
            } catch (Exception ex) {
                LOG.log(Level.SEVERE, "Converter Commune Error", ex.getMessage());
                return null;
            }

        }
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
        if (value == null) {
            return null;
        } else {
            return String.valueOf(((Commune) value).getIdCommune());
        }
    }
}
Was it helpful?

Solution

According to this:

Warnings are specific to Mojarra and completely unrelated to OmniFaces. This is fixed in Mojarra 2.1.26: https://java.net/jira/browse/JAVASERVERFACES-2987

The tracker includes also 2.2.3 as a fix version, so you could give it a try.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top