Single mode menu problem at login [MenuItem already exists]

Hi to all,
I have a strange problem with the menu after deploying the application. When the app is running in dev all is ok, however in production login attempt fails with error:

WARN c.h.c.w.a.loginwindow.AppLoginWindow - Unable to login
java.lang.IllegalArgumentException: MenuItem with id “reports” already exists

If I remove the relative “report”, “administration” and “help” menu’ items located inside web-menu.xml that is inside webapps/app/WEB-INF/lib/app-web-0.1-SNAPSHOT.jar all is working fine, but I can’t rearrange menus as I want.

The issue started after selecting “single mode” in the studio menu editor. Is there an option that is stored somewhere that tells the library how to build the menu (single mode or composite mode)? Because if there is I can’t find it.

Best
Riccardo

Hi,
“Single mode” switches the cuba.menuConfig property in the web-app.properties file.

If the menu is in composite mode:

cuba.menuConfig = +com/company/playground/web-menu.xml

When in single mode:

cuba.menuConfig = com/company/playground/web-menu.xml

Regarding your problem, have you tried to clean the project before building production release (CUBA -> Build tasks -> Clean) ? Maybe it will help.