Vaadin 7.0.0.beta5 "Uncaught client side exception"

Hello, I get strange error on application startup “Uncaught client side exception” (screenshot attached), if I try to do any actions with added components, I get “IndexOutOfBoundsException: Index: -1, Size: 0” exception. I`m using 7.0.0.beta5 version and spring-vaadin-integration addon 1.5 version. Any advice?

Log from console

21:24:33:004 JavaScriptException: (NOT_FOUND_ERR) 
 code: 8
 stack: Error: An attempt was made to reference a Node in a context where it does not exist.
    at sj (0.js:2936:29)
    at AMb (0.js:5110:919)
    at Object.U4d [as Yf]
 (0.js:5149:4852)
    at YHb (0.js:5132:1853)
    at kIb (0.js:4456:138)
    at t2d (0.js:5072:659)
    at Object.C2d [as zc]
 (0.js:5148:27070)
    at Object.ss (0.js:5135:5518)
    at Ss (0.js:4891:190)
    at Hs (0.js:4550:61)
 INDEX_SIZE_ERR: 1
 DOMSTRING_SIZE_ERR: 2
 HIERARCHY_REQUEST_ERR: 3
 WRONG_DOCUMENT_ERR: 4
 INVALID_CHARACTER_ERR: 5
 NO_DATA_ALLOWED_ERR: 6
 NO_MODIFICATION_ALLOWED_ERR: 7
 NOT_FOUND_ERR: 8
 NOT_SUPPORTED_ERR: 9
 INUSE_ATTRIBUTE_ERR: 10
 INVALID_STATE_ERR: 11
 SYNTAX_ERR: 12
 INVALID_MODIFICATION_ERR: 13
 NAMESPACE_ERR: 14
 INVALID_ACCESS_ERR: 15
 VALIDATION_ERR: 16
 TYPE_MISMATCH_ERR: 17
 SECURITY_ERR: 18
 NETWORK_ERR: 19
 ABORT_ERR: 20
 URL_MISMATCH_ERR: 21
 QUOTA_EXCEEDED_ERR: 22
 TIMEOUT_ERR: 23
 INVALID_NODE_TYPE_ERR: 24
 DATA_CLONE_ERR: 25: NOT_FOUND_ERR: DOM Exception 8


Application.class


@Component(value = "taxiApplication")
@Scope("request")
public class Application extends UI {

    @Autowired
    private transient ApplicationContext applicationContext;

    @Override
    protected void init(VaadinRequest vaadinRequest) {
        //DiscoveryNavigator navigator = new DiscoveryNavigator(this, getContent());
        //navigator.navigateTo(UI.getCurrent().getPage().getFragment());

    addComponent(new MainView());
    }
}


MainView.class


@Component
@Scope("prototype")
@VaadinView("")
public class MainView extends Window implements View {

    @Autowired
    private transient ApplicationContext applicationContext;

    @PostConstruct
    public void PostConstruct() {

    }

    public MainView() {
        setWidth("100px");
        setHeight("100px");
        VerticalLayout mainLayout = new VerticalLayout();
        mainLayout.addComponent(new Label("Test label!"));

        setContent(mainLayout);
    }

    @Override
    public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {

    }
}


web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>Vaadin Widget Test Application</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/test-servlet.xml</param-value>
    </context-param>
    <servlet>
        <servlet-name>Taxi web application</servlet-name>
        <servlet-class>ru.xpoft.vaadin.SpringVaadinServlet</servlet-class>
        <init-param>
            <param-name>beanName</param-name>
            <param-value>application</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Taxi web application</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Taxi web application</servlet-name>
        <url-pattern>/VAADIN*/**</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/static/*</url-pattern>
    </servlet-mapping>
</web-app>


test-servlet.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="test.web"/>
    <context:property-placeholder location="classpath:META-INF/test-webapp-default.properties, classpath*:test-webapp-target.properties, classpath*:test-webapp-local.properties" />
    <context:spring-configured/>

</beans>

12589.png

Does this also happen if you do something similar without Spring?

I’ve also heard about various puzzling errors that might occur if there are unsuitable scope declarations for Vaadin classes managed by Spring, though I’m not so familiar with the issue that I can tell whether your example code is correct.

Thank, for your advice, I will try remove spring from application, but main aim of using Vaadin 7 was spring-vaadin-integration add-on.

Of couse, I’m just suggesting you remove the stuff related to Spring to help pinpointing the cause of the problem. I’m certain it will be possible to make Vaadin 7 and spring-vaadin-integration work once the cause of the issue has been resolved.

Did you solve it? How?
I have the same problem on Beta5 and Beta6 (with spring)

without Spring = no result. Still does not work.

On Tomcat 7.0.30, java 1.6.0_20-rev-b05.

I don’t think that problem with spring-vaadin-integration add-on.

But I can try to check it. Do you have a simple project with this issue?

It’s not. I’ve removed ru.xpoft.vaadin.SpringVaadinServlet from web.xml.

It looks like we have the same - I guess basic - problem with Vaadin7. This code worked well with beta3.

web.xml:

appl com.vaadin.server.VaadinServlet Vaadin application class to start UI my.test.Application appl /* productionMode false

Application.java

package my.test;

import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.UI;
import com.vaadin.ui.Window;

public class Application extends UI{

private Window window;

public Application() {
super();
}

@Override
protected void init(VaadinRequest request) {
System.out.println(“initializing…”);

System.out.println("THIS is "+this);
System.out.println("---------------------------------");
Window win = getWindow();
win.setSizeUndefined();
addComponent(win);

}

public Window getWindow() {
if (window == null) {
window = new Window();
window.setCaption(“App Caption”);
}
return window;
}

}

Thank for your replay. I will also try to use Vaadin beta-6 & beta-3. Unfortunately I could not do it, earlier than friday.

Now I can also see the exception, and what causes it. The problem is that you are adding the window as a component instead of a window. Changing addComponent to addWindow in your example seems to make everything work nicely.

Yep, it fix my problem. Thanks!!!