1 2 Previous Next 25 Replies Latest reply on Sep 22, 2010 3:05 PM by heiko.braun

    Guice provisioning error on JBoss 6 M4

    heiko.braun

      Jesse wrote:

       

      I'm having another problem with JBoss AS 6.0-M4 deployment. I have a class (http://www.pastebin.org/568839) which I do an jndi lookup on an EJB in the constructor to pass a callback to it. I want to report on system events (import progress in this case) and I'm eventually going to use CDI's event handling mechanism instead of this kind of hack, but last time I checked, CDI integration wasn't in trunk, yet. Is that correct? Anyway, the Guice provision error stack trace: http://www.pastebin.org/568845

       

      Can anyone make sense of that?
        • 1. Re: Guice provisioning error on JBoss 6 M4
          heiko.braun

          From what I can tell it boils down to:

           

           

          1. Caused by: java.lang.RuntimeException: Error getting endpoint out of container KernelControllerContext UnmodifiableKernelControllerContext@3c4d63d0{}
          2.         at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler.getInstalledEndpoint(NoInterfaceViewInvocationHandler.java:185)[:1.0.0-alpha-6]
          3.         at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler.invoke(NoInterfaceViewInvocationHandler.java:143)[:1.0.0-alpha-6]
          4.         at org.jboss.ejb3.proxy.javassist.JavassistInvocationHandlerAdapter.invoke(JavassistInvocationHandlerAdapter.java:71) [:1.0.0-alpha-1]
          5.         at com.company.foo.ejb.ImportProgressNotifier_$$_javassist_17.setDispatcher(ImportProgressNotifier_$$_javassist_17.java) [:]
          6.         at com.company.foo.gwt.server.errai.ImportProgressService.<init>(ImportProgressService.java:41) [:]
          7.         at com.company.foo.gwt.server.errai.ImportProgressService$$FastClassByGuice$$4a938184.newInstance(<generated>)
          8.         at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40) [:]
          9.         at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) [:]
          10.         at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85) [:]
          11.         at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) [:]
          12.         at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758) [:]
          13.         at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) [:]
          14.         at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754) [:]
          15.         ... 83 more
          16. Caused by: java.lang.UnsupportedOperationException: Cannot invoke set on unmodifiable wrapper.
          17.         at org.jboss.dependency.spi.helpers.UnmodifiableControllerContext.setRequiredState(UnmodifiableControllerContext.java:149) [jboss-dependency.jar:2.2.0.Alpha10]
          18.         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:936) [jboss-dependency.jar:2.2.0.Alpha10]
          19.         at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.Alpha10]
          20.         at org.jboss.ejb3.nointerface.impl.invocationhandler.NoInterfaceViewInvocationHandler.getInstalledEndpoint(NoInterfaceViewInvocationHandler.java:178)[:1.0.0-alpha-6]
          • 2. Re: Guice provisioning error on JBoss 6 M4
            heiko.braun

            Digging a little further:

             

            1. com.company.foo.ejb.ImportProgressNotifier_$$_javassist_17.setDispatcher(ImportProgressNotifier_$$_javassist_17.java) [:]
            2.         at com.company.foo.gwt.server.errai.ImportProgressService.<init>(ImportProgressService.java:41) [:]
            3.         at com.company.foo.gwt.server.errai.ImportProgressService$$FastClassByGuice$$4a938184.newInstance(<generated>)
            4.         at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40) [:]
            5.         at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60) [:]
            6.         at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85) [:]
            7.         at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) [:]
            8.         at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758) [:]
            9.         at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) [:]
            10.         at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754) [:]
            11.         ... 83 more
            12. Caused by: java.lang.UnsupportedOperationException: Cannot invoke set on unmodifiable wrapper.
            • 3. Re: Guice provisioning error on JBoss 6 M4
              heiko.braun

              What does the ImportProgressNotifier EJB look like?

              • 4. Re: Guice provisioning error on JBoss 6 M4
                jhutton
                • 5. Re: Guice provisioning error on JBoss 6 M4
                  jhutton

                  With 1.1-CR1 I'm seeing a provision error in Glassfish as well.

                   

                  [#|2010-08-20T16:56:18.694-0400|INFO|glassfish3.0.1|org.jboss.errai.bus.server.service.bootstrap.LoadExtensions|_ThreadID=29;_ThreadName=Thread-1;|total extension binding: 1|#]
                  
                  [#|2010-08-20T16:56:18.695-0400|SEVERE|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=29;_ThreadName=http-thread-pool-8080-(1);|WebModule[/myApp]StandardWrapper.Throwable
                  com.google.inject.ProvisionException: Guice provision errors:
                  
                  1) Error injecting constructor, java.lang.RuntimeException: Bootstrap failed
                    at org.jboss.errai.bus.server.service.ErraiServiceImpl.(ErraiServiceImpl.java:50)
                    while locating org.jboss.errai.bus.server.service.ErraiServiceImpl  while locating org.jboss.errai.bus.server.service.ErraiService
                  1 error
                       at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:767)
                       at com.google.inject.InjectorImpl.getInstance(InjectorImpl.java:789)
                       at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.buildService(AbstractErraiServlet.java:96)
                       at org.jboss.errai.bus.server.servlet.AbstractErraiServlet.init(AbstractErraiServlet.java:80)
                       at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1428)
                       at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1073)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
                       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
                       at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
                       at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
                       at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
                       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
                       at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
                       at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
                       at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
                       at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
                       at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
                       at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
                       at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
                       at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
                       at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
                       at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
                       at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
                       at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
                       at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
                       at java.lang.Thread.run(Thread.java:619)
                  Caused by: java.lang.RuntimeException: Bootstrap failed
                       at org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap.execute(OrderedBootstrap.java:67)
                       at org.jboss.errai.bus.server.service.ErraiServiceImpl.boostrap(ErraiServiceImpl.java:60)
                       at org.jboss.errai.bus.server.service.ErraiServiceImpl.(ErraiServiceImpl.java:54)
                       at org.jboss.errai.bus.server.service.ErraiServiceImpl$$FastClassByGuice$$7879947c.newInstance()
                       at com.google.inject.internal.cglib.reflect.FastConstructor.newInstance(FastConstructor.java:40)
                       at com.google.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
                       at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:85)
                       at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111)
                       at com.google.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
                       at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:811)
                       at com.google.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
                       at com.google.inject.Scopes$1$1.get(Scopes.java:54)
                       at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48)
                       at com.google.inject.FactoryProxy.get(FactoryProxy.java:56)
                       at com.google.inject.InjectorImpl$4$1.call(InjectorImpl.java:758)
                       at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804)
                       at com.google.inject.InjectorImpl$4.get(InjectorImpl.java:754)
                       ... 28 more
                  Caused by: java.lang.IllegalStateException: can not modify the task manager once it's been initialized
                       at org.jboss.errai.bus.client.api.base.TaskManagerFactory.setTaskManagerProvider(TaskManagerFactory.java:49)
                       at org.jboss.errai.bus.server.service.bootstrap.DefaultResources.execute(DefaultResources.java:53)
                       at org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap.execute(OrderedBootstrap.java:54)
                       ... 44 more
                  |#]
                  
                  (repeated a few times)...
                  
                  [#|2010-08-20T16:56:38.413-0400|INFO|glassfish3.0.1|org.jboss.errai.bus.server.service.bootstrap.OrderedBootstrap|_ThreadID=30;_ThreadName=Thread-1;|Bootstrap Errai|#]
                  
                  
                  • 6. Re: Guice provisioning error on JBoss 6 M4
                    heiko.braun

                    You want to use the CDI extension, right?

                    In that case two config options need to be set correctly

                     

                    1.) Servlet init-param (jndiName)

                    2.) ErraisService property (auto_scan)

                     

                     

                    1) The init-param tells the servlet service where to locate the Errai Service

                    (Must be installed as a container service, provided for JBoss. Needs to be implemented for glassfish)

                     

                    [...] 
                    <servlet>
                            <servlet-name>ErraiServlet</servlet-name>
                            <servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
                            <init-param>
                                <param-name>jndiName</param-name>
                                <param-value>java:/Errai</param-value>
                            </init-param>
                            <load-on-startup>1</load-on-startup>
                        </servlet>
                    [...]
                    

                     

                     

                    2) Since the service is installed a shared component and component discovery delegated to the CDI container,

                    you need to tell errai not to run the auto discovery.

                     

                    ErraiService.properties:
                    
                    #
                    # Disable service auto discovery
                    # It's the CDI container responsibility
                    #
                    errai.auto_discover_services=false
                                            
                    
                    

                     

                     

                    One general thing. I would suggest we try to make it run on JBoss first, because it's act's as the reference for the CDI integration.

                    Once this works, we can talk about other containers.

                    • 7. Re: Guice provisioning error on JBoss 6 M4
                      heiko.braun

                      You can consult configuration files the CDI archetype creates, for all required configuration changes.

                      • 8. Re: Guice provisioning error on JBoss 6 M4
                        jhutton

                        Heiko,

                         

                        Just to follow up, I didn't create my app with an errai archetype, but I did reference one when getting errai integrated. M2 has been working well for me in Glassfish, but I'm getting the error above with CR1.

                         

                        I tried pulling in bits from the CDI archetype to get that running, but have not been successful. Even compiling the CDI archetype with no changes (with the jboss6 profile) and deploying to JBoss fails with this error: http://pastebin.org/750022

                         

                        I'm not so much in need of the whole CDI + client integration thing. All I really want is to be able to access my @Service classes (or the ErraiBus itself) from some of my other backend components: ejbs or managed beans. BTW, are there lifecycle callbacks, eg. @PostConstruct, for @Service classes? If so, that might help me work around the original Guice provisioning error I was getting with JBoss. However, I think there are bigger problems, because as I said, I'm getting the provisioning error with Glassfish and CR1, and that's even if I comment out all the initialization code in my service classes.

                         

                        One final data point regarding this: Installing a vanilla errai archetype (referencing the CR1 docs), ie no cdi, compiling and packaging with no changes at all gets me this on JBoss 6 M4: http://pastebin.org/750775.

                         

                        Jesse

                        • 9. Re: Guice provisioning error on JBoss 6 M4
                          heiko.braun

                          Jesse, thanks for the follow up.

                           

                          What OS / JDK Version are you using?

                          • 10. Re: Guice provisioning error on JBoss 6 M4
                            jhutton

                            By day, I'm using Fedora 12 with Sun's JDK 1.6.0_20. Last night, I installed JBoss 6 M4 on Fedora 13 with I think 1.6.0_21, and I got the same error with the CDI archetype. With the regular archetype, I didn't see the provision error, but the app didn't seem to deploy all the way. There would be a line about the context path, then a few errors regarding duplicate slf4j bindings, and then that's it: no errai bootstrap stuff.

                            • 11. Re: Guice provisioning error on JBoss 6 M4
                              heiko.braun

                              Try the most recent trunk. It should be fixed now.

                              If that's the case I might do another CR2.

                               

                              /Heiko

                              • 12. Re: Guice provisioning error on JBoss 6 M4
                                jhutton

                                Heiko,

                                 

                                With the current trunk (revision 1917) the archetypes are still not working working for me. With the standard one I get http://pastie.org/1112405, and with CDI (I rebuilt that branch too) I get http://pastie.org/1112413.

                                 

                                Jesse

                                • 13. Re: Guice provisioning error on JBoss 6 M4
                                  heiko.braun

                                  Just to make I did nuke my local maven repo and created a project from the quickstart archeytpe. It deploys without any problems.

                                  AFAIK the most recent SNAPSHOT was build from -r1921.

                                   

                                  Even though it takes sometime to rebuild, I would suggest you do the same.

                                  Otherwise try with 'mvn -U' (force updates)

                                  • 14. Re: Guice provisioning error on JBoss 6 M4
                                    jhutton

                                    Heiko,

                                     

                                    I just tried the quickstart archetype after again updating trunk (now at -r 1921), and still no success: http://pastie.org/1114011. Also, this is a recently installed OS (F13) so there was practically nothing in the maven repo. Just to be sure, I also tried building errai with mvn -U install. Same result.

                                     

                                    Can anyone else test this with some version of Linux and a recent Sun JDK to at least confirm the problem or tell me that I'm out of my mind?

                                     

                                    Jesse

                                    1 2 Previous Next