Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8665123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:24:26+00:00 2026-06-12T17:24:26+00:00

I’m trying to create a datatable with the in cell editor. I have a

  • 0

I’m trying to create a datatable with the in cell editor. I have a column called “groups” which shows a list of groups. When the cell editor icon is clicked, it shows a checkboxMenu where a user can check whatever groups they want and then click submit.

I don’t even have my rowEditEvent handler yet and i’m getting a collection unmodifable exception. I can’t figure out what i’m doing wrong that i’m getting this exception.

Any help is appreciated.

group_admin.xhtml

<h:form>
    <p:dataTable value="#{userBacking.users}" var="users" editable="true">

        <p:column headerText="Groups">
            <p:cellEditor>
                <f:facet name="output">
                    <h:outputText value="#{users.groups}" />
                </f:facet>
                <f:facet name="input">
                    <p:selectCheckboxMenu value="#{users.groups}" label="Groups">
                        <f:selectItems value="#{groupBacking.groupsAsSelectItems}" />
                    </p:selectCheckboxMenu>
                </f:facet>
            </p:cellEditor>
        </p:column>

        <p:column headerText="Actions">
            <p:rowEditor />
        </p:column>

    </p:dataTable>
</h:form>

getUsers

public List<UserBean> getUsers() throws Exception {

        ContentManager cm = null;
        cm = getContentManager();

        if(users == null) {

            users = new ArrayList<UserBean>();

            UserManager um = cm.getUserManager();
            List<? extends Group> cmsGroups = um.getCmsDefinedGroups();
            List<? extends User> allUsers = um.getAllUsers(0, Integer.MAX_VALUE);

            // loop through each user
            for(User u : allUsers) {

                Set<? extends Group> groups = u.getGroups();

                UserBean user = new UserBean();
                user.setUserName(u.getUserName());
                user.setGroups(groups);  // THIS LINE CAUSES THE EXCEPTION
                users.add(user);
            }

        }

        return users;
    }

UserBean

public class UserBean implements User {

        private String userName;
        private String firstName;
        private String lastName;
        private Set<? extends Group> groups = null;

        public UserBean() {}

        public UserBean(String userName, String firstName, String lastName, Set<? extends Group> groups) {
            this.userName = userName;
            this.firstName = firstName;
            this.lastName = lastName;
            this.groups = groups;
        }
        public void setUserName(String userName) {
            this.userName = userName;
        }
        public String getUserName() {
            return userName;
        }
        public String getFirstName() {
            return firstName;
        }
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        }
        public String getLastName() {
            return lastName;
        }
        public void setLastName(String lastName) {
            this.lastName = lastName;
        }
        public Set<? extends Group> getGroups() {
            return groups;
        }
        public void setGroups(Set<? extends Group> groups) {
            this.groups = groups;
        }
        public void removeGroups() {
            groups = null;
        }

        @Override
        public boolean isDisabled() {
            // TODO Auto-generated method stub
            return false;
        }

        @Override
        public UserProfile getProfile() {
            // TODO Auto-generated method stub
            return null;
        }
    }

Stacktrace

Oct 9, 2012 1:09:08 PM com.sun.faces.renderkit.html_basic.MenuRenderer createCollection
SEVERE: Unable to create new Collection instance for type java.util.Collections$UnmodifiableSet
java.lang.InstantiationException: java.util.Collections$UnmodifiableSet
    at java.lang.Class.newInstance0(Class.java:340)
    at java.lang.Class.newInstance(Class.java:308)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.createCollection(MenuRenderer.java:907)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel(MenuRenderer.java:367)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue(MenuRenderer.java:129)
    at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:315)
    at org.primefaces.component.selectcheckboxmenu.SelectCheckboxMenuRenderer.getConvertedValue(SelectCheckboxMenuRenderer.java:34)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1028)
    at javax.faces.component.UIInput.validate(UIInput.java:958)
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1209)
    at javax.faces.component.UIInput.processValidators(UIInput.java:698)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1086)
    at javax.faces.component.UIData.iterate(UIData.java:1501)
    at javax.faces.component.UIData.processValidators(UIData.java:1026)
    at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:485)
    at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
    at javax.faces.component.UIData.visitTree(UIData.java:1233)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
    at javax.faces.component.UIForm.visitTree(UIForm.java:335)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
    at org.primefaces.component.tabview.TabView.visitTree(TabView.java:400)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
    at javax.faces.component.UIComponent.visitTree(UIComponent.java:1518)
    at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:366)
    at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:246)
    at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183)
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1163)
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thre

ad.java:662)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:24:29+00:00Added an answer on June 12, 2026 at 5:24 pm

    The stacktrace suggests that u.getGroups() returned a Collections#unmodifiableSet(). When JSF needs to process the submitted values from the checkbox group, it is trying to instantiate a collection of the same type, but that type is uninstantiable.

    Wrapping it in a modifiable set such as HashSet should fix the particular problem:

    user.setGroups(new HashSet<Group>(groups));
    

    Unrelated to the concrete problem, there are more other potential problems in the code posted so far, but they are not related to particular exception which you faced. So, fixing the current problem may cause a different exception, but this would not be related to the current one at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm trying to select an H1 element which is the second-child in its group
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.