0 Replies Latest reply: Nov 12, 2012 2:39 PM by shivjobss RSS

Inheriting from a Composite widget make the original widget not load

shivjobss Newbie

I have a pretty simple Composite widget that displays a panel:

 

@Dependent

@Templated("#addSchedulerPanel")

public class AddSchedulerPanel extends Composite implements AddSchedulerView {

 

    @Inject

    public AddSchedulerPanel(@AutoBound DataBinder<AddSchedulerModel> userBinder) {

        this.schedulerModel = userBinder.getModel();

    }

 

// stuff here...

}

 

When I click my "Add Scheduler" button this panel displays as expected.  The implementation is:

 

    @Inject

    Instance<AddSchedulerPanel> addSchedulerPanelInstance;

    public void createAddSchedulerDialog() {

        addSchedulerView = addSchedulerPanelInstance.get();

    }

 

But now I'm trying to create a variation on this with:

 

public class EditSchedulerPanel extends AddSchedulerPanel {

 

    @Inject

    public EditSchedulerPanel(DataBinder<AddSchedulerModel> userBinder) {

        super(userBinder);

    }

}

 

So the only difference is that I am now extending the AddSchedulerPanel with EditSchedulerPanel.  The extension has no additional behavior.

 

Now, when I click the "AddScheduler" button (not the EditScheduler button!) I get errors (see below).  Something is null in the addSchedulerPanelInstance.get() call.

 

AddScheduler has a @PostConstruct method, but I can see in the debugger that it is not actually being called, so I'm not including it here.  In fact, the constructor is not even being called before the error is issued.

 

It seems that there is something I'm missing in my instance creation.  But what?

 

Thanks,

 

Shivani

 

Here are the actual error messages:

 

The javascript error says:

Uncaught exception escaped : com.google.gwt.event.shared.UmbrellaException

 

Exception caught: null

See the Development console log for details.

Register a GWT.setUncaughtExceptionHandler(..) for custom uncaught exception handling.

 

And the console says:

00:31:44.893 [ERROR] Uncaught exception escaped

com.google.gwt.event.shared.UmbrellaException: Exception caught: null

     at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)

     at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)

     at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)

     at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)

     at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)

    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)

     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25

     at java.lang.reflect.Method.invoke(Method.java:597)

     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.GeneratedMethodAccessor106.invoke(Unknown Source)

     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

     at java.lang.reflect.Method.invoke(Method.java:597)

     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(Thread.java:662)

Caused by: java.lang.NullPointerException: null

     at org.jboss.errai.ioc.client.container.IOCBeanManager.lookupBeans(IOCBeanManager.java:418)

     at org.jboss.errai.ioc.client.container.IOCBeanManager.lookupBean(IOCBeanManager.java:469)

     at org.jboss.errai.enterprise.client.cdi.InstanceProvider$InstanceImpl.get(InstanceProvider.java:86)

     at com.termalabs.ac.client.panels.admin.schedulers.SchedulersPanel.createAddSchedulerDialog(SchedulersPanel.java:183)

     at com.termalabs.ac.client.panels.admin.schedulers.SchedulersController.addSchedulerClicked(SchedulersController.java:84)

     at com.termalabs.ac.client.panels.admin.schedulers.SchedulersPanel.addScheduler(SchedulersPanel.java:178)

     at org.jboss.errai.ioc.client.BootstrapperImpl$58$1$1.onClick(BootstrapperImpl.java:1200)

     at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:56)

     at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.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.fireEvent(SimpleEventBus.java:88)

     at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)

     at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)

     at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)

     at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:177)

     at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1351)

     at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1307)

     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

     at java.lang.reflect.Method.invoke(Method.java:597)     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.GeneratedMethodAccessor106.invoke(Unknown Source)

     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

     at java.lang.reflect.Method.invoke(Method.java:597)

     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(Thread.java:662)