View 'system_LoginView' is not defined although LoginView exists and is annotated correctly

Description:

I’m currently facing an issue with a custom login view in Jmix (FlowUI).

At application startup, the following error occurs:

io.jmix.flowui.exception.NoSuchViewException: View 'system_LoginView' is not defined

This happens during security configuration (inside FlowuiVaadinWebSecurity).


What I have verified so far:

  • The LoginView class exists
  • It is correctly annotated:
@Route("login")
@ViewController(id = "system_LoginView")
@ViewDescriptor("login-view.xml")
public class LoginView extends StandardView {
}
  • The XML descriptor (login-view.xml) exists and is valid
  • The package structure is consistent
  • The view ID matches exactly (system_LoginView)
  • The application compiles without errors

Debugging results:

I inspected the ViewRegistry during startup and printed all registered views.

:point_right: Result:
system_LoginView is not present in the registry at all.

So the issue seems to be that the view is not being registered, rather than a wrong reference.


Additional observations:

  • No explicit error is logged regarding the XML descriptor
  • The application fails early due to the missing login view
  • Other views are correctly registered and listed

My assumption:

It seems that Jmix silently ignores the view if the XML descriptor cannot be resolved (e.g. wrong location or path mismatch), but without logging an explicit error.


Question:

  • Is there a way to enable logging for failed view registrations?
  • Are there other conditions under which a view is silently ignored?

Goal:

Understand why a correctly annotated LoginView is not registered in ViewRegistry and how to reliably debug such issues.


Thanks in advance!

System.zip

Hello Jan!

Thank you for the demo project! I’ve found that the ReminderJob class contains the @JmixModule annotation.

Before starting the application, Jmix scans all bean classes with this annotation to configure dependencies between modules. This mechanism helps override view classes and actions from various add-ons.

Normally, the application configuration class is the last Jmix module (without explicitly defining this annotation). However, since ReminderJob has the @JmixModule annotation, it is considered the last module, and Jmix uses its base package (de.bytestore.system.jobs.ecommerce) to locate all actions, views, etc.

The @JmixModule annotation is typically used for add-ons. For more details, refer to the documentation: Creating Add-ons :: Jmix Documentation

Try removing this annotation from ReminderJob. Also, add @Route(value = "login") to your LoginView, otherwise the application won’t start.

Firstly, you should make sure, that your view is placed under base package that is scanned by ViewControllersConfiguration. Then, in ViewRegistry you can check your configuration. If you don’t see the configuration with your base package, you can try to debug JmixModulesProcessor.

Thanks for your quick and helpful reply—that’s exactly what happened. I have no idea where I got that idea about the modules from… :stuck_out_tongue: