SocialLogin example needs fixing

Hi,
7 beta 1 here…

The SocialLogin example code seems to be wrong, after you add the appropiate entry to web-screens.xml Cuba won’t start:

2018-11-22 15:06:16.109 DEBUG [http-nio-8080-exec-1/app/anonymous] com.haulmont.cuba.web.DefaultApp - connectionStateChanged connected: true, authenticated: false
2018-11-22 15:06:16.110 DEBUG [http-nio-8080-exec-1/app/anonymous] com.haulmont.cuba.web.App - Closing all windows in all UIs
2018-11-22 15:06:16.174 INFO  [http-nio-8080-exec-1/app/anonymous] com.haulmont.cuba.gui.config.WindowConfig - WindowConfig initialized in 48 ms
2018-11-22 15:06:17.177 ERROR [http-nio-8080-exec-1/app/anonymous] com.haulmont.cuba.web.AppUI - Unable to init ui
java.lang.IllegalArgumentException: Unable to replace by empty navigation state
	at com.haulmont.bali.util.Preconditions.checkNotEmptyString(Preconditions.java:53) ~[cuba-global-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.sys.navigation.UrlTools.replaceState(UrlTools.java:122) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.navigation.WebUrlRouting.changeStateInternal(WebUrlRouting.java:94) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.navigation.WebUrlRouting.pushState(WebUrlRouting.java:72) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.navigation.UrlRouting.pushState(UrlRouting.java:42) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.sys.WebScreens.show(WebScreens.java:425) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.App.createTopLevelWindow(App.java:299) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.DefaultApp.initializeUi(DefaultApp.java:173) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.DefaultApp.connectionStateChanged(DefaultApp.java:87) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.bali.events.EventHub.publish(EventHub.java:170) ~[cuba-global-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.security.ConnectionImpl.fireStateChangeListeners(ConnectionImpl.java:228) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.security.ConnectionImpl.login(ConnectionImpl.java:106) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.DefaultApp.loginOnStart(DefaultApp.java:220) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.AppUI.setupUI(AppUI.java:444) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.haulmont.cuba.web.AppUI.init(AppUI.java:309) ~[cuba-web-7.0-SNAPSHOT.jar:7.0-SNAPSHOT]
	at com.vaadin.ui.UI.doInit(UI.java:738) [vaadin-server-8.5.2-5-cuba.jar:8.5.2-5-cuba]

After some testing I tracked it down to the web-screens.xml entry, if I do not specify the route parameter it dies.

Thus, the entry on the example code should be updated to be something like (note I “guessed” the login value for route):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<screen-config xmlns="http://schemas.haulmont.com/cuba/screens.xsd">
    <include file="com/company/demo/screens.xml"/>
    <screen id="loginWindow"
            route="login"
            template="com/company/demo/web/login/ext-loginWindow.xml"/>
</screen-config>

Hi,

We are not going to update samples until 7.0.0 release.

1 Like

Sure, just pointing out in case you missed it :slight_smile:

2 Likes

Thank you for pointing out!

1 Like