0

My web application is using Vaadin 6.8.8 version with vaadin-xs addon and it's deployed on a glassfish server.

My application randomly (well, I think it's randomly) gets communication problem and/or session expired messages. Nothing is shown in the log. Sometimes I can see an Invalid security key received from localhost error log, but I'm not sure if it's related to the same issue.

I see these problems in Firefox and Chrome (I didn't try it in IE or Opera). In Chrome browser appears infrequently but in Firefox appears frequently.

I overrided the getSystemMessages method:

public static SystemMessages getSystemMessages() {
    CustomizedSystemMessages m = new CustomizedSystemMessages();

    m.setCommunicationErrorCaption(null);
    m.setCommunicationErrorMessage(null);
    m.setCommunicationErrorURL(null);
    m.setSessionExpiredCaption(null);
    m.setSessionExpiredMessage(null);
    m.setSessionExpiredURL(null);

    return m;
}

Now, I don't see any communication problem or session expired messages, instead I get a JavaScript standard alert box with Server Error message, then the page is reloaded. This alert box only appears in Firefox browser, in Chrome broswer the alert box doesn't appear.

Can someone give me any clue? Some workarround to not show the alert box.

Edit:

Sometimes I found this stacktrace in the log file:

Terminal error:
java.lang.ArrayIndexOutOfBoundsException: 1
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1376)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
at com.vaadin.addons.xs.server.JsonpCommunicationManager.doHandleUidlRequest(JsonpCommunicationManager.java:142)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:325)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
at com.vaadin.addons.xs.server.XSApplicationServlet.service(XSApplicationServlet.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:619)
Anna Koskinen
  • 1,362
  • 3
  • 22
ilazgo
  • 650
  • 2
  • 11
  • 35
  • 1. Why do you set all messages to NULL ? This does not help track down the problem. This perhaps generates your "Server Error" messages. (These usually come when you have a exception on serverside) 2. Are you sure that the connection to your server is OK ? - When you receive "Invalid security key" then perhaps you IP address has changed (Roaming WLAN, Loadbalancing etc.) - The session expired error can occur when you open your app in two tabs/windows for example – André Schild Apr 26 '13 at 15:25
  • 1. Beacause the messages appear very very often and I don't want to show the big red panel with "Communication problem" or "Session expired". Is there a best option to track down the problem and not showing the red panel? 2. I'm sure that the connection is fine, this issue occurs in my localhost too. – ilazgo Apr 26 '13 at 15:38
  • I would currently "reenable" all error messages (Just leave them on default, so we don't hide anything) Do you perhaps background threads to update/modify the UI? – André Schild Apr 26 '13 at 15:49
  • I have the refresher addon but this addon isn't causing the problem because if I remove refresher addon, the error messages appears too. – ilazgo Apr 26 '13 at 16:53
  • Why do you have the refresher add on, in this case ? Do you modify the UI in the background ? – André Schild Apr 26 '13 at 17:42
  • @AndréSchild I call a web service, while not receiving the response I show an image in the screen, then I show the data received from the web service. So yes, I think I modify the UI in the background, but this errors are shown too in screens with no refresher addon attached. I updated the question with a new stacktrace that I found in my log file. – ilazgo Apr 29 '13 at 07:57

1 Answers1

1

I think you have to look at this one:

https://vaadin.com/de/forum#!/thread/231272

The important part in there is:

Other background thread considerations: Remember to synchronize on the application instance whenever updating the UI from another thread.

In code you do it this way:

synchronized (getApplication()) 
{ 
  // update the UI as required in this synchronized block
  label.setValue("Operation completed");
} 
André Schild
  • 4,592
  • 5
  • 28
  • 42
  • But the errors appears at the application starting, without any call to the refresher addon. Where should I put the "synchronized"? In my init Application? in my ViewManager? In every views? – ilazgo Apr 30 '13 at 08:13
  • The synchronized parts are only needed in background threads. I think we would need to see more of your code to see what's wrong with it. – André Schild May 01 '13 at 16:01