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?