Application is throwing exception after Dashboard migration

I have upgraded by application to 7.1 which was running until I have upgraded the Dashboard add-on to the latest version. Here is the error i am o=getting:

    INFO: No Spring WebApplicationInitializer types detected on classpath
00:51:08.689 ERROR c.h.c.c.s.AbstractWebAppContextLoader   - Error initializing application
java.lang.RuntimeException: App component descriptor was not found in 'com/haulmont/addon/dashboardchart/app-component.xml'
	at com.haulmont.cuba.core.sys.AppComponents.getDescriptorDoc(AppComponents.java:181) ~[cuba-global-7.1.0.jar:7.1.0]
	at com.haulmont.cuba.core.sys.AppComponents.load(AppComponents.java:112) ~[cuba-global-7.1.0.jar:7.1.0]
	at com.haulmont.cuba.core.sys.AppComponents.<init>(AppComponents.java:67) ~[cuba-global-7.1.0.jar:7.1.0]
	at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.initAppComponents(AbstractWebAppContextLoader.java:131) ~[cuba-global-7.1.0.jar:7.1.0]
	at com.haulmont.cuba.core.sys.AbstractWebAppContextLoader.contextInitialized(AbstractWebAppContextLoader.java:73) ~[cuba-global-7.1.0.jar:7.1.0]
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4663) [catalina.jar:9.0.14]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5131) [catalina.jar:9.0.14]

Hi,

Please provide us your build.gradle and web.xml files.

Regards,
Evgeny

Here is the build.gradle file

buildscript {
    ext.cubaVersion = '7.1.0'
    repositories {
        mavenLocal()
        maven {
            url 'https://repo.cuba-platform.com/content/groups/work'

            credentials {
                username(rootProject.hasProperty('repoUser') ? rootProject['repoUser'] : 'cuba')
                password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
            }
        }
        maven {
            url 'https://cuba-platform.bintray.com/premium'
            credentials {
                //username(rootProject.hasProperty('premiumRepoUser') ? rootProject['premiumRepoUser'] : System.getenv('CUBA_PREMIUM_USER'))
                //password(rootProject.hasProperty('premiumRepoPass') ? rootProject['premiumRepoPass'] : System.getenv('CUBA_PREMIUM_PASSWORD'))
                username(rootProject.hasProperty('premiumRepoUser') ? rootProject['premiumRepoUser'] : System.getenv('xxxx'))
                password(rootProject.hasProperty('premiumRepoPass') ? rootProject['premiumRepoPass'] : System.getenv('xxxx'))

            }
        }

        maven {
            url 'https://repo.cuba-platform.com/content/groups/work'
            credentials {
                username(rootProject.hasProperty('repoUser') ? rootProject['repoUser'] : 'cuba')
                password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
            }
        }
        maven {
            url 'https://repo.cuba-platform.com/content/groups/work'
            credentials {
                username(rootProject.hasProperty('repoUser') ? rootProject['repoUser'] : 'cuba')
                password(rootProject.hasProperty('repoPass') ? rootProject['repoPass'] : 'cuba123')
            }
        }
        
        
    }
    dependencies {
        classpath "com.haulmont.gradle:cuba-plugin:$cubaVersion"
    }
}

def modulePrefix = 'inteaccERP'

def globalModule = project(":${modulePrefix}-global")
def coreModule = project(":${modulePrefix}-core")
def guiModule = project(":${modulePrefix}-gui")
def webModule = project(":${modulePrefix}-web")
def webToolkitModule = project(":${modulePrefix}-web-toolkit")

def servletApi = 'javax.servlet:javax.servlet-api:3.1.0'


apply(plugin: 'cuba')

cuba {
    artifact {
        group = 'com.inteacc.erp'
        version = "2019.06.17"
        isSnapshot = true
    }
    tomcat {
        dir = "$project.rootDir/build/tomcat"
    }
    ide {
        vcs = 'svn'
    }
}

dependencies {
    appComponent("com.inteacc.common:inteaccCommonUtil-global:0.4-SNAPSHOT")
    appComponent("com.haulmont.addon.search:search-global:1.4.0")
    appComponent('de.diedavids.cuba.dataimport:dataimport-global:0.9.2')
    appComponent('com.haulmont.addon.imap:imap-global:1.3.1')
    appComponent("com.haulmont.cuba:cuba-global:$cubaVersion")
    appComponent("com.haulmont.charts:charts-global:$cubaVersion")
    appComponent("com.haulmont.reports:reports-global:$cubaVersion")
    appComponent("com.haulmont.bpm:bpm-global:$cubaVersion")
    appComponent("com.haulmont.fts:fts-global:$cubaVersion")
    appComponent('com.haulmont.addon.restapi:restapi-global:7.1.0')
    appComponent('com.haulmont.addon.dashboard:dashboard-global:3.1.1')
    appComponent('com.haulmont.addon.emailtemplates:yet-global:1.2.0')
    appComponent('com.haulmont.addon.sdbmt:sdbmt-global:1.4.0')


}

def postgres = 'org.postgresql:postgresql:42.2.4'

configure([globalModule, coreModule, guiModule, webModule, webToolkitModule]) {
    apply(plugin: 'java')
    apply(plugin: 'maven')
    apply(plugin: 'cuba')

    dependencies {
        testCompile('junit:junit:4.12')
    }

    task sourceJar(type: Jar) {
        from file('src')
        classifier = 'sources'
    }

    artifacts {
        archives sourceJar
    }
}

configure(globalModule) {
    dependencies {
        if (!JavaVersion.current().isJava8()) {
            runtime('javax.xml.bind:jaxb-api:2.3.1')
            runtime('org.glassfish.jaxb:jaxb-runtime:2.3.1')
        }
    }
    entitiesEnhancing {
        main { enabled = true }
    }

    
    jar {
        manifest {
            attributes('App-Component-Id': cuba.artifact.group)
            attributes('App-Component-Version': cuba.artifact.version + (cuba.artifact.isSnapshot ? '-SNAPSHOT' : ''))
        }
    }
    
}

configure(coreModule) {

    configurations {
        jdbc
        dbscripts
    }

    dependencies {
        compile(globalModule)
        compileOnly(servletApi)
        jdbc(postgres)
        testRuntime(postgres)
        compile('org.apache.commons:commons-csv:1.5')
        compile('com.github.lbordowitz.openforecast:openforecast:0.5.0')
        compile('com.workday:timeseries-forecast:1.1.1')
        compile('jaxen:jaxen:1.1.6')

    }

    task cleanConf(description: 'Cleans up conf directory') {
        doLast {
            def dir = new File(cuba.tomcat.dir, "/conf/${modulePrefix}-core")
            if (dir.isDirectory()) {
                ant.delete(includeemptydirs: true) {
                    fileset(dir: dir, includes: '**/*', excludes: 'local.app.properties')
                }
            }
        }
    }

    task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
        appName = "${modulePrefix}-core"
        appJars(modulePrefix + '-global', modulePrefix + '-core')
    }

    task createDb(dependsOn: assembleDbScripts, description: 'Creates local database', type: CubaDbCreation) {
        dbms = 'postgres'
        host = 'localhost'
        dbName = 'inteaccerp'
        dbUser = 'postgres'
        dbPassword = 'xx'
    }

    task updateDb(dependsOn: assembleDbScripts, description: 'Updates local database', type: CubaDbUpdate) {
        dbms = 'postgres'
        host = 'localhost'
        dbName = 'inteaccerp'
        dbUser = 'postgres'
        dbPassword = 'xx'
    }
}

configure(guiModule) {
    dependencies {
        compile(globalModule)

    }

    task deployConf(type: Copy) {
        from file('src')
        include "com/inteacc/erp/**"
        into "$cuba.tomcat.dir/conf/${modulePrefix}"
    }
}

configure(webModule) {
    configurations {
        webcontent
    }

    dependencies {
        compileOnly(servletApi)
        compile(guiModule)
        compile('com.flowingcode.vaadin.addons:orgchart-addon:1.0.0')
        compile('org.tltv.gantt:gantt-addon:1.0.4') {
            exclude(group: 'com.vaadin', module: 'vaadin-client')
        }
        
    }
    
    jar {
        with copySpec {
            from sourceSets.main.allJava
            include "com/inteacc/erp/web/toolkit/ui/client/**"
        }
    }
    
    task webArchive(type: Zip) {
        from file("$buildDir/web")
        from file('web')
        classifier = 'web'
    }

    artifacts {
        archives webArchive
    }

    task deployConf(type: Copy) {
        from file('src')
        include "com/inteacc/erp/**"
        into "$cuba.tomcat.dir/conf/${modulePrefix}"
    }

    task clearMessagesCache(type: CubaClearMessagesCache) {
        appName = "${modulePrefix}"
    }
    deployConf.dependsOn clearMessagesCache

    task cleanConf(description: 'Cleans up conf directory') {
        doLast {
            def dir = new File(cuba.tomcat.dir, "/conf/${modulePrefix}")
            if (dir.isDirectory()) {
                ant.delete(includeemptydirs: true) {
                    fileset(dir: dir, includes: '**/*', excludes: 'local.app.properties')
                }
            }
        }
    }

    task deploy(dependsOn: [assemble, cleanConf], type: CubaDeployment) {
        appName = "${modulePrefix}"
        appJars(modulePrefix + '-global', modulePrefix + '-gui', modulePrefix + '-web')
    }
    task buildScssThemes(type: CubaWebScssThemeCreation)
    task deployThemes(type: CubaDeployThemeTask, dependsOn: buildScssThemes)
    assemble.dependsOn buildScssThemes

    task themesJar(type: Jar) {
        from file('themes')
        classifier = 'themes'
    }

    artifacts {
        archives themesJar
    }
}

configure(webToolkitModule) {
    dependencies {
        compile(webModule)
    }

    jar {
        from sourceSets.main.allJava
    }

    task buildWidgetSet(type: CubaWidgetSetBuilding) {
        widgetSetClass = 'com.inteacc.erp.web.toolkit.ui.AppWidgetSet'
    }

    task debugWidgetSet(type: CubaWidgetSetDebug) {
        widgetSetClass = 'com.inteacc.erp.web.toolkit.ui.AppWidgetSet'
    }

    task webArchive(dependsOn: buildWidgetSet, type: Jar) {
        from file("$buildDir/web")
        classifier = 'client'
    }

    artifacts {
        archives webArchive
    }

    task deploy(dependsOn: webArchive, type: Copy) {
        from webArchive
        into "$cuba.tomcat.dir/webapps/${modulePrefix}/WEB-INF/lib"
    }
}


task undeploy(type: Delete, dependsOn: ":${modulePrefix}-web:cleanConf") {
    delete("$cuba.tomcat.dir/shared")
    delete("$cuba.tomcat.dir/webapps/${modulePrefix}-core")
    delete("$cuba.tomcat.dir/webapps/${modulePrefix}")
}

task restart(dependsOn: ['stop', ":${modulePrefix}-core:deploy", ":${modulePrefix}-web:deploy", ":${modulePrefix}-web-toolkit:deploy"], description: 'Redeploys applications and restarts local Tomcat') {
    doLast {
        ant.waitfor(maxwait: 6, maxwaitunit: 'second', checkevery: 2, checkeveryunit: 'second') {
            not {
                socket(server: 'localhost', port: '8787')
            }
        }
        start.execute()
    }
}


apply from: 'extra.gradle'

task jelasticBuildWar(type: CubaWarBuilding) {
    includeJdbcDriver = true
    appHome = '..'
    webXmlPath = 'modules/web/web/WEB-INF/single-war-web.xml'
    appProperties = ['cuba.automaticDatabaseUpdate' : true]
    includeContextXml = true
    coreContextXmlPath = 'modules/core/web/META-INF/jelastic-context.xml'
}

task jelasticDeployWar(type: CubaJelasticDeploy, dependsOn: jelasticBuildWar) {
    email = rootProject.hasProperty('jelasticEmail') ? rootProject['jelasticEmail'] : ''
    password = rootProject.hasProperty('jelasticPassword') ? rootProject['jelasticPassword'] : ''
    hostUrl = 'app.mircloud.host'
    environment = 'sitinteacc'
}

task buildWar(type: CubaWarBuilding) {
    coreContextXmlPath = 'modules/core/web/META-INF/war-context.xml'
    appProperties = ['cuba.automaticDatabaseUpdate': true,
                     'cuba.logDir'                 : '${catalina.base}/logs']
    includeContextXml = true
    includeJdbcDriver = true
    appHome = '..'
    webXmlPath = 'modules/web/web/WEB-INF/single-war-web.xml'
}

Here is the web.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">
    <!-- Application properties config files -->
    <context-param>
        <param-name>appPropertiesConfig</param-name>
        <param-value>classpath:com/inteacc/erp/web-app.properties
            /WEB-INF/local.app.properties
            "file:${catalina.home}/conf/inteaccERP/local.app.properties"</param-value>
    </context-param>
    <!--Application components-->
    <context-param>
        <param-name>appComponents</param-name>
        <param-value>com.haulmont.addon.imap com.inteacc.common com.haulmont.addon.search de.diedavids.cuba.dataimport
            com.haulmont.addon.dashboardchart com.haulmont.cuba com.haulmont.charts com.haulmont.reports
            com.haulmont.bpm com.haulmont.fts com.haulmont.addon.restapi com.haulmont.addon.dashboard
            com.haulmont.addon.emailtemplates com.haulmont.addon.sdbmt</param-value>
    </context-param>
    <listener>
        <listener-class>com.vaadin.server.communication.JSR356WebsocketInitializer</listener-class>
    </listener>
    <listener>
        <listener-class>com.haulmont.cuba.web.sys.WebAppContextLoader</listener-class>
    </listener>
    <servlet>
        <servlet-name>app_servlet</servlet-name>
        <servlet-class>com.haulmont.cuba.web.sys.CubaApplicationServlet</servlet-class>
        <async-supported>true</async-supported>
    </servlet>

    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>com.haulmont.cuba.web.sys.CubaDispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/dispatch/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>app_servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <filter>
        <filter-name>cuba_filter</filter-name>
        <filter-class>com.haulmont.cuba.web.sys.CubaHttpFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>cuba_filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

Hi,

Please add a line
appComponent(“com.haulmont.addon.dashboardchart:dashboardchart-global:1.2.0”)
in dependencies in the build.gradle. The addon needs Dashboardchart to work correctly.

Regards,
Darya

Hi
Thanks. It’s strange that I had that dashboard chart dependency added but now it looks automatically removed been somehow, wondering if is happening when upgraded.