java.util.ConcurrentModificationException on login of any user after adding folderspane in main win #1689

Hello!

My goal is to use folderspane with some counters on application folders. All works perfectly except of one thing: inserting folderspane by inserting<main:foldersPane id=“foldersPanel” height=“30%”/> in xml for main-window involve “Unable to login” error for any user including admin. If I’ll comment folderspane line in xml everything will be fine and there will be no errors.
So I’m logging in using any user credentials, got an error “Unable to login”. I can click on this error message and get access to main page and everything that I want, except things that are linked with current userSession (for example, some views are based on session$userLogin and all counters on app folders that are based on userLogin, userId are not working). I thought that error was caused by using userLogin in counters on app folders and cleared them out, but it didn’t help.
I’ve checked catalina log and found that user is logged in and then logged out for some reason. Here is the part of catalina log:


17:39:11.802 INFO  c.h.cuba.core.sys.MetadataImpl - Initializing metadata
17:39:12.288 INFO  c.h.cuba.core.sys.MetadataImpl - Metadata initialized in 484ms
17:39:21.921 INFO  c.h.c.security.app.LoginWorkerBean - Logged in: ef32430f-81cd-abbd-0a85-0d5e36f0c476 [admin]
17:39:23.495 INFO  c.h.c.c.sys.ViewRepositoryClientImpl - Initializing views
17:39:23.704 INFO  c.h.c.security.app.LoginWorkerBean - Logged out: ef32430f-81cd-abbd-0a85-0d5e36f0c476 [admin]
17:39:23.713 WARN  c.h.c.w.a.loginwindow.AppLoginWindow - Unable to login
java.util.ConcurrentModificationException: null
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901) ~[na:1.8.0_121]
        at java.util.ArrayList$Itr.next(ArrayList.java:851) ~[na:1.8.0_121]
        at java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042) ~[na:1.8.0_121]
        at com.vaadin.server.AbstractClientConnector$1$1.next(AbstractClientConnector.java:574) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.vaadin.server.AbstractClientConnector$1$1.next(AbstractClientConnector.java:560) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:645) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:713) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:618) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.vaadin.ui.AbstractSingleComponentContainer.setContent(AbstractSingleComponentContainer.java:152) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.vaadin.ui.UI.setContent(UI.java:1328) ~[vaadin-server-7.7.6.cuba.6.jar:7.7.6.cuba.6]
        at com.haulmont.cuba.web.AppUI.setTopLevelWindow(AppUI.java:330) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.WebWindowManager.createTopLevelWindow(WebWindowManager.java:1493) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.App.createTopLevelWindow(App.java:307) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.DefaultApp.connectionStateChanged(DefaultApp.java:108) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.AbstractConnection.fireConnectionListeners(AbstractConnection.java:272) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.AbstractConnection.internalLogin(AbstractConnection.java:176) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.AbstractConnection.update(AbstractConnection.java:123) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.DefaultConnection.login(DefaultConnection.java:60) ~[cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.app.loginwindow.AppLoginWindow.doLogin(AppLoginWindow.java:421) [cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.app.loginwindow.AppLoginWindow.doLogin(AppLoginWindow.java:392) [cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.app.loginwindow.AppLoginWindow.login(AppLoginWindow.java:317) [cuba-web-6.4.2.jar:6.4.2]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
        at com.haulmont.cuba.gui.xml.DeclarativeAction.actionPerform(DeclarativeAction.java:92) [cuba-gui-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.gui.components.WebButton.performAction(WebButton.java:44) [cuba-web-6.4.2.jar:6.4.2]
        at com.haulmont.cuba.web.gui.components.WebButton.lambda$new$61446b05$1(WebButton.java:36) [cuba-web-6.4.2.jar:6.4.2]

Hi,

Do you use an extended main window? Could you share your screen XML?

It seems that there is a problem with default folders pane and the additional one. By default folders pane is already added to mainWindow and can be enabled using the application property: cuba.web.foldersPaneEnabled.

See also: Folders Panel - CUBA Platform. Developer’s Manual

Hi, Yuriy.

Yep, I’m using an extended main window, xml is in attach, line with folderspane is now commented to avoid an error that i’m talking about. In web-app.properties are set:


cuba.web.foldersPaneEnabled=true
cuba.web.foldersPaneVisibleByDefault=true
cuba.web.appFoldersRefreshPeriodSec = 60

ext-mainwindow.xml (4.0K)

I’ve checked your case and everything is fine. You can find my demo project here: GitHub - cuba-labs/cuba-folderspane-sidemenu: How to add FoldersPane to side panel with SideMenu There I’ve created an extended main window using Responsive main menu template and added FoldersPane to XML.

What platform version do you use?

Could your share the code of screen controller? It would be better if you attach a small project that illustrates the issue.

I’ve tried that on 6.4.2 and 6.4.3 with the same result.
It seems for me that screen conroller is the same as in your demo project


package com.company.cubatestproject.web.screens;

import com.haulmont.cuba.gui.components.AbstractMainWindow;
import com.haulmont.cuba.gui.components.Embedded;
import com.haulmont.cuba.gui.components.mainwindow.FtsField;

import javax.inject.Inject;
import java.util.Map;

public class ExtAppMainWindow extends AbstractMainWindow {
    @Inject
    private FtsField ftsField;

    @Inject
    private Embedded logoImage;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        initLayoutAnalyzerContextMenu(logoImage);
        initLogoImage(logoImage);
        initFtsField(ftsField);
    }
}

I’ve tried to clone my project to another machine (without DB and setting that I’ve made from app’s administration folder and there is no error. So, it seems that i’ve made some settings that are stored on my machine but are not exported when i’m uploading my project to repo and then downloading it to another machine. Are there some settings that can involve this error?

Hi,

I’ve reproduced this issue. It occurs when a user opens application and there are application folders and cuba.web.appFoldersRefreshPeriodSec is set. We will fix it in one of the next bugfix versions of release 6.4

Hi, Yuriy.

Thank you very much for the information.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-8946