NoSuchViewException - unreferenced entry showing in the main menu

Hello,
Jmix 2.2.3 , IntelliJ Build #IU-241.14494.240

I have a problem with a “ghost” view.
I have deleted the view by removing its controller and xml descriptor, and removing the reference from the MainMenu, but when I run the app and try to login, I get the error message.
I have performed, gradle clean, vaadin clean, invalidated caches, restarted Intellij, restarted the PC, but it’s still somewhere being referenced, but I can’t find where.
image

ATM the only solution is to create empty view with the same name and then it magically appears in the Main Menu - but it can not be found in the menu.xml (Single mode)

        <item view="buscal_BusinessCalendarModel.list" title="Business Calendar" icon="CALENDAR"/>
        <item view="abc_CustomerMailingList.list"
              title="Mailing Lists" icon="vaadin:envelopes-o"/>
    </menu>
    <menu id="referencedata" description="msg://com.abc.application/menu_config.Reference Data.description"

How can I remove it for real?
It’s in the main menu … can’t show that to the customers :slight_smile:

I checked the forum, and more people are having the same issue

I also have noticed that in the project /build/resources/main/com/company/app/view there are empty directories, from the views I deleted, they are not deleted when the view is deleted, and when I delete them manually they reappear when I start the app. Why?

io.jmix.flowui.exception.NoSuchViewException: View 'com_TempCustomerMailingList.list' is not defined
	at io.jmix.flowui.view.ViewRegistry.getViewInfo(ViewRegistry.java:330) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.sys.UiAccessChecker.getControllerClass(UiAccessChecker.java:99) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.sys.UiAccessChecker.isMenuPermitted(UiAccessChecker.java:59) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.menu.ListMenuBuilder.isPermitted(ListMenuBuilder.java:253) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.menu.ListMenuBuilder.createMenuItem(ListMenuBuilder.java:178) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.menu.ListMenuBuilder.createListMenu(ListMenuBuilder.java:117) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.menu.ListMenuBuilder.createListMenu(ListMenuBuilder.java:100) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.menu.provider.MenuConfigListMenuItemProvider.lambda$convertToMenuItems$0(MenuConfigListMenuItemProvider.java:51) ~[jmix-flowui-2.2.3.jar:na]
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:273) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
	at io.jmix.flowui.menu.provider.MenuConfigListMenuItemProvider.convertToMenuItems(MenuConfigListMenuItemProvider.java:52) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.menu.provider.MenuConfigMenuItemProvider.load(MenuConfigMenuItemProvider.java:50) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.xml.layout.loader.component.ListMenuLoader.loadMenuConfig(ListMenuLoader.java:49) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.xml.layout.loader.component.ListMenuLoader.loadComponent(ListMenuLoader.java:32) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.xml.layout.loader.container.AbstractContainerLoader.loadSubComponents(AbstractContainerLoader.java:37) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.xml.layout.loader.html.AbstractHtmlContainerLoader.loadComponent(AbstractHtmlContainerLoader.java:35) ~[jmix-flowui-2.2.3.jar:na]
	at io.jmix.flowui.xml.layout.loader.html.NavLoader.loadComponent(NavLoader.java:30) ~[jmix-flowui-2.2.3.jar:na]

Kind regards,
Mladen

Hi,

Can you please share an archive with your project, so I can debug it manually?

Regards,
Alex

Hello,
I’m afraid I can not easily do that. Will try to reproduce the problem on the test project, or try to reduce the existing one …
But do you know where should I look, for example where can vaadin have a cache or some artifacts that are not affected by gradle clean or vaadin clean?

Kind regards,
Mladen

OK, solved.

There was an empty directory,
\src\main\resources\com\abc\app\view\management\tempcustomermailinglist
or maybe
\src\main\java\com\abc\app\view\management\tempcustomermailinglist
when I deleted it, and executed clean after that, it worked.

I had a theory that maybe some file in the cache was locked as it can happen, but it wasn’t.
I remember that I may have deleted that view while the app was running locally, and hot deploy was performed…
But it’s weird that whatever held that reference, released/was rebuilt only after the empty folder was deleted, I kind of expected that menu.xml is a single source of truth for building the menu.
It almost looks like (speculating) whatever is making the list of all available views during the build, is looking for directories as a sign of view existing, but not checking if the directory is empty, and then it takes that directory name and adds jmix naming convention to it, so example tempcustomermailinglist becomes com_TempCustomerMailingList.list and ofc it can not find .java or .xml resource.

To answer my question about reappearing directories, that’s normal, build directory structure will follow the src.
I tried adding some directories to the src tree to see what happens, but it works.

Kind regards,
Mladen

So,
I belive I have found it @a.novitskii

  1. I change the view, run the app with IntelliJ
  2. view does not change whatever I do
  3. when I change it while running the app, there are no usual hot deploy messages in the output
  4. In the .jmix directory,
    I have then for example
    .jmix\conf\com\company\app1\view\management\customer\customer-detail-view.xml
    and it is unchanged one, and it never changes so thats why my changes to the view are not working
  5. if I delete it, then the change is visible and all works, until next run when it again appears under .jimx/ directory

Is this a hot deploy problem? Do you know how can I fix this, or maybe just disable the hot deploy, It is hard to manually delete this all the time

Kind regards,
Mladen

Normally your Run/Debug configuration in the IDE should contain the “Clean Hot Deploy Conf Directory” task which does the trick:

image

Please check this and add the task if it doesn’t exist (it’s available in the “Add new task” dropdown).

Its there
image

image

It’s the same problem on IntelliJ 2024.1 and 2024.1.4 , using Jmix 2.2.3. , Java 17
If I remember correctly, problems started when I moved from 2.2.1 or earlier.

I also need to close the IDE to be able to delete the files in question from .jmix\conf\ because they are locked, so maybe that’s why the task “Clean Hot Deploy Conf Directory” is not working

Kind regards,
Mladen