Vaadin XS - Window.setImmediate(true) -> Firefox Bug?

I am trying to integrate Vaadin XS in my app and I getting closer and closer to it. But there are still serious problems with the properly launch of the application.
The current main problem is firefox! (10.0.2)
Now I ve found a possible problem cause and could reproduce it with a simple hello world with XS Application:

public void init() {
	Window mainWindow = new Window();
	mainWindow.addComponent(new Label("Hello Problem"));

If I start this application in firefox and play with F5 or the reload browser button, I get Session expired or Internal Error message in the standard javascript alert with visible and
tags. This happens to me only with firefox! If I remove mainWindow.setImmediate(true) line, then firefox gets no problem. This is a very strange behavior.
If the session expired message occures, I get no exception in the server console. If the internal error occures, I get:

java.lang.ArrayIndexOutOfBoundsException: 1
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(
	at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
	at com.vaadin.addons.xs.server.XSApplicationServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.valves.AccessLogValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.AbstractHttp11Processor.process(
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$ Source)
	at Source)

In the Hello World application the problem occures not often, but in average on every 5th hit.
In my real application I lose my session by reloading the tab very often and I cant find out why. Without XS I get no problems with reloading. And the problem occures only in Firefox. If I open a new firefox tab and load the application there, then I get no error. If I reload the application in the tab, I lose my session.
Are there some things which you not may do if you use XS Addon?
One of this things I could find out: dont switch main windows, it affects the XS stability and you get out of sync if you use Clickshortcuts on buttons.

I am a student and I decided to make a project with vaadin for the software engineering lecture. And the main feature of this project is the easy embedding of it in another websites. I would be very happy to hear any kind of tips. The project deadline is this friday :smiley:

I forgotten to say that the problem occures only if the vaadin application is configured as following in web.xml:

		<servlet-name>My Servlet</servlet-name>

if its not matching the whole url, like in:

		<servlet-name>My Servlet</servlet-name>
		<servlet-name>Some other Servlet</servlet-name>

then the My Servlet application works fine if you load it over the browser. The other servlet gets the same problem as described above.
I ve also tried to create a dummy application that get the whole errors and my real application work instead fine. It was a happiness for a minute, because my applications worked over the browser perfectly. But I cant embed them in another website. If I do it, then the app shows the error, that it cant find its widgetset. But my widgetset is for all application the same. I guess, it stucks because of the url, which consists not only the project name, but also the application name, like http://localhost:9090/project/appname/embedJS, The error shows that the widgetset must be in http://localhost:9090/project/appname/VAADIN/widgetsets

kind regards and please forgive me my english



Reading this and your previous post I think you should check out the XS sources with SVN and build a snapshot version of the add-on by yourself. The latest version has multi window support as where the previous version only supported “main window”. Also it can support “init parameters”. I think you could then get rid of multiple servlets and apps. Too bad somebody has been lazy and these essential enhancements are not yet available in public release.

Parameters can then be passed like this:

See this change set for details:

PS. I still don’t suggest to change top level windows with Vaadin XS nor with any other Vaadin apps. It is an expensive operation. It is always safest and fastest just to change the content of the top level window.