Sidemenu throws IllegalArgumentException after Fast Deploy

Cuba ver. 6.8.8

Steps to reproduce:

  • add a sidmenu or responsive sidemenu with Studio
  • start Tomcat normally
  • execute deploy Gradle task in IntelliJ IDEA
  • the side menu stops working

The exception thrown is:

IllegalArgumentException: object is not an instance of declaring class

There’s no way to make it work again unless a full restart is done.

Hereunder the files (Studio made) defining the sidemenu:

ext-mainwindow.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="mainMsg://application.caption"
        class="com.idieffe.patientscheduler.web.screens.ExtAppMainWindow"
        xmlns:main="http://schemas.haulmont.com/cuba/mainwindow.xsd">
    <layout responsive="true"
            stylename="c-sidemenu-responsive">
        <hbox id="horizontalWrap"
              expand="workArea"
              height="100%"
              stylename="c-sidemenu-layout"
              width="100%">
            <cssLayout id="sideMenuPanel"
                       height="100%"
                       stylename="c-sidemenu-panel">
                <button id="mobileMenuButton"
                        caption="mainMsg://app.menu"
                        icon="icons/mobile-menu.png"
                        stylename="primary c-sidemenu-toggle"/>
                <hbox id="mobileButtonsBox"
                      stylename="c-sidemenu-mobile-buttons">
                    <main:newWindowButton id="mobileNewWindowButton"
                                          description="mainMsg://newWindowBtnDescription"
                                          icon="app/images/new-window.png"/>
                    <main:logoutButton id="mobileLogoutButton"
                                       description="mainMsg://logoutBtnDescription"
                                       icon="app/images/exit.png"/>
                </hbox>
                <hbox id="appTitleBox"
                      spacing="true"
                      stylename="c-sidemenu-title"
                      width="100%">
                    <label id="appTitleLabel"
                           value="mainMsg://application.logoLabel"/>
                </hbox>
                <cssLayout id="sideMenuWrap"
                           stylename="c-sidemenu-wrap">
                    <embedded id="logoImage"
                              align="MIDDLE_CENTER"
                              stylename="c-app-icon"
                              type="IMAGE"/>
                    <main:userIndicator id="userIndicator"
                                        width="100%"/>
                    <hbox id="mainButtonsBox"
                          stylename="c-main-buttons">
                        <main:newWindowButton id="newWindowButton"
                                              description="mainMsg://newWindowBtnDescription"
                                              icon="app/images/new-window.png"/>
                        <main:logoutButton id="logoutButton"
                                           description="mainMsg://logoutBtnDescription"
                                           icon="app/images/exit.png"/>
                    </hbox>
                    <main:timeZoneIndicator id="timeZoneIndicator"
                                            width="100%"/>
                    <main:sideMenu id="sideMenu"
                                   sidePanel="sideMenuPanel"
                                   sidePanelToggleButton="mobileMenuButton"/>
                    <main:ftsField id="ftsField"
                                   width="100%"/>
                </cssLayout>
            </cssLayout>
            <main:workArea id="workArea"
                           height="100%">
                <main:initialLayout margin="true"
                                    spacing="true">
                    <label id="welcomeLabel"
                           align="MIDDLE_CENTER"
                           stylename="c-welcome-text"
                           value="mainMsg://application.welcomeText"
                           width="100%"/>
                </main:initialLayout>
            </main:workArea>
        </hbox>
    </layout>
</window>

ExtAppMainWindow.java

package com.idieffe.patientscheduler.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);
    }
}

Hi,

Could you please attach app.log. file with the exception?

Why do you deploy the entire app again in the started Tomcat?

Hello @artamonov,
I’m trying to deploy just the web module without restarting Tomcat.
I couldn’t find the traceback in app.log, but here it is…
traceback.txt (3.7 KB)

Anytime I click on a sidemenu item it raises the same exception

I’m trying to deploy just the web module without restarting Tomcat.

Is it not supported by Tomcat in case of exploded deployment, it works only if you deploy with WAR files.

If you want to develop UI faster I’d recommend that you use deployConf Gradle task instead.

1 Like

@artamonov Thank you very much, I didn’t try deployConf because it doesn’t show in the available deploy tasks when I run gradle tasks.