11 Replies Latest reply on Jan 20, 2011 4:20 AM by Ilya Sorokoumov

    equivalent to h:selectManyListbox

    Andi D Newbie

      hi JBoss group,

       

      I'm using the following jsf component for adding groups (AppGroup) to my users (AppUser):

       

      <ui:decorate template="/layout/edit.xhtml">
        <ui:define name="label">#{messages.groups}</ui:define>
        <h:selectManyListbox id="groups" converter="baseEntityConverter"
              value="#{appUserHome.instance.groups}" size="3">
          <f:selectItems value="#{appGroupList.all}" var="group"
              itemLabel="#{group.name}" itemValue="#{group}" />
        </h:selectManyListbox>
      </ui:decorate>
      

       

      I get a LazyInitializationException at the h:selectManyListbox. I tried to display all selected groups with

       

      <ui:decorate template="/layout/edit.xhtml">
        <ui:define name="label">#{messages.groups}</ui:define>
        <rich:list id="list" var="group" value="#{appUserHome.instance.groups}" type="unordered" title="Group">
          <h:outputText value="#{group.name}" />
        </rich:list>
      </ui:decorate>
      

       

      and all available groups with:

       

      <ui:decorate template="/layout/edit.xhtml">
        <ui:define name="label">#{messages.groups}</ui:define>
        <rich:list id="list" var="group" value="#{appGroupList.all}" type="unordered" title="Group">
          <h:outputText value="#{group.name}" />
        </rich:list>
      </ui:decorate>
      

       

      both examples are working fine!

       

      Do you know an alternative to h:selectManyListbox or the reason for this LazyInitialisationexception?

       

      Andi

       

      btw: I'm using richfaces in version 4.0.0.20101110-M4

        • 1. equivalent to h:selectManyListbox
          Ilya Sorokoumov Master

          LazyInitialisationException is a hibernate exception. Hibernate throws it at the moment when you are trying to get a collection/ or a field from an entity which has fetchType=LAZY(Collection/Set/List - they all have fetchType=LAZY by default).

          Possible solutions:

          1) Specify fetchType=EAGER. Thus Hibernate will load this field/collection every time when you retrieve the entity from DB.

          2) You can get this field/collection earlier when it's still in a transaction where it was retrieved.

          Looks like this:

          Entity x = find(...);

          x.getUsers().size();//initialized

          x.getUser().getLogin();//user initialized

          3) org.hibernate.Hibernate has a method initialize and you can use it to force Hibernate to retrieve this field/collection from DB even if it's out of transaction.

           

          P.S. I think that the best way is 2. It's the most right way but it's a little bit inconvenient.

          • 2. Re: equivalent to h:selectManyListbox
            Andi D Newbie

            Hi Ilya,

             

            thanks for your reply!

            I have the fetchType EAGER and I still get the LazyInitialisationexception. Here is my many to many relation:

             

            @Entity
            @Table(name = "app_user")
            @NamedQueries( { @NamedQuery(name = AppUser.findAppUserByExternalId,query = "Select a FROM AppUser a WHERE a.externalId=:externalId") })
            public class AppUser extends BaseEntity implements Serializable
            { // some code ...
            
              @ManyToMany(cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, fetch=FetchType.EAGER)
              @JoinTable(name="AppUser_AppGroup",
                      joinColumns={@JoinColumn(name="user_id")},
                      inverseJoinColumns={@JoinColumn(name="group_id")})
              public List<AppGroup> getGroups()
              {
                return groups;
              }
            
              // additional code ...
            }
            

             

            @Entity
            @Table(name = "app_group")
            public class AppGroup extends BaseEntity implements Serializable
            { // some code ...
            
              @ManyToMany(cascade ={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.EAGER)
              @JoinTable(name="AppUser_AppGroup",
                      joinColumns={@JoinColumn(name="group_id")},
                      inverseJoinColumns={@JoinColumn(name="user_id")})
              public Set<AppUser> getUsers()
              {
                return users;
              }
            }
            

             

            The LIE message is:  "org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed"

            • 3. Re: equivalent to h:selectManyListbox
              Ilya Sorokoumov Master

              Could you post a code of baseEntityConverter?

              • 4. Re: equivalent to h:selectManyListbox
                Andi D Newbie

                here we are:

                 

                @RequestScoped
                @Stateful
                public class BaseEntityConverter implements Serializable, Converter
                {
                  private static final long serialVersionUID = -5707811255009867171L;
                  final static Logger log = LoggerFactory.getLogger(BaseEntityConverter.class);
                
                  @Inject @SeqBenchPersistence private EntityManager entityManager;
                
                  private EntityManager getEntityManager(){
                    BeanManager beanManager = new BeanManagerLocator().getBeanManager();
                //    BeanManager beanManager = BeanManagerAccessor.getBeanManager(); // old WELD extensions style
                    Bean bean = null;
                    try {
                      bean = beanManager.getBeans(EntityManager.class, DBFactory.class.getMethod("create").getAnnotation(SeqBenchPersistence.class)).iterator().next();
                    } catch (SecurityException e) { 
                      e.printStackTrace();
                      return null;
                    } catch (NoSuchMethodException e) { e.printStackTrace(); }
                    EntityManager entityManager = (EntityManager) beanManager.getReference(bean, bean.getClass(), beanManager.createCreationalContext(bean));
                    return entityManager;
                  }
                
                  @Override
                  public Object getAsObject(FacesContext context, UIComponent component, String serializationstring) {
                    Object obj = null;
                    if (serializationstring == null) {
                      log.error("Entity can not be deserialized because string is null");
                      return null;
                    }
                    String deserialization_components[] = serializationstring.split(":");
                    if (deserialization_components.length != 2) {
                      log.error("Entity can not be deserialized from string: (" + serializationstring + ")");
                      return null;
                    }
                    Class<?> className = null;
                    try {
                      className = Class.forName(deserialization_components[0]);
                    } catch (ClassNotFoundException ex) {
                      log.error("Entity can not be deserialized from string: (" + serializationstring + "): invalid class name");
                      return null;
                    }
                    EntityManager entityManager = this.getEntityManager();    if (entityManager != null) {
                      long id = Long.valueOf(deserialization_components[1]);
                      log.debug("Unserializing the entity " + deserialization_components[0] + " with PK: " + id);
                      try {
                        obj = entityManager.find(className, id);
                      } catch (Exception e) { log.error("Exception" + e.getMessage()); }
                    }
                    return obj;
                  }
                
                  @Override
                  public String getAsString(FacesContext context, UIComponent component, Object value) {
                    String str = null;
                
                    if (value != null) {
                      str = String.valueOf("" + value.getClass().getCanonicalName() + ":" + ((BaseEntity) (value)).getId());
                    }
                    return str;
                  }
                }
                
                • 5. Re: equivalent to h:selectManyListbox
                  Ilya Sorokoumov Master

                  It's definitely hard to say what's wrong with your code. But It looks like that you have some other LAZY fields in your AppGroup bean. So when you use itemValue="#{group}" JSF tries to  serialize your entity and executes get method of this field. Check all fields of AppGroup bean, please.

                  • 6. Re: equivalent to h:selectManyListbox
                    Andi D Newbie

                    Hi Ilya,

                     

                    what do you mean with "LZY fields"? I'm not familiar with this expression, so I do not know what I'm looking for... But here is my AppGroup and the extended class BaseEntity: (You can see that I removed the cascade parameters since my last post.)

                     

                    @Entity
                    @Table(name = "app_group")
                    public class AppGroup extends BaseEntity implements Serializable
                    { private static final long serialVersionUID = 2270165602230271351L;
                    
                      private String name;
                      private Set<AppUser> users;
                    
                      public AppGroup()
                      { super();
                        users = new HashSet<AppUser>(0); }
                    
                      public AppGroup(String name)
                      { this();
                        this.name = name; }
                    
                      @Id  @Column(name = "id",nullable = false)
                      @GeneratedValue(strategy = GenerationType.AUTO,generator = "app_group_seq_gen")
                      @SequenceGenerator(name = "app_group_seq_gen",sequenceName = "app_group_seq")
                      @Override
                      public Long getId(){ return this.id; }
                    
                      @Column(name = "name")
                      @NotNull
                      public String getName(){ return name; }
                    
                      public void setName(String name){ this.name = name; }
                    
                      public void setUsers(Set<AppUser> users){ this.users = users; }
                    
                      @ManyToMany(fetch = FetchType.EAGER)
                      @JoinTable(name="AppUser_AppGroup",
                              joinColumns={@JoinColumn(name="group_id")},
                              inverseJoinColumns={@JoinColumn(name="user_id")})
                      public Set<AppUser> getUsers(){ return users; }
                    
                      @Override  @Transient
                      public Class getClassName(){ return AppGroup.class; }
                    
                      @Override
                      @Transient
                      public String getLabel(){ return "Group"; }
                    }
                    

                     

                    @MappedSuperclass
                    public abstract class BaseEntity implements Serializable
                    { private static final long serialVersionUID = -391935948745414286L;
                    
                      protected Long id;
                    
                      public BaseEntity() { super(); }
                    
                      public BaseEntity(Long id)
                      { super();
                        this.id = id;
                      }
                    
                      @Transient public abstract Long getId();
                    
                      public void setId(Long id) { this.id = id; }
                    
                      @Transient public abstract Class<BaseEntity> getClassName();
                    
                      @Transient public abstract String getLabel();
                    
                      @Override public boolean equals(Object obj) {
                        // some code
                      }
                    
                      @Override public int hashCode() {
                        // some code
                      }
                    
                      @Override public BaseEntity clone() throws CloneNotSupportedException {
                        // some code
                      }
                    }
                    
                    • 7. Re: equivalent to h:selectManyListbox
                      Ilya Sorokoumov Master

                      Actually I meant that AppGroup has some other fields which have FetchType.LAZY. Or for instance when JSF serialize AppGroup entity it gets all the AppUser entities from the relation using getUsers() and then JSF tries to get all the fields from AppUser entity and finds some fields with FetchType.LAZY(like @oneToMany relations with some other tables) which were not initialized. But these are only my guesses. And taking into account that you are using convertor everything should have been ok.

                      To check all this out I need a stack trace of your exception. But I'm afraid you may not have it because in your code you do not print it into the log.

                      • 8. Re: equivalent to h:selectManyListbox
                        Andi D Newbie

                        Hi again Ilya,

                         

                        From which part do you need a log?

                        Here is my actual Stacktrace (of server.log):

                        2011-01-13 10:43:53,240 ERROR [org.hibernate.LazyInitializationException] (http-127.0.0.1-8280-2) failed to lazily initialize a collection, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed
                            at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) [:3.6.0.Final]
                            at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) [:3.6.0.Final]
                            at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122) [:3.6.0.Final]
                            at org.hibernate.collection.PersistentBag.isEmpty(PersistentBag.java:255) [:3.6.0.Final]
                            at javax.faces.component.UIInput.isEmpty(UIInput.java:1228) [:2.0.3-]
                            at javax.faces.component.UIInput.validateValue(UIInput.java:1137) [:2.0.3-]
                            at javax.faces.component.UISelectMany.validateValue(UISelectMany.java:577) [:2.0.3-]
                            at javax.faces.component.UIInput.validate(UIInput.java:960) [:2.0.3-]
                            at javax.faces.component.UIInput.executeValidate(UIInput.java:1204) [:2.0.3-]
                            at javax.faces.component.UIInput.processValidators(UIInput.java:693) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIForm.processValidators(UIForm.java:240) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1159) [:2.0.3-]
                            at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:72) [:2.0.3-]
                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) [:2.0.3-]
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) [:2.0.3-]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:69) [:3.0.0.Alpha3]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.seam.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:79) [:3.0.0.Alpha3]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
                            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
                            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
                            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
                            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
                            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
                            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
                            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
                            at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
                            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
                            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
                            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
                            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
                        
                        2011-01-13 10:43:53,249 WARNUNG [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-127.0.0.1-8280-2) failed to lazily initialize a collection, no session or session was closed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed
                            at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) [:3.6.0.Final]
                            at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) [:3.6.0.Final]
                            at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122) [:3.6.0.Final]
                            at org.hibernate.collection.PersistentBag.isEmpty(PersistentBag.java:255) [:3.6.0.Final]
                            at javax.faces.component.UIInput.isEmpty(UIInput.java:1228) [:2.0.3-]
                            at javax.faces.component.UIInput.validateValue(UIInput.java:1137) [:2.0.3-]
                            at javax.faces.component.UISelectMany.validateValue(UISelectMany.java:577) [:2.0.3-]
                            at javax.faces.component.UIInput.validate(UIInput.java:960) [:2.0.3-]
                            at javax.faces.component.UIInput.executeValidate(UIInput.java:1204) [:2.0.3-]
                            at javax.faces.component.UIInput.processValidators(UIInput.java:693) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIForm.processValidators(UIForm.java:240) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1159) [:2.0.3-]
                            at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:72) [:2.0.3-]
                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) [:2.0.3-]
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) [:2.0.3-]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:69) [:3.0.0.Alpha3]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.seam.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:79) [:3.0.0.Alpha3]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
                            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
                            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
                            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
                            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
                            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
                            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
                            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
                            at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
                            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
                            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
                            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
                            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
                        
                        2011-01-13 10:43:53,257 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/SeqBench].[Faces Servlet]] (http-127.0.0.1-8280-2) Servlet.service() for servlet Faces Servlet threw exception: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, no session or session was closed
                            at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) [:3.6.0.Final]
                            at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) [:3.6.0.Final]
                            at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122) [:3.6.0.Final]
                            at org.hibernate.collection.PersistentBag.isEmpty(PersistentBag.java:255) [:3.6.0.Final]
                            at javax.faces.component.UIInput.isEmpty(UIInput.java:1228) [:2.0.3-]
                            at javax.faces.component.UIInput.validateValue(UIInput.java:1137) [:2.0.3-]
                            at javax.faces.component.UISelectMany.validateValue(UISelectMany.java:577) [:2.0.3-]
                            at javax.faces.component.UIInput.validate(UIInput.java:960) [:2.0.3-]
                            at javax.faces.component.UIInput.executeValidate(UIInput.java:1204) [:2.0.3-]
                            at javax.faces.component.UIInput.processValidators(UIInput.java:693) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIForm.processValidators(UIForm.java:240) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1081) [:2.0.3-]
                            at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1159) [:2.0.3-]
                            at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:72) [:2.0.3-]
                            at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) [:2.0.3-]
                            at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114) [:2.0.3-]
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308) [:2.0.3-]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.seam.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:69) [:3.0.0.Alpha3]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.jboss.seam.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:79) [:3.0.0.Alpha3]
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:6.0.0.Final]
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
                            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
                            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
                            at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
                            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
                            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
                            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
                            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
                            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
                            at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
                            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
                            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
                            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
                            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
                        
                        • 9. equivalent to h:selectManyListbox
                          Ilya Sorokoumov Master

                          0) Try to go through all collections/Ssts which you are using in your code before showing it on the page. Try to reproduce this bug by accessing getters.

                          1) Do you have some other relations in AppUser or related entities with FetchType.LAZY or with not specified FetchType?

                          2) Take a look at this topic and check out your hashCode implementation:

                          https://forums.hibernate.org/viewtopic.php?f=1&t=991542&view=next

                          3) It can help you too http://community.jboss.org/wiki/OpenSessioninView. But I'm not sure that it's a very good idea.

                          • 10. Re: equivalent to h:selectManyListbox
                            Andi D Newbie

                            Hi again,

                             

                            the solution is to at the correct collectionType to the h:selectManyListbox....

                             

                                                <h:selectManyListbox id="groups" 
                                                    collectionType="java.util.ArrayList"
                                                    converter="baseEntityConverter"
                                                    value="#{appUserHome.instance.groups}" size="3">
                                                   <f:selectItems value="#{appGroupList.all}"
                                                           var="group"
                                                           itemLabel="#{group.name}" itemValue="#{group}" />
                                                </h:selectManyListbox>        
                            
                            • 11. equivalent to h:selectManyListbox
                              Ilya Sorokoumov Master

                              Thanks for your reply. I did find this attribute but this one is new and it wasn't present in jsf 1.2. Everyone who wants to find its definition can look at this:

                              http://download.oracle.com/javaee/6/javaserverfaces/2.0/docs/renderkitdocs/HTML_BASIC/javax.faces.SelectManyjavax.faces.Listbox.html