summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/UI.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 746fa194ac..0412cb1882 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -601,7 +601,18 @@ public abstract class UI extends AbstractSingleComponentContainer implements
*/
public void doInit(VaadinRequest request, int uiId) {
if (this.uiId != -1) {
- throw new IllegalStateException("UI id has already been defined");
+ String message = "This UI instance is already initialized (as UI id "
+ + this.uiId
+ + ") and can therefore not be initialized again (as UI id "
+ + uiId + "). ";
+
+ if (getSession() != null
+ && !getSession().equals(VaadinSession.getCurrent())) {
+ message += "Furthermore, it is already attached to another VaadinSession. ";
+ }
+ message += "Please make sure you are not accidentally reusing an old UI instance.";
+
+ throw new IllegalStateException(message);
}
this.uiId = uiId;