2

When running my GWT/Errai app I get this error message:

00:00:00.000 [ERROR] Unable to load module entry point class org.jboss.errai.ioc.client.Container (see associated exception for details) java.lang.RuntimeException: critical error in IOC container bootstrap at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:69) at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:722) Caused by: java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement() at com.google.gwt.user.client.ui.UIObject.getElement(UIObject.java:527) at org.jboss.errai.ui.shared.TemplateUtil.compositeComponentReplace(TemplateUtil.java:61) at org.jboss.errai.ioc.client.BootstrapperImpl$65$1.init(BootstrapperImpl.java:1623) at org.jboss.errai.ioc.client.BootstrapperImpl$65$1.init(BootstrapperImpl.java:1) at org.jboss.errai.ioc.client.container.CreationalContext.resolveAllProxies(CreationalContext.java:351) at org.jboss.errai.ioc.client.container.CreationalContext.finish(CreationalContext.java:312) at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:59) at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:722)

I've already done mvn clean compile package gwt:run

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

7

It probably means that you use a Composite on which you did not call initWidget(Widget).

Extract of javadoc for Composite

A type of widget that can **wrap** another widget, hiding the wrapped widget's methods.

If you don't call initWidget(), there is no wrapped widget and it leads to this error message.

It also happens if you extends UiObject without calling setElement() but this is a rare usecase.

Arnaud Denoyelle
  • 29,980
  • 16
  • 92
  • 148
  • yeah but looking at the logs the error was thrown within the errai library – quarks Jun 25 '13 at 16:15
  • In my case, I had a component inside of that Composite that wasn't calling initWidget(Widget). Simply adding that call within its default constructor solved the problem. I had assumed that super() would call it for me; it didn't - I have my own UiBinder for that component, maybe that's why. – Glen Pierce Sep 27 '16 at 21:00
  • is possible to check somehow if this initWidget was called before? – kovko Oct 03 '20 at 16:48