我想在我的程序中将一些文本行附加到textarea。
这是我的方法appendText
:
protected synchronized void appendText(final String i_text) {
UI.access(new Runnable() {
@Override
public void run() {
textarea.setReadOnly(false);
setText(textarea.getValue() + i_text + "\n");
textarea.setCursorPosition(Integer.MAX_VALUE);
textarea.setReadOnly(true);
UI.push();
}
});
}
有时我在我的应用程序中看到这个异常跟踪,但我不知道为什么会发生这种情况
有人能帮助我吗?
java.util.concurrent.ExecutionException: java.lang.RuntimeException: Push failed at
java.util.concurrent.FutureTask.report(FutureTask.java:122) at
java.util.concurrent.FutureTask.get(FutureTask.java:188) at
com.vaadin.server.VaadinSession$FutureAccess.get(VaadinSession.java:123) at
com.vaadin.server.VaadinService.runPendingAccessTasks(VaadinService.java:1800) at
com.vaadin.server.VaadinSession.unlock(VaadinSession.java:1013) at
com.vaadin.server.VaadinService.ensureAccessQueuePurged(VaadinService.java:1761) at
com.vaadin.server.VaadinService.accessSession(VaadinService.java:1727) at
com.vaadin.server.VaadinSession.access(VaadinSession.java:1403) at
com.vaadin.ui.UI.access(UI.java:1389) at
abat.spsemulation.ui.components.OutputComponent.appendText(OutputComponent.java:37) at
abat.spsemulation.ui.components.TelegramOutputComponent.appendTelegramText(TelegramOutputComponent.java:27) at abat.sps_emulation.outputlayer.GUIController.info(GUIController.java:1304) at
abat.sps_emulation.interfaces.TelegramLogger$1.run(TelegramLogger.java:87) at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at
java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at vjava.awt.EventQueue.dispatchEvent(EventQueue.java:703) at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at
java.awt.EventDispatchThread.run(EventDispatchThread.java:91) Caused by: java.lang.RuntimeException: Push failed at
com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:158) at
com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:133) at com.vaadin.ui.UI.push(UI.java:1496) at
abat.spsemulation.ui.components.OutputComponent$1.run(OutputComponent.java:44) at
com.vaadin.ui.UI.accessSynchronously(UI.java:1326) at com.vaadin.ui.UI$3.run(UI.java:1392) at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at
java.util.concurrent.FutureTask.run(FutureTask.java:262) at
com.vaadin.server.VaadinService.runPendingAccessTasks(VaadinService.java:1797) ... 23 more Caused by: java.util.ConcurrentModificationException at
java.util.HashMap$HashIterator.nextEntry(HashMap.java:926) at
java.util.HashMap$ValueIterator.next(HashMap.java:954) at
com.vaadin.ui.ConnectorTracker.cleanConnectorMap(ConnectorTracker.java:300) at
com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:305) at
com.vaadin.server.communication.AtmospherePushConnection.push(AtmospherePushConnection.java:155)
... 31 more