Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

A widget that has an existing parent widget may not be added to the detach list #58

@lynx-r

Description

@lynx-r

I try to test my view with GwtMockito and have this problem:

java.lang.AssertionError: A widget that has an existing parent widget may not be added to the detach list
    at com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose(RootPanel.java:137)
    at com.google.gwt.user.client.ui.RootPanel.get(RootPanel.java:211)
    at com.google.gwt.user.client.ui.RootPanel.get(RootPanel.java:151)
    at com.ait.lienzo.client.core.shape.Node.<clinit>(Node.java:112)
    at sun.reflect.GeneratedSerializationConstructorAccessor17.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:40)
    at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
    at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy(ClassImposterizer.java:128)
    at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:63)
    at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:56)
    at org.mockito.internal.creation.CglibMockMaker.createMock(CglibMockMaker.java:23)
    at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26)
    at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
    at org.mockito.Mockito.mock(Mockito.java:1243)
    at org.mockito.Mockito.mock(Mockito.java:1216)
    at com.google.gwtmockito.GwtMockito$Bridge.create(GwtMockito.java:317)
    at com.google.gwt.core.shared.GWT.createImpl(GWT.java:83)
    at com.google.gwt.core.client.GWT.create(GWT.java:86)
    at online.draughts.rus.client.application.home.PlayComponentView.initEmptyDeskPanel(PlayComponentView.java:195)

I try to create LienzoPanel in PlayComponentView like this:

Layer initDeskRect = GWT.create(Layer.class);
Rectangle contour = GWT.create(Rectangle.class);
...
lienzoPanel = GWT.create(LienzoPanel.class);
lienzoPanel.setBackgroundLayer(initDeskRect);
...

I investigated that there is problem in Node.java:

static
{
    RootPanel.get().getElement().getStyle().setProperty("webkitTapHighlightColor", "rgba(0,0,0,0)");
}

Is this problem on side of Lienzo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions