Screen created in Studio 13 is throwing exception

Hi
I had Entity and a screen that was created in v6.x platform. I recreated the screen in new Studio 13 and platform v 7.2.1 but getting a strange message when i call the screen from menu as follows:

java.lang.IllegalArgumentException: Unable to create screen erp$CustomerProfile.browse with type FRAGMENT
at com.haulmont.cuba.web.sys.WebScreens.createScreen(WebScreens.java:181)
at com.haulmont.cuba.web.sys.WebScreens.create(WebScreens.java:175)
at com.haulmont.cuba.gui.config.MenuItemCommands$ScreenCommand.run(MenuItemCommands.java:316)
at com.haulmont.cuba.web.sys.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:264)
at com.haulmont.cuba.web.sys.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:249)
at com.haulmont.cuba.web.gui.components.mainwindow.WebSideMenu$MenuItemImpl.menuSelected(WebSideMenu.java:573)
at com.haulmont.cuba.web.widgets.CubaSideMenu$1.menuItemTriggered(CubaSideMenu.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:431)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:396)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1578)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

I was in the impression in the beginning that the screen has been defined somehow as fragment but I don’t see it is extended to screen fragment as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
  ~ Copyright (c) 2020 xxxx
  -->

<window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
    xmlns:c="http://schemas.haulmont.com/cuba/screen/jpql_condition.xsd"
    caption="msg://browseCaption"
    focusComponent="customerProfilesTable"
    messagesPack="com.company.web.ar.customerprofile">
<data readOnly="true">
    <collection id="customerProfilesDc"
                class="com.company.entity.ar.CustomerProfile"
                view="customerProfileBrowse-view">
        <loader id="customerProfilesDl">
            <query>
                <![CDATA[select e from erp$CustomerProfile e]]>
            </query>
        </loader>
    </collection>
</data>
<dialogMode height="600"
            width="800"/>
<layout expand="customerProfilesTable"
        spacing="true">
    <filter id="filter"
            applyTo="customerProfilesTable"
            dataLoader="customerProfilesDl">
        <properties include=".*"/>
    </filter>
    <dataGrid id="customerProfilesTable"
              width="100%"
              dataContainer="customerProfilesDc">
        <actions>
            <action id="create" type="create"/>
            <action id="edit" type="edit"/>
            <action id="remove" type="remove"/>
        </actions>
        <columns>
            <column property="customerNumber" id="customerNumber"/>
            <column property="creditControlArea" id="creditControlArea"/>
            <column property="inactiveCustomer" id="inactiveCustomer"/>
            <column property="customerType" id="customerType"/>
            <column property="name" id="name"/>
            <column property="firstName" id="firstName"/>
            <column property="middleName" id="middleName"/>
            <column property="lastName" id="lastName"/>
            <column property="address1" id="address1"/>
            <column property="address2" id="address2"/>
            <column property="city" id="city"/>
            <column property="email" id="email"/>
            <column property="phoneMobile" id="phoneMobile"/>
            <column property="paymentTerm" id="paymentTerm"/>
            <column property="invoiceCurrency" id="invoiceCurrency"/>
            <column property="creditLimit" id="creditLimit"/>
            <column property="country" id="country"/>
            <column property="transportMode" id="transportMode"/>
            <column property="distributionCentre" id="distributionCentre"/>
            <column property="customerGroup" id="customerGroup"/>
            <column property="customerCategory" id="customerCategory"/>
            <column property="currentBalanceAmount" id="currentBalanceAmount"/>
        </columns>
        <buttonsPanel id="buttonsPanel"
                      alwaysVisible="true">
            <button id="createBtn" action="customerProfilesTable.create"/>
            <button id="editBtn" action="customerProfilesTable.edit"/>
            <button id="removeBtn" action="customerProfilesTable.remove"/>
        </buttonsPanel>
    </dataGrid>
    <hbox id="lookupActions" spacing="true" visible="false">
        <button action="lookupSelectAction"/>
        <button action="lookupCancelAction"/>
    </hbox>
</layout>
</window>

here is controller:

package com.company.web.ar.customerprofile;

import com.haulmont.cuba.gui.screen.*;
import com.company.entity.ar.CustomerProfile;

@UiController("erp$CustomerProfile.browse")
@UiDescriptor("customer-profile-browse.xml")
@LookupComponent("customerProfilesTable")
@LoadDataBeforeShow
public class CustomerProfileBrowse extends StandardLookup<CustomerProfile> {
}

Hello,

Could you check web-screens.xml, probably it contains screen with erp$CustomerProfile.browse id. If yes, remove it.

New screens are registered by:

<gui:screens base-packages="com.company.myproject"/>

in the spring configuration and web-screen.xml must not contain new screen ids.

Thank you. I forgot that it is not deleted from the web-screen.xml automatically unlike studio v6.x