Jmix 1.2 with addons providing screens

I have an issue after migrating applications from Jmix 1.1.4 to 1.2.1.

After starting up, there is no UiControllersConfiguration for the application which produces an exception when calling a screen: io.jmix.ui.NoSuchScreenException: Screen 'appX_MainScreen' is not defined.

This does only affect applications which are using (custom) Add-Ons providing screens on their own.

I did not change anything except adding the newly required Jmix module identifier to the AddOn and migrate the Jmix BOM versions on both, the AddOn and the application. With Jmix 1.1.4 the screens of the application have been loaded. With Jmix 1.2.1 they are not.

I figured out, adding

    @Bean("appX_AppUiControllers")
    public UiControllersConfiguration screens(final ApplicationContext someAppContext,
                    final AnnotationScanMetadataReaderFactory aMetadataReaderFactory)
    {
        final UiControllersConfiguration uiControllers = new UiControllersConfiguration(someAppContext,
                        aMetadataReaderFactory);
        uiControllers.setBasePackages(Collections.singletonList("com.company.appX"));

        return uiControllers;
    }

to the application main class, solves the issue. But neither this block is generated to application main classes nor this requirement is mentioned in the migration documentation - or did I miss it?

Is this the right way to handle that?

Hi!

Unfortunately we cannot reproduce the described issue. It would be helpful if you send us small demo project that demonstrate the problem with a reproducing scenario.

Regards,
Nadezhda.

Hi, @n.shatalova

We could find the problem. The auto-configuration class of the starter-module of the screen providing AddOn had a @JmixModule-annotation with a module identifier for it.

That caused the application’s Jmix module not being the last one of the Jmix module list used in io.jmix.autoconfigure.ui.UiAutoConfiguration (line 46).

I removed the @JmixModule-annotation from the auto configuration class of the starter and it works as expected (again).