2 Replies Latest reply: Dec 22, 2012 10:54 PM by Gilberto Pacheco RSS

Errai fails with GWT 2.5 DevMode

Gilberto Pacheco Newbie

I´ve been using errai 2.2.CR1 on NetBeans 7.2, Glassfish 3.1.2 and GWT 2.5.0. The only thing I did was to add all of the libraries included in the zip.

Whe I directly compile and run apps, it works great, but when launching DevMode I get the following error:

        00:00:48.319 [ERROR] Failed to create an instance of 'org.jboss.errai.ioc.client.Bootstrapper' via deferred binding 

java.lang.NullPointerException: null
     at org.jboss.errai.ioc.client.BootstrapperImpl$12$1.getInstance(BootstrapperImpl.java:145)
     at org.jboss.errai.ioc.client.BootstrapperImpl$12$1.getInstance(BootstrapperImpl.java:1)
     at org.jboss.errai.ioc.client.container.CreationalContext.getSingletonInstanceOrNew(CreationalContext.java:271)
     at org.jboss.errai.ioc.client.BootstrapperImpl$12.getInstance(BootstrapperImpl.java:150)
     at org.jboss.errai.ioc.client.BootstrapperImpl$12.getInstance(BootstrapperImpl.java:1)
     at org.jboss.errai.ioc.client.BootstrapperImpl$14.getInstance(BootstrapperImpl.java:168)
     at org.jboss.errai.ioc.client.BootstrapperImpl$14.getInstance(BootstrapperImpl.java:1)
     at org.jboss.errai.ioc.client.BootstrapperImpl.<init>(BootstrapperImpl.java:173)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
     at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:475)
     at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
     at com.google.gwt.core.shared.GWT.create(GWT.java:57)
     at com.google.gwt.core.client.GWT.create(GWT.java:85)
     at org.jboss.errai.ioc.client.Container.bootstrapContainer(Container.java:55)
     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:406)
     at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)
     at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
     at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
     at java.lang.Thread.run(Thread.java:722)

Is that something to be fixed?

Maybe I'm missing something?

  • 1. Re: Errai fails with GWT 2.5 DevMode
    Jonathan Fuerth Master

    Hi Gilberto,

     

    This stack trace usually indicates that our IoC Bootstrapping code generator failed earlier in the process. Unfortunately, the error messages don't appear on stdout/stderr, so they're easy to miss. Check in the GWT Dev Mode console: go to the 3rd tab (the one that appears when you load the page in your browser) and click on the first line that's coloured red. You should then see the real cause of the error.

     

    Cheers,

    Jonathan

  • 2. Re: Errai fails with GWT 2.5 DevMode
    Gilberto Pacheco Newbie

    Thanks. the stack trace shown before was from Dev Mode console. I opened the generated BootstrapperImpl.java file and realized that the problem was a producer method that generated a Validator instance. It worked OK with the compiler, but something wirth happened with DevMode. I created the following class

     

    @ApplicationScoped

    public class ValidacionCliente {

      private final Validator validador;

      public ValidacionCliente() {

        this.validador = Validation.buildDefaultValidatorFactory().getValidator();

      }

      public <T> void valida(final T objeto, final Class<?>... grupos)

          throws ConstraintViolationException {

        Validacion.valida(validador, objeto, grupos);

      }

    }

     

    and everything was ok.

     

    This was my first Errai App in a long time & never had used BeanValidation with it, so I didn't know woh to use these 2 products together.