Hello Dmitri!
Thanks for responding!
Well, no, I’m not modifying any lists as far as I know.
With this simplified snippet I get the error.
package preloader.test;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import eu.livotov.tpt.TPTApplication;
import eu.livotov.tpt.gui.widgets.TPTLazyLoadingLayout;
@SuppressWarnings("serial")
public class MyVaadinApplication extends TPTApplication
{
private Window window;
@Override
public void applicationInit() {
VerticalLayout MainLayout = new VerticalLayout();
final VerticalLayout contentWindow = new VerticalLayout();
window = new Window("My Vaadin Application");
setMainWindow(window);
window.addComponent(MainLayout);
Button loadContent1 = new Button("load page 1");
MainLayout.addComponent(loadContent1);
loadContent1.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
contentWindow.removeAllComponents();
contentWindow.addComponent(new TPTLazyLoadingLayout(new page1(), true));
}
});
Button loadContent2 = new Button("load page 2");
MainLayout.addComponent(loadContent2);
loadContent2.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
contentWindow.removeAllComponents();
contentWindow.addComponent(new TPTLazyLoadingLayout(new page2(), true));
}
});
MainLayout.addComponent(contentWindow);
}
@Override
public void firstApplicationStartup() {
// TODO Auto-generated method stub
}
}
The pages being loaded are:
package preloader.test;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import eu.livotov.tpt.gui.widgets.TPTLazyLoadingLayout;
import eu.livotov.tpt.gui.widgets.TPTLazyLoadingLayout.LazyLoader;
public class page1 extends VerticalLayout implements LazyLoader {
private static final long serialVersionUID = 1L;
public page1() {}
public String getLazyLoadingMessage() {
return "loading page 1...";
}
public Component lazyLoad(TPTLazyLoadingLayout layout) {
addComponent(new Label("hello page from page 1"));
return this;
}
}
page2() looks the same, just with a different label.
Here you can see the demo of my snippet
here
.
When I click on the buttons, the preloader shows up and everything seems normal. But then, after a while (means a couple of clicks) the error in my post above occurs. Sometimes it takes longer, sometimes the error occurs just after 2-3 clicks.
What I have noticed, the error only occurs when I add the TPTLazyLoadingLayout object to the component. The error does not occur when I just create the new TPTLazyLoadingLayout object and do not add it to the concrete component.
Does this snippet help you? If I can be of any further assistance, please let me know.
thanks for having a look at it.
ben
ps. just for the record, here the entire exception which the server throws when the red “Internal error” box shows up.
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at com.vaadin.ui.AbstractOrderedLayout.paintContent(AbstractOrderedLayout.java:144)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:754)
at com.vaadin.ui.AbstractOrderedLayout.paintContent(AbstractOrderedLayout.java:146)
at com.vaadin.ui.AbstractComponent.paint(AbstractComponent.java:754)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.paintAfterVariableChanges(AbstractCommunicationManager.java:807)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:621)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:266)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:476)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:680)