7 Replies Latest reply: Dec 15, 2012 9:28 AM by Charles Odili RSS

    Errai Deferred Binding Failure

    Charles Odili Apprentice

      I created a standard GWT project with Google Plugin for Eclipse (don't know how to use meaven, and it gave errors too), then I downloaded errai-2.2.0.CR1.zip from http://www.jboss.org/errai/Downloads, extracted it and added it (all the packages in lib folder, and dependencies in deps folder) to the GWT project's build path.

      I imported the following modules in my gwt module file

      • org.jboss.errai.common.ErraiCommon
      • org.jboss.errai.bus.ErraiBus
      • org.jboss.errai.ioc.Container
      • org.jboss.errai.enterprise.CDI
      • org.jboss.errai.databinding.DataBinding

       

      And my code is standard GWT code. A class that implements EntryPoint, has onModuleLoad() method, which just has one line of code to display and alert : {code}Window.alert("Errai Is Running Now!");{code}

      The project however does not run for the following reasons :

       

      Deferred binding failed for 'org.jboss.errai.ioc.client.Bootstrapper' (did you forget to inherit a required module?)

       

      Did I forget to inherit a required module?

        • 1. Re: Errai Deferred Binding Failure
          Christian Sadilek Master

          Hi,

           

          Can you post the full stacktrace of the exception thrown (should be on your console). One thing you need is an ErraiApp.properties file on the root of your classpath: https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties

           

          Cheers,

          Christian

          • 2. Re: Errai Deferred Binding Failure
            Charles Odili Apprentice

            [WARN] Error for /out.91958-3446.erraiBus

            java.lang.ExceptionInInitializerError

                      at org.jboss.errai.bus.server.io.MessageFactory.getParts(MessageFactory.java:109)

                      at org.jboss.errai.bus.server.io.MessageFactory.createCommandMessage(MessageFactory.java:93)

                      at org.jboss.errai.bus.server.servlet.JettyContinuationsServlet.doPost(JettyContinuationsServlet.java:77)

                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

                      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

                      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

                      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

                      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)

                      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

                      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

                      at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)

                      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

                      at org.mortbay.jetty.Server.handle(Server.java:324)

                      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

                      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)

                      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)

                      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

                      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

                      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

                      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

            Caused by: java.lang.RuntimeException: critical problem loading the marshallers

                      at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:78)

                      ... 22 more

            Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.errai.marshalling.rebind.DefinitionsFactorySingleton

                      at org.jboss.errai.marshalling.server.MappingContextSingleton$4.<init>(MappingContextSingleton.java:176)

                      at org.jboss.errai.marshalling.server.MappingContextSingleton.loadDynamicMarshallers(MappingContextSingleton.java:175)

                      at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:73)

                      ... 22 more

            [WARN] Nested in java.lang.ExceptionInInitializerError:

            java.lang.RuntimeException: critical problem loading the marshallers

                      at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:78)

                      at org.jboss.errai.bus.server.io.MessageFactory.getParts(MessageFactory.java:109)

                      at org.jboss.errai.bus.server.io.MessageFactory.createCommandMessage(MessageFactory.java:93)

                      at org.jboss.errai.bus.server.servlet.JettyContinuationsServlet.doPost(JettyContinuationsServlet.java:77)

                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

                      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

                      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

                      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

                      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

                      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)

                      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

                      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

                      at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)

                      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

                      at org.mortbay.jetty.Server.handle(Server.java:324)

                      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

                      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)

                      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)

                      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

                      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

                      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

                      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

            Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.errai.marshalling.rebind.DefinitionsFactorySingleton

                      at org.jboss.errai.marshalling.server.MappingContextSingleton$4.<init>(MappingContextSingleton.java:176)

                      at org.jboss.errai.marshalling.server.MappingContextSingleton.loadDynamicMarshallers(MappingContextSingleton.java:175)

                      at org.jboss.errai.marshalling.server.MappingContextSingleton.<clinit>(MappingContextSingleton.java:73)

                      ... 22 more

            [ERROR] 500 - POST /out.91958-3446.erraiBus?z=0 (127.0.0.1) 8410 bytes

               Request headers

                  Host: 127.0.0.1:8888

                  User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0

                  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

                  Accept-Language: en-us,en;q=0.5

                  Accept-Encoding: gzip, deflate

                  Connection: keep-alive

                  Referer: http://127.0.0.1:8888/MyErrai.html?gwt.codesvr=127.0.0.1:9997

                  RemoteQueueID: 91958-3446

                  phase: connection

                  Content-Type: application/json; charset=utf-8

                  Content-Length: 82

                  Pragma: no-cache

                  Cache-Control: no-cache

               Response headers

                  Set-Cookie: JSESSIONID=1flrcwmz0v6wr;Path=/

                  Content-Type: text/html; charset=iso-8859-1

                  Content-Length: 8410

            java.lang.RuntimeException: Deferred binding failed for 'org.jboss.errai.ioc.client.Bootstrapper' (did you forget to inherit a required module?)

                      at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)

                      at com.google.gwt.core.client.GWT.create(GWT.java:97)

                      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: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: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)

                      at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503)

                      at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)

                      ... 12 more

            • 3. Re: Errai Deferred Binding Failure
              Christian Sadilek Master

              OK there are dependencies missing from your server runtime-classpath. Can you check that you have errai-common, errai-config, and guava 12 on your server classpath. Missing any of those would cause the problem you're seeing.

              • 4. Re: Errai Deferred Binding Failure
                Charles Odili Apprentice

                I copied all the Errai jars from the lib and desp/lib folder into my war/WEB-INF/lib folder, refreshed the project and ran it again. This is what I got :

                 

                3646 [Thread-15] INFO org.jboss.errai.reflections.Reflections - Reflections took 3479 ms to scan 13 urls, producing 372 keys and 1717 values [using 2 cores]

                4525 [main] INFO org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap - starting errai bus ...

                4530 [main] INFO org.jboss.errai.bus.server.service.bootstrap.DefaultComponents - using dispatcher implementation: org.jboss.errai.bus.server.AsyncDispatcher

                4556 [main] INFO org.jboss.errai.bus.server.service.bootstrap.DefaultComponents - using session provider implementation: org.jboss.errai.bus.server.HttpSessionProvider

                4605 [main] INFO org.jboss.errai.bus.server.service.bootstrap.LoadExtensions - searching for errai extensions ...

                4630 [main] INFO org.jboss.errai.bus.server.service.bootstrap.LoadExtensions - found extension org.jboss.errai.tools.monitoring.MonitorExtension

                4766 [main] INFO org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap - errai bus started.

                SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

                SLF4J: Defaulting to no-operation (NOP) logger implementation

                SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

                110055 [btpool0-0] WARN ErraiMarshalling - could not locate marshaller class.

                110055 [btpool0-0] WARN ErraiMarshalling - using dynamic marshallers. dynamic marshallers are designed for development mode testing, and ideally should not be used in production. *

                java.lang.RuntimeException: Deferred binding failed for 'org.jboss.errai.ioc.client.Bootstrapper' (did you forget to inherit a required module?)

                  at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)

                  at com.google.gwt.core.client.GWT.create(GWT.java:97)

                  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: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: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)

                  at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:503)

                  at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)

                • 5. Re: Errai Deferred Binding Failure
                  Charles Odili Apprentice

                  I also attempted the helloworld errai sample from the Project Examples in JBoss Central. I downloaded and setup the project quite alright, but there's an error from pom.xml saying :

                   

                  ArtifactTransferException: Failure to transfer javax.validation:validation-api:jar:sources:1.0.0.GA from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact javax.validation:validation-api:jar:sources:1.0.0.GA from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

                  • 6. Re: Errai Deferred Binding Failure
                    Christian Sadilek Master

                    Hi Charles,

                     

                    The latter is a maven issue that should be resolvable by specifying the -U command line parameter (e.g. mvn clean install -U) to force an update of the dependencies.

                     

                    The good thing is that the server-side problem is gone now. The deferred binding issue remains. I would expect there to be more error information though (e.g. in the DevMode console). If there is nothing more, can you attach or share this project somewhere so we can take a look?

                     

                    I assume you do have an ErraiApp.properties in src/main/javaa or src/main/resources, right?

                     

                    Cheers,

                    Christian

                    • 7. Re: Errai Deferred Binding Failure
                      Charles Odili Apprentice

                      Instead of trying to do thins my way (avoiding the maven stuff), I decided to use JBoss Developer Studio 6, and here's how it has been : https://community.jboss.org/thread/215716?tstart=0