Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LockInteractionEvent Umbrella Exception #314

Closed
BenDol opened this issue Aug 16, 2013 · 4 comments
Closed

LockInteractionEvent Umbrella Exception #314

BenDol opened this issue Aug 16, 2013 · 4 comments

Comments

@BenDol
Copy link
Contributor

BenDol commented Aug 16, 2013

I have an event setup called LoadingIndicatorEvent that is for controlling my applications loading displays and restrictions, one of the restrictions being the LockInterfactionEvent call.

Here is my event callback in my ApplicationPresenter that is causing the exception:

/**
 * Event callback for {@link LoadingIndicatorEvent}.<br>
 * Displays or hides the applications page load indicator.
 */
@ProxyEvent
@Override
public void onLoadingIndicator(LoadingIndicatorEvent event) {
    if(event.isLoading()) {
        getView().getLoadingPanel().setVisible(true);
        LockInteractionEvent.fire(ApplicationPresenter.this, true);
    }
    else {
        getView().getLoadingPanel().setVisible(false);
        LockInteractionEvent.fire(ApplicationPresenter.this, false);
    }
}

The exception:

com.google.web.bindery.event.shared.UmbrellaException: Exception caught: (NotFoundError) @com.google.gwt.dom.client.Node::removeChild(Lcom/google/gwt/dom/client/Node;)([JavaScript object(16)]): NotFoundError: DOM Exception 8
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:203)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEventFromSource(SimpleEventBus.java:96)
    at com.gwtplatform.mvp.client.PresenterWidget.fireEvent(PresenterWidget.java:281)
    at com.gwtplatform.mvp.client.proxy.LockInteractionEvent.fire(LockInteractionEvent.java:46)
    at nz.co.doltech.ims.project.client.application.ApplicationPresenter.onLoadingIndicator(ApplicationPresenter.java:318)
    at nz.co.doltech.ims.project.client.application.ApplicationPresenterMyProxyImpl$4$1.execute(ApplicationPresenterMyProxyImpl.java:108)
    at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
    at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:180)
    at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:347)
    at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
    at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:138)
    at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gwt.core.client.JavaScriptException: (NotFoundError) @com.google.gwt.dom.client.Node::removeChild(Lcom/google/gwt/dom/client/Node;)([JavaScript object(16)]): NotFoundError: DOM Exception 8
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.dom.client.Node$.removeChild$(Node.java)
    at com.gwtplatform.mvp.client.RootPresenter$RootView.unlockScreen(RootPresenter.java:113)
    at com.gwtplatform.mvp.client.RootPresenter.onLockInteraction(RootPresenter.java:199)
    at com.gwtplatform.mvp.client.proxy.LockInteractionEvent.dispatch(LockInteractionEvent.java:73)
    at com.gwtplatform.mvp.client.proxy.LockInteractionEvent.dispatch(LockInteractionEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEventFromSource(SimpleEventBus.java:96)
    at com.gwtplatform.mvp.client.PresenterWidget.fireEvent(PresenterWidget.java:281)
    at com.gwtplatform.mvp.client.proxy.LockInteractionEvent.fire(LockInteractionEvent.java:46)
    at nz.co.doltech.ims.project.client.application.ApplicationPresenter.onLoadingIndicator(ApplicationPresenter.java:318)
    at nz.co.doltech.ims.project.client.application.ApplicationPresenterMyProxyImpl$4$1.execute(ApplicationPresenterMyProxyImpl.java:108)
    at com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerImpl.java:50)
    at com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.java:180)
    at com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(SchedulerImpl.java:347)
    at com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java:78)
    at com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:138)
    at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
    at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Unknown Source)

Anyone have any idea what is going on with this? Perhaps I am missing something.

Cheers,
Ben!

@branflake2267
Copy link
Contributor

I think we need more to go on. Could you provide the presenter and view and anything else that could reproduce this?

@BenDol
Copy link
Contributor Author

BenDol commented Aug 16, 2013

ApplicationPresenter

/**
 * Presenter that parents other child presenters display and layout.<br>
 * This presenter associates with:
 * <ul>
 *   <li>{@link ApplicationView} - for the presenters display view.</li>
 * </ul>
 * @author Ben Dol
 * 
 */
public class ApplicationPresenter extends RichPresenter<ApplicationPresenter.MyView,
    ApplicationPresenter.MyProxy> implements ViewUiHandlers, SendGlobalMessageHandler,
    LoginTryHandler, LoadingIndicatorHandler, RequireWidgetHandler, AsyncCallFailHandler {

    private static final Logger logger = Logger.getLogger(ApplicationPresenter.class.getName());

    public interface MyView extends View, HasUiHandlers<ViewUiHandlers> {
        public HTMLPanel getTitlePanel();
        public HTMLPanel getTopPanel();
        public HTMLPanel getMiddlePanel();
        public HTMLPanel getBottomPanel();
        public HTMLPanel getInfoPanel();
        public HTMLPanel getNavPanel();
        public HTMLPanel getLoadingPanel();
    }

    @ProxyCodeSplit
    public interface MyProxy extends Proxy<ApplicationPresenter> {
    }

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_TITLE
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_TOP
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_MIDDLE
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_BOTTOM
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_INFO
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_NAV
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_ACTIONBAR
        = new Type<RevealContentHandler<?>>();

    @ContentSlot
    public static final Type<RevealContentHandler<?>> SLOT_PROGRESSBAR
        = new Type<RevealContentHandler<?>>();

.. snip ..

    private PlaceManager placeManager;
    private DispatchAsync dispatch;

    @Inject
    public ApplicationPresenter(final EventBus eventBus, final MyView view, final MyProxy proxy,
            final PlaceManager placeManager, final DispatchAsync dispatch,
            final Provider<GlobalMessagePresenterWidget> globalMessageFactory){
        super(eventBus, view, proxy);

        this.dispatch = dispatch;
        this.placeManager = placeManager;

.. snip ..

        getView().setUiHandlers(this);
    }

    @Override
    protected void revealInParent() {
        RevealRootContentEvent.fire(this, this);
    }

    @Override
    protected void onBind() {
        super.onBind();

        if(Cookies.getCookie(SharedTokens.securityCookie) == null) {
            dispatch.execute(new InitSecurity(), new AsyncCallback<NoResult>() {
                @Override
                public void onSuccess(NoResult result) {
                    logger.log(Level.INFO, "Successfully initialized the security cookie");

                    // TODO: Fix this hack (working with GWTP team to figure out what is going on)
                    Cookies.setCookie(SharedTokens.securityCookie, "secured");
                }
                @Override
                public void onFailure(Throwable caught) {
                    logger.log(Level.WARNING, "Failed to initialized the security cookie");
                }
            });
        }
    }

    @Override
    protected void onUnbind() {
        super.onUnbind();
    }

    @Override
    protected void onReset() {
        super.onReset();
    }

    @Override
    protected void onReveal() {
        // Add global navigation presenter
        getView().addToSlot(SLOT_NAV, navigationPresenter);
    }

.. snip ..

    /**
     * Event callback for {@link LoadingIndicatorEvent}.<br>
     * Displays or hides the applications page load indicator.
     */
    @ProxyEvent
    @Override
    public void onLoadingIndicator(LoadingIndicatorEvent event) {
        if(event.isLoading()) {
            getView().getLoadingPanel().setVisible(true);
            LockInteractionEvent.fire(ApplicationPresenter.this, true);
        }
        else {
            getView().getLoadingPanel().setVisible(false);
            LockInteractionEvent.fire(ApplicationPresenter.this, false);
        }
    }

.. snip ..
}

ApplicationView

/**
 * Application page view associated with {@link ApplicationPresenter}
 * <br>Display design documentation:
 * <ul>
 *   <li>http://...</li>
 * </ul>
 * @author Ben Dol
 * 
 */
public class ApplicationView extends ViewWithUiHandlers<ApplicationView.ViewUiHandlers> 
    implements MyView {

    private final Widget widget;

    public interface Binder extends UiBinder<Widget, ApplicationView> {
    }

    public interface ViewUiHandlers extends UiHandlers {
    }

    @UiField HTMLPanel titlePanel;
    @UiField HTMLPanel topPanel;
    @UiField HTMLPanel middlePanel;
    @UiField HTMLPanel bottomPanel;
    @UiField HTMLPanel infoPanel;
    @UiField HTMLPanel navPanel;
    @UiField HTMLPanel loadingPanel;
    @UiField HTMLPanel actionBarPanel;
    @UiField HTMLPanel progressBarPanel;

    @Inject
    public ApplicationView(final Binder binder) {
        widget = binder.createAndBindUi(this);
    }

    @Override
    public Widget asWidget() {
        return widget;
    }

    @Override
    public void addToSlot(Object slot, IsWidget content) {
        HTMLPanel panel = null;
        if(slot == ApplicationPresenter.SLOT_TOP) {
            panel = topPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_MIDDLE) {
            panel = middlePanel;
        }
        else if(slot == ApplicationPresenter.SLOT_BOTTOM) {
            panel = bottomPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_INFO) {
            panel = infoPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_NAV) {
            panel = navPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_TITLE) {
            panel = titlePanel;
        }
        else if(slot == ApplicationPresenter.SLOT_ACTIONBAR) {
            panel = actionBarPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_PROGRESSBAR) {
            panel = progressBarPanel;
        }

        if(panel != null) {
            if(content != null) {
                panel.add(content);
            }
        }
        else {
            super.addToSlot(slot, content);
        }
    }

    @Override
    public void setInSlot(Object slot, IsWidget content) {
        HTMLPanel panel = null;
        if(slot == ApplicationPresenter.SLOT_TOP) {
            panel = topPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_MIDDLE) {
            panel = middlePanel;
        }
        else if(slot == ApplicationPresenter.SLOT_BOTTOM) {
            panel = bottomPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_INFO) {
            panel = infoPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_NAV) {
            panel = navPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_TITLE) {
            panel = titlePanel;
        }
        else if(slot == ApplicationPresenter.SLOT_ACTIONBAR) {
            panel = actionBarPanel;
        }
        else if(slot == ApplicationPresenter.SLOT_PROGRESSBAR) {
            panel = progressBarPanel;
        }

        if(panel != null) {
            panel.clear();
            if(content != null) {
                panel.add(content);
            }
        }
        else {
            super.setInSlot(slot, content);
        }
    }

    @Override
    public HTMLPanel getTitlePanel() {
        return titlePanel;
    }

    @Override
    public HTMLPanel getTopPanel() {
        return topPanel;
    }

    @Override
    public HTMLPanel getMiddlePanel() {
        return middlePanel;
    }

    @Override
    public HTMLPanel getBottomPanel() {
        return bottomPanel;
    }

    @Override
    public HTMLPanel getInfoPanel() {
        return infoPanel;
    }

    @Override
    public HTMLPanel getNavPanel() {
        return navPanel;
    }

    @Override
    public HTMLPanel getLoadingPanel() {
        return loadingPanel;
    }
}

One of the places I am calling this event from is a root presenter I am using:

/**
 * This is a base presenter that extends {@link Presenter}.<br>
 * A custom presenter which provides an extended set of 'rich' functionality.<br><br>
 * Use this class when you require the following:
 * <ul>
 *  <li>Page loading indicators onReveal and request preperation.</li>
 *  <li><i>Reserved for future functionality.</i></li>
 * </ul>
 * @author Ben Dol
 *
 * @param <T> Presenters view class
 * @param <H> Presenters proxy class
 */
public class RichPresenter<T extends View, 
        H extends Proxy<?>> extends Presenter<T, H> {

    @Inject
    public RichPresenter(EventBus eventBus, T view, H proxy) {
        super(eventBus, view, proxy);
    }

    @Override
    protected void revealInParent() {
        RevealRootContentEvent.fire(this, this);
    }

    @Override
    public void prepareFromRequest(PlaceRequest request) {
        super.prepareFromRequest(request);

        // Start page load indicator
        LoadingIndicatorEvent.fire(this, true);
    }

    @Override
    protected void onReveal() {
        super.onReveal();

        // Stop page load indicator
        LoadingIndicatorEvent.fire(this, false);
    }

    @Override
    protected void onReset() {
        super.onReset();

        // Stop page load indicator
        LoadingIndicatorEvent.fire(this, false);
    }
}

Any other uses of this Event is called before dispatch calls etc. Not sure if there's anything else I can provide for this issue as I have no idea why it is happening. All I know is that if I remove LockInteractionEvent from the LoadIncidatorEvent callback it doesn't happen.

@olafleur
Copy link
Member

Do you still have this error in GWTP 1.2.1?

@BenDol
Copy link
Contributor Author

BenDol commented Apr 18, 2014

No this seems to be resolved now :)

@BenDol BenDol closed this as completed Apr 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants