App Component not accessible but the jar files are loading

I have a v7.0.10 application with an app component. The app component runs fine stand-alone. I have deployed it locally (and I can see it in my local maven archive).

  1. When I go to Cuba Properties in Intellij, I can’t add the dependency. I get invalid dependency. Not sure why (I have the local Maven repository checkbox checked). I am running Cuba plugin version 11.3-183.

  2. I go into build.gradle and add it manually:

dependencies {
    appComponent("com.haulmont.cuba:cuba-global:$cubaVersion")
    appComponent("com.haulmont.reports:reports-global:$cubaVersion")
    appComponent("com.haulmont.bpm:bpm-global:$cubaVersion")
    appComponent("com.paslists.filemaint:filemaint-global:0.1-SNAPSHOT")
}

When I look in the deployed tomcat webapps area, I can find my filemaint jar files in webapps/rentals/WEB-INF/lib. It looks like the component deployed properly. I can see the menu definitions (grayed out) in the menu structure designer in Composite mode.

But, I can not access any screens from the app component. The menus from the app component don’t appear. To test, since the menus don’t show, I hard-coded the first menu item from my app component in my main app and tried to access it. I get screen not found:

2019-09-05 14:04:53.849 ERROR [http-nio-8080-exec-5/rentals/admin] com.haulmont.cuba.web.log.AppLog - Exception in com.haulmont.cuba.web.widgets.CubaMenuBar: 
com.haulmont.cuba.gui.NoSuchScreenException: Screen 'filemaint_Customers.browse' is not defined

app.log.zip (4.2 KB)

My app.log file is attached.

What steps have I missed?

I think I found it in this post: Any idea to implement a way for user to quick locate to a specific menu item? - #9 от пользователя zharenov - CUBA.Platform

Since I was added the app component to build.gradle manually, I had to edit the web.xml in core and web modules like this:

    <context-param>
        <param-name>appComponents</param-name>
        <param-value>com.haulmont.cuba com.haulmont.reports com.haulmont.bpm com.paslists.filemaint</param-value>
    </context-param>

That’s the part I was missing (adding my app component to this param-value). Maybe this procedure could be documented in the App Component section of the manual?

Hi

Dependencies section in the Project Properties is not intended to add application components to your project. It allows to manage 3rd-party dependencies (libraries) connected to your project.

There are two options if you want to add locally installed custom application component to your project.

The manual option is described in the Using Public Add-ons section. It include steps you described.

Another option is adding add-on using Studio Marketplace using Gradle coordinates. It is described in the Managing Add-ons section of the Studio documentation. See Installing add-on by coordinates.

Both requires checking local Maven repository checkbox in the Project Properties.

We’ll think about updating the manual, so the automatic option can be easily found as it is preferable for the Studio users.