Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: ConcurrentModificationException + RefreshableValueHolder

  1. #1
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default ConcurrentModificationException + RefreshableValueHolder

    I have a Wizard with a one WizardPage and a Form. It use to work fine but i have updated to new spring lib and I am starting to get some really strange errors.

    I have a RefreshableValueHolder that updates ComboBox items on show(). As the model is changing so I need to update combobox model.

    Following is the exception that Iam getting on wizard.execute().

    Code:
    03:39:51,448 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Setting newly selected item on value holder to Accounting
    
    03:39:51,448 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Notifying combo box view selected value changed; new value is 'Accounting'
    
    03:39:51,498 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Firing contents change event; selected item may have changed
    
    03:39:51,498 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Returning selected item Accounting
    
    03:39:51,498 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Returning selected item Accounting
    
    03:39:51,498 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Returning selected item Accounting
    
    03:39:51,498 DEBUG [org.springframework.richclient.list.DynamicComboBoxListModel] Fired contents change event!
    
    03:39:51,508 ERROR [org.springframework.richclient.application.config.ApplicationAdvisor] 
    
    java.util.ConcurrentModificationException
    
    	at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:354)
    
    	at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:365)
    
    	at org.springframework.binding.value.support.AbstractValueModel.fireValueChanged(AbstractValueModel.java:64)
    
    	at org.springframework.binding.value.support.BufferedValueModel.onWrappedValueChanged(BufferedValueModel.java:82)
    
    	at org.springframework.binding.value.support.BufferedValueModel$WrappedModelValueChangeHandler.valueChanged(BufferedValueModel.java:70)
    
    	at org.springframework.binding.value.support.AbstractValueModel.fireValueChanged(AbstractValueModel.java:64)
    
    	at org.springframework.binding.value.support.PropertyAdapter$DomainObjectChangeHandler.valueChanged(PropertyAdapter.java:70)
    
    	at org.springframework.binding.value.support.AbstractValueModel.fireValueChanged(AbstractValueModel.java:64)
    
    	at org.springframework.binding.value.support.ValueHolder.setValue(ValueHolder.java:52)
    
    	at org.springframework.binding.form.support.AbstractFormModel.setFormObject(AbstractFormModel.java:69)
    
    	at org.springframework.richclient.forms.CompoundForm.setFormObject(CompoundForm.java:55)
    
    	at com.vaau.rbacx.client.ui.view.businessunitsview.NewNewBusinessUnitWizard.execute(NewNewBusinessUnitWizard.java:53)
    
    	at com.vaau.rbacx.client.ui.view.businessunitsview.NewNewBusinessUnitWizard.execute(NewNewBusinessUnitWizard.java:61)
    
    	at org.springframework.richclient.command.TargetableActionCommand.doExecuteCommand(TargetableActionCommand.java:97)
    
    	at org.springframework.richclient.command.ActionCommand.execute(ActionCommand.java:188)
    
    	at org.springframework.richclient.command.ActionCommand$1.actionPerformed(ActionCommand.java:123)
    
    	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
    
    	at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
    
    	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
    
    	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
    
    	at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
    
    	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
    
    	at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
    
    	at java.awt.Component.processMouseEvent(Component.java:5134)
    
    	at java.awt.Component.processEvent(Component.java:4931)
    
    	at java.awt.Container.processEvent(Container.java:1566)
    
    	at java.awt.Component.dispatchEventImpl(Component.java:3639)
    
    	at java.awt.Container.dispatchEventImpl(Container.java:1623)
    
    	at java.awt.Component.dispatchEvent(Component.java:3480)
    
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
    
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    
    	at java.awt.Container.dispatchEventImpl(Container.java:1609)
    
    	at java.awt.Window.dispatchEventImpl(Window.java:1590)
    
    	at java.awt.Component.dispatchEvent(Component.java:3480)
    
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    
    	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Here is my wizard.execute()

    Code:
        public void execute() {
            if (wizardDialog == null) {
                wizardDialog = new WizardDialog(this);
                wizardDialog.setResetMessagePaneOnDisplay(true);
                wizardForm = new CompoundForm();
            }
            wizardForm.setFormObject(new BusinessUnit());
            wizardDialog.showDialog();
        }
    Here is my form.createControl()

    Code:
            protected JComponent createFormControl() {
                FormLayout layout = new FormLayout("left:pref, 5dlu, pref:grow");
                JGoodiesBeanFormBuilder formBuilder = new JGoodiesBeanFormBuilder(getFormModel(), layout);
                businessUnitNameField =(JTextField) formBuilder.add("businessUnitName")[1];
                refreshableValueHolder = new RefreshableValueHolder(new Block() {
                    public Object call(Object object) {
                        return getFlattenedBusinessUnits();
                    }
                }, true);
    
                parentBusinessUnitComboBox =
                    getFormModel().createBoundComboBox("parentBusinessUnit", refreshableValueHolder, "businessUnitName");
    
                formBuilder.getWrappedFormBuilder().add(PARENT_BUSINESS_UNIT_LABEL_ID, parentBusinessUnitComboBox);
                return formBuilder.getForm();
            }
    I am going nuts over this, please any help will be really appreciated.

    Amad

  2. #2
    Join Date
    Sep 2004
    Location
    Ghent, Belgium
    Posts
    224

    Default

    modify your getFlattenedBusinessUnits method so it returns a copy of your internal collection. (if it's a list do the following: return new ArrayList(internalList);

  3. #3
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    modify your getFlattenedBusinessUnits method so it returns a copy of your internal collection. (if it's a list do the following: return new ArrayList(internalList);
    I have looked at my code and thats what I do already. Any ideas
    Amad

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Amad,

    Are you spawning any other threads at all? Did you just synchronize today? Perhaps send me the code off-line I can take a look and add some tests.
    Keith Donald
    Core Spring Development Team

  5. #5
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    Are you spawning any other threads at all?
    No
    Did you just synchronize today?
    I had synchronized a week ago.

  6. #6
    Join Date
    Aug 2004
    Posts
    203

    Default

    Amad,
    try with TableFormBuilder except Jgoodies

    regards

  7. #7
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    snpe

    try with TableFormBuilder except Jgoodies
    Is there a TableBeanFormBuilder?

    Amad[/quote]

  8. #8
    Join Date
    Aug 2004
    Posts
    203

    Default

    There is TableFormBuilder

    see user documentation form support (it is on wiki)

    It is new, JGoodiesBeanFormBuilder is deprecated

    for table support exists BeanTableModel

    regards

  9. #9
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    It's TableFormBuilder. See the latest petclinic snapshot for example usage.

    Hey Amad, also try synchronzing with the latest snapshot to see if its still a problem.

    Keith
    Keith Donald
    Core Spring Development Team

  10. #10
    Join Date
    Aug 2004
    Location
    Northridge, CA
    Posts
    151

    Default

    I have got the latest build and now using TableFormBuilder. Problem still persists, I have commented out some code and here is the line the causing the problem,

    Code:
    getFormModel().createBoundComboBox(selectionFormProperty, selectableItemsHolder, renderedItemProperty);
    Because if I take it out, exception goes away! Any clues :idea:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •