4 Replies Latest reply on Aug 31, 2007 8:26 AM by Fredric

    Problems with converter

    Fredric Newbie

      I'm part of a project using JBoss Seam as the main component and have been struggling to get a simple select-box to work.
      Pretty soon I've found out that a Converter was needed which ended up in the following solution:

      My conveter's interface

      public interface MyConverter extends Converter {

      My converter implementation

      public class AroConverter implements MyConverter {
       private EntityManager em;
       private Log log;
       public Object getAsObject(FacesContext ctx, UIComponent component, String value) {
       log.info("AroConverter:getAsObject() :: " + value);
       ARO aro = null;
       if ((value==null)||value.length()==0) {
       throw new ConverterException("Error 1 !");
       for (Iterator iter = em.createQuery("from ARO").getResultList().iterator(); iter.hasNext();) {
       ARO a = (ARO) iter.next();
       aro = a;
       if (aro==null) {
       aro = new ARO();
       return aro;
       public String getAsString(FacesContext ctx, UIComponent component, Object value) {
       if((ARO)value != null)
       return ((ARO)value).getName();
       return "";

      Excerpt from my xhtml page

      <h:selectOneMenu id="selAro" value="#{selAcl.aro}" converter="#{ConvertARO}">
       <f:selectItems value="#{stockAction.axoRights}"/>

      When I started working on this problem, I created the converter without the interface, which seemed to work. But sometimes JBoss freaks ut, telling me that the converter cannot be found when rendering. I solved that part with the interface. Now It renders OK, but when I try to submit information to an action class, JBoss gives me the error message: java.lang.ClassNotFoundException: No ClassLoaders found for: com.test.actions.MyConverter

      Why do I get this error?