Studio 7 Beta 3 cannot open screens

Tried to open a few screens with Beta3, and I get the same error:

Validation error

java.lang.reflect.InvocationTargetException
	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.haulmont.studio.ui.sd.layout.model.prop.FieldGroupFieldsComponentProperty.setValue(FieldGroupFieldsComponentProperty.java:53)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.setComponentProperties(ComponentModelMapper.java:533)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:396)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:457)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:423)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:457)
	at com.haulmont.studio.ui.sd.layout.ComponentModelMapper.updateComponentFromModel(ComponentModelMapper.java:457)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.editModel(ScreenLayoutDesigner.java:205)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.lambda$activate$5(ScreenLayoutDesigner.java:379)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:977)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
	at com.haulmont.studio.ui.sd.layout.ScreenLayoutDesigner.activate(ScreenLayoutDesigner.java:350)
	at com.haulmont.studio.intellij.ui.sd.ScreenDesignerEditor.lambda$activating$0(ScreenDesignerEditor.java:102)
	at com.haulmont.studio.intellij.ui.browser.WebBrowser.lambda$loadEditor$5(WebBrowser.java:183)
	at com.haulmont.studio.ui.app.EditorPanelStorage.register(EditorPanelStorage.java:35)
	at com.haulmont.studio.ui.app.MainUi.createAndRegisterDesigner(MainUi.java:97)
	at com.haulmont.studio.ui.app.MainUi.init(MainUi.java:69)
	at com.vaadin.ui.UI.doInit(UI.java:693)
	at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:216)
	at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:74)
	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1422)
	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:361)
	at com.haulmont.studio.ui.app.StudioApplicationServlet.service(StudioApplicationServlet.java:81)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
	at org.eclipse.jetty.server.Server.handle(Server.java:499)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)
	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: RootWindow not found
	at com.haulmont.studio.ui.sd.layout.ModelHelper.findRootWindowNN(ModelHelper.java:58)
	at com.haulmont.studio.ui.sd.layout.gui.impl.RootWindow.getInstance(RootWindow.java:48)
	at com.haulmont.studio.ui.sd.layout.LocCaptionProvider.getAttributeCaptionById(LocCaptionProvider.java:108)
	at com.haulmont.studio.ui.sd.layout.ModelHelper.attributeNameLocalized(ModelHelper.java:115)
	at com.haulmont.studio.ui.sd.layout.gui.impl.FieldGroup.addFieldsToGrid(FieldGroup.java:214)
	at com.haulmont.studio.ui.sd.layout.gui.impl.FieldGroup.setFields(FieldGroup.java:194)
	... 50 more

Here’s the xml from one of the screens causing the problem:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://editorCaption"
        class="com.example.peer.web.person.PersonEdit"
        datasource="personDs"
        focusComponent="fieldGroup"
        messagesPack="com.example.peer.web.person">
    <dsContext>
        <datasource id="personDs"
                    class="com.example.peer.entity.Person"
                    view="person-with-tags-view">
            <collectionDatasource id="addressesDs"
                                  property="addresses"/>
            <collectionDatasource id="emailAddressesDs"
                                  property="emailAddresses"/>
            <collectionDatasource id="journalRolesDs"
                                  property="journalRoles"/>
            <collectionDatasource id="holidaysDs"
                                  property="holidays"/>
            <collectionDatasource id="personJournalTagsDs"
                                  property="journalTags"/>
        </datasource>
        <collectionDatasource id="countriesDs"
                              allowCommit="false"
                              class="com.example.peer.entity.Country"
                              view="_local">
            <query>
                <![CDATA[select e from peer$Country e]]>
            </query>
        </collectionDatasource>
        <collectionDatasource id="journalTagsDs"
                              class="com.example.peer.entity.JournalTag"
                              view="journalTag-view">
            <query>
                <![CDATA[select journalTag from peer$JournalTag journalTag, peer$JournalRole journalRole, peer$Person person
where
person.id = :ds$personDs
and person.id = journalRole.person.id
and journalRole.journal.id = journalTag.journal.id]]>
            </query>
        </collectionDatasource>
        <collectionDatasource id="allJournalTagDs"
                              class="com.example.peer.entity.JournalTag"
                              view="journalTag-view">
            <query>
                <![CDATA[select e from peer$JournalTag e]]>
            </query>
        </collectionDatasource>
    </dsContext>
    <dialogMode height="600"
                width="800"/>
    <layout expand="windowActions"
            spacing="true">
        <grid responsive="true"
              spacing="true"
              width="90%">
            <columns count="2"/>
            <rows>
                <row>
                    <groupBox id="PersonBox"
                              caption="msg://person.details">
                        <fieldGroup id="fieldGroup"
                                    datasource="personDs"
                                    width="100%">
                            <column width="250px">
                                <field property="title"/>
                                <field property="name"/>
                                <field property="preferredName"/>
                                <field property="qualifications"
                                       rows="3"/>
                                <field optionsDatasource="addressesDs"
                                       property="defaultAddress"/>
                                <field id="defaultEmailAddress"
                                       optionsDatasource="emailAddressesDs"
                                       property="defaultEmailAddress"/>
                                <field property="user"/>
                                <field optionsDatasource="countriesDs"
                                       property="country"/>
                            </column>
                        </fieldGroup>
                    </groupBox>
                    <groupBox id="journalRolesBox"
                              caption="msg://com.example.peer.entity/Person.journalRoles">
                        <table id="journalRolesTable"
                               height="200px"
                               width="100%">
                            <actions>
                                <action id="create"/>
                                <action id="edit"/>
                                <action id="remove"/>
                            </actions>
                            <columns>
                                <column id="journalRoleType"/>
                                <column id="journal"/>
                            </columns>
                            <rows datasource="journalRolesDs"/>
                            <buttonsPanel>
                                <button action="journalRolesTable.create"/>
                                <button action="journalRolesTable.edit"/>
                                <button action="journalRolesTable.remove"/>
                            </buttonsPanel>
                        </table>
                    </groupBox>
                </row>
                <row>
                    <groupBox id="emailAddressesBox"
                              caption="msg://com.example.peer.entity/Person.emailAddresses">
                        <table id="emailAddressesTable"
                               height="200px"
                               width="361px">
                            <actions>
                                <action id="create"/>
                                <action id="edit"/>
                                <action id="remove"/>
                            </actions>
                            <columns>
                                <column id="emailAddress"
                                        align="CENTER"/>
                                <column id="emailAddressType"/>
                            </columns>
                            <rows datasource="emailAddressesDs"/>
                            <buttonsPanel>
                                <button action="emailAddressesTable.create"/>
                                <button action="emailAddressesTable.edit"/>
                                <button action="emailAddressesTable.remove"/>
                            </buttonsPanel>
                        </table>
                    </groupBox>
                    <groupBox id="addressesBox"
                              caption="msg://com.example.peer.entity/Person.addresses">
                        <table id="addressesTable"
                               height="200px"
                               width="100%">
                            <actions>
                                <action id="add"/>
                                <action id="remove"/>
                            </actions>
                            <columns>
                                <column id="addressLine1"/>
                                <column id="postcode"/>
                                <column id="addressType"/>
                            </columns>
                            <rows datasource="addressesDs"/>
                            <buttonsPanel>
                                <button action="addressesTable.add"/>
                                <button action="addressesTable.remove"/>
                            </buttonsPanel>
                        </table>
                    </groupBox>
                </row>
                <row>
                    <groupBox id="holidaysBox"
                              caption="msg://com.example.peer.entity/Person.holidays">
                        <table id="holidaysTable"
                               height="200px"
                               width="100%">
                            <actions>
                                <action id="create"/>
                                <action id="edit"/>
                                <action id="remove"/>
                            </actions>
                            <columns>
                                <column id="name"/>
                                <column id="startDate"/>
                                <column id="endDate"/>
                            </columns>
                            <rows datasource="holidaysDs"/>
                            <buttonsPanel>
                                <button action="holidaysTable.create"/>
                                <button action="holidaysTable.edit"/>
                                <button action="holidaysTable.remove"/>
                            </buttonsPanel>
                        </table>
                    </groupBox>
                    <groupBox id="personTagsGroupBox"
                              caption="msg://PersonTagsGroupBoxTitle">
                        <twinColumn id="personTagsTwinColumn"
                                    addAllBtnEnabled="true"
                                    datasource="personDs"
                                    optionsDatasource="journalTagsDs"
                                    property="journalTags"
                                    responsive="true"
                                    width="100%"/>
                    </groupBox>
                </row>
            </rows>
        </grid>
        <frame id="windowActions"
               screen="editWindowActions"/>
    </layout>
</window>

And here’s the controller:

package com.example.peer.web.person;

import com.haulmont.cuba.gui.components.*;
import com.haulmont.cuba.gui.components.actions.RemoveAction;
import com.haulmont.cuba.gui.data.CollectionDatasource;
import com.example.peer.entity.Address;
import com.example.peer.entity.Email;
import com.example.peer.entity.JournalTag;
import com.example.peer.entity.Person;

import javax.inject.Inject;
import javax.inject.Named;
import java.util.HashSet;
import java.util.Map;
import java.util.UUID;

public class PersonEdit extends AbstractEditor<Person> {

    @Named("emailAddressesTable.remove")
    private RemoveAction removeEmailAddressAction;

    @Named("addressesTable.remove")
    private RemoveAction addressesTableRemove;

    @Named("fieldGroup.defaultEmailAddress")
    private LookupField defaultEmailAddress;


    @Inject
    private TwinColumn personTagsTwinColumn;

    @Inject
    private CollectionDatasource<JournalTag, UUID> personJournalTagsDs;

    @Named("fieldGroup.defaultAddress")
    private LookupPickerField defaultAddressField;

    @Override
    public void init(Map<String, Object> params) {

   
        removeEmailAddressAction.setAfterRemoveHandler(removedItems -> {

            Email currentlySelectedEmailAddress = defaultEmailAddress.getValue();

            if (removedItems.contains(currentlySelectedEmailAddress)) {

                defaultEmailAddress.setValue(null);

            }
        });

  
        addressesTableRemove.setAfterRemoveHandler(removedItems -> {

            Address defaultAddress = defaultAddressField.getValue();

            if (removedItems.contains(defaultAddress)) {

                defaultAddressField.setValue(null);
            }
        });

    }

    @SuppressWarnings("Duplicates")
    @Override
    public void ready() {

        super.ready();

        personTagsTwinColumn.addValueChangeListener(e -> {

            HashSet<JournalTag> personJournalTags = e.getComponent().getValue();

            personJournalTagsDs.clear();

            personJournalTags.forEach(journalTag -> {

                personJournalTagsDs.addItem(journalTag);
            });
        });

    }
}

Incidentally, if Studio cannot open one design window, then any subsequent design windows are blank when you try to open them.

Hi.
Thank you for reporting the problem. We have created a YouTrack issue.

Not sure if it’s related, but the screens aren’t showing up in the project window.

01

‘Screens’ item is there, but there’s nothing underneath it.