7 Replies Latest reply on Sep 3, 2013 4:05 PM by nva

    Error injecting a BatchCaller (3.0-SNAPSHOT)

    nva

      When trying to inject the BatchCaller into my constructor, I get the following error:

       

      Error injecting org.jboss.errai.common.client.api.BatchCaller: Unable to create or inherit binding: No @Inject or default constructor found for org.jboss.errai.common.client.api.BatchCaller

       

      It's a simple constructor injection, like this:

       

      @Inject

      public A(BatchCaller bacthCaller) {

          ...

      }

       

      Am I missing a provider binding?

       

      Thanks!

       

      Cheers,

       

      V.

        • 1. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
          csa

          Hi Valentin,

           

          This seems to work fine for me. Do you have the errai-ioc-bus-support.jar on the classpath? Also make sure you inherit its GWT module:

           

          <inherits name="org.jboss.errai.ioc.support.bus.BusSupport" />

           

          Cheers,

          Christian

          • 2. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
            nva

            Hi Christan, thanks, I didn't have these dependencies. Added them, but am still getting the same error. I just upgraded the project from 2.4 to 3.0, primarily so that I can use the BatchCaller. Am sure than I'm missing another dependency. What else could it be?

             

            Errai inherits in the GWT module:

            <inherits name="org.jboss.errai.bus.ErraiBus"/>
            <inherits name="org.jboss.errai.ioc.Container"/>
            <inherits name="org.jboss.errai.ioc.support.bus.BusSupport" />
            <inherits name="org.jboss.errai.marshalling.ErraiMarshalling" />

             

            Errai components in the pom:

            - errai-bus

            - errai-ioc

            - errai-ioc-bus-support

            - errai-uibinder

            - errai-tools

             

            (I'm not using CDI, mainly because it was/is conflicting with GWTP. Maybe the new GWTP 1.0.1 will help, but have to sort out some upgrade problems there first.)

             

            Many thanks!

             

            Cheers,

             

            V.

            • 3. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
              edewit

              Hi Valentin,

               

              Could you post an example project so we can reproduce your problem?

               

              Cheers,

                   Erik Jan

              • 4. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
                nva

                Hello Erik Jan, will try. The actual project is quite large, will have to reproduce the configuration and carve out the relevant bits. Will take some time.

                 

                I still believe that I'm most probably missing a dependency or a configuration in the 2.4 to 3.0 migration.

                 

                Interestingly, the problem I run into with the GWTP upgrade from 0.7 to 1.0.1 is very similar. There the generated code in the Bootstrapper calls a default constructor that no longer exists. It's like I'm missing a provider there somehow.

                 

                Cheers,

                 

                V.

                • 5. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
                  nva

                  As a workaround I added the provider binding in my gin module like this:

                   

                  bind(BatchCaller.class).toProvider(BatchCallerProvider.class);

                   

                  Now I can inject the BatchCaller. Is this the intended usage?

                  • 6. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
                    edewit

                    If you don't use Errai-CDI but Guice you'll have to do it like that

                    1 of 1 people found this helpful
                    • 7. Re: Error injecting a BatchCaller (3.0-SNAPSHOT)
                      nva

                      Cool, thanks. I'm not using CDI currently.