title: JSF Converter can't convert my conversion class into a interface javax.faces.convert.Converter
body: <p>I am working on an application using JSF and PrimeFaces and EJB 3.0, server jBoss 7.1.</p>
  
  <p>I am trying to implement a Conversor in my xhtml page and I have this error:</p>
  
  <pre><code>"javax.servlet.ServletException: /flySearch.xhtml @18,123 converter="#{customerIdConverter}": No puedo convertir com.flymee.controller.CustomerIdConverter@5a6055c desde tipo class com.flymee.controller.CustomerIdConverter$Proxy$_$$_WeldClientProxy a interface javax.faces.convert.Converter"
  </code></pre>
  
  <p>Can't convert from customerIdConverter to interface javax.faces.convert.Converter</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;h:form id="searchFly"&gt;
  
          &lt;h:panelGrid columns="5" border="0"&gt;            
              &lt;h:panelGroup&gt;
                  &lt;p:selectOneMenu value="#{searchController.airport1}" filter="true" filterMatchMode="startsWith" 
                      style="width:180px" panelStyle="width:180px" effect="fade" id="arrivalAirport" converter="#{customerIdConverter}"&gt;  
                      &lt;f:selectItem itemLabel="Select One" itemValue="" /&gt;  
                      &lt;f:selectItems value="#{searchController.airports}" var="micar"  itemLabel="#{micar.value} - #{micar.description}" itemValue="#{micar}"/&gt;                 
                  &lt;/p:selectOneMenu&gt;
              &lt;/h:panelGroup&gt;
  
              &lt;h:commandButton style="margin-left:50px" value="#{text['common.buscar']}" actionListener="#{searchController.searchFlights()}"/&gt;
          &lt;/h:panelGrid&gt;
      &lt;/h:form&gt;
  </code></pre>
  
  <p>and this is my converted class</p>
  
  <pre><code>    @FacesConverter
  @Model
  public class CustomerIdConverter implements Converter {
  
      @Override
      public Object getAsObject(FacesContext context, UIComponent component, String value) {
  
          System.out.println("test getAsObject");
  
          if (value == null || value.isEmpty()) {
              return null;
          }
  
          try {
  
              Object obj =  null;
  
              return obj;
          } catch (Exception e) {
              e.printStackTrace();
              throw new ConverterException(new FacesMessage(String.format("Cannot convert %s to Customer", value)), e);
          }
      }
  
      @Override
      public String getAsString(FacesContext context, UIComponent component, Object value) {
  
          System.out.println("test getAsString");
  
          if (!(value instanceof Airport)) {
              return null;
          }
  
          String s =  String.valueOf(((Airport) value).getId());
  
          return s;
      }
  
  }
  </code></pre>