1 2 Previous Next 28 Replies Latest reply on Jan 25, 2010 10:10 AM by Celinio Fernandes

    Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1

    Celinio Fernandes Novice

      Hi,
      I am trying to run a basic example.
      My JBOSS 6 M1 server starts but i see an error in the logs when I add the file WEB-INF/beans.xml  :


      15:29:11,323 INFO  [Weld/Version] WELD-000900 1.0 (0)
      15:29:11,805 ERROR [AbstractKernelController] Error installing to Create: name=vfszip:/K:/blabla/jboss-6.0.0.M1/server/default/deploy/VenteEnLigne.ear/_WeldBootstrapBean state=Configured
      java.lang.NullPointerException
              at org.jboss.weld.ejb.InternalEjbDescriptor.<init>(InternalEjbDescriptor.java:48)
              at org.jboss.weld.ejb.EjbDescriptors.add(EjbDescriptors.java:111)
              at org.jboss.weld.ejb.EjbDescriptors.addAll(EjbDescriptors.java:166)
              at org.jboss.weld.bootstrap.BeanDeployment.<init>(BeanDeployment.java:78)
              at org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:197)
              at org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:174)
              at org.jboss.weld.bootstrap.WeldBootstrap.startContainer(WeldBootstrap.java:295)
              at org.jboss.weld.integration.deployer.env.helpers.BootstrapBean.initialize(BootstrapBean.java:136)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
              at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
              at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:243)
              at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:111)
              at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
              at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
              at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
              at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
              at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
              at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
              at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:775)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
              at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
              at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
              at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
              at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1448)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1166)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1187)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1107)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:823)
              at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
              at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:783)
              at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
              at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
              at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
              at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
              at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
              at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)
              at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:935)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1083)
              at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:985)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:775)
              at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
              at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
              at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:258)
              at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:97)
              at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:860)
              at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:441)
              at java.lang.Thread.run(Unknown Source)





      Any idea ? Thanks




        • 1. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
          Celinio Fernandes Novice

          More log, when i try to test the webapp. The only thing i did was adding a beans.xml file.


          java.lang.IllegalArgumentException: Unable to find BeanManager. ServletContext: org.apache.catalina.core.ApplicationContextFacade@169b696
               at org.jboss.weld.servlet.ServletHelper.getModuleBeanManager(ServletHelper.java:40)
               at org.jboss.weld.jsf.JsfHelper.getModuleBeanManager(JsfHelper.java:115)
               at org.jboss.weld.jsf.WeldPhaseListener.initiateSessionAndConversation(WeldPhaseListener.java:168)
               at org.jboss.weld.jsf.WeldPhaseListener.beforeRestoreView(WeldPhaseListener.java:118)
               at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:87)
               at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
               at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
               at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:68)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
               at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
               at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Unknown Source)
          



          • 3. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
            John Ament Master

            You have to give it more than an hour, it is a pretty small community.


            What have you put beans.xml? Just in WEB-INF?  In your EJB jars, is there also one in META-INF?

            • 4. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
              Celinio Fernandes Novice

              Thanks for helping.
              I am pretty new with CDI and Weld.


              The file beans.xml is empty.
              There is only one file beans.xml in my EAR enterprise application (Web project and EJB project, using Eclipse) and it is located in the (Web project)/WEB-INF folder of course.
              No beans.xml inside my (EJB project)/META-INF folder.  Does the EJB project also need one ?

              • 5. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                Gavin King Master

                Celinio Fernandes wrote on Dec 30, 2009 17:32:


                Thanks for helping.
                I am pretty new with CDI and Weld.

                The file beans.xml is empty.
                There is only one file beans.xml in my EAR enterprise application (Web project and EJB project, using Eclipse) and it is located in the (Web project)/WEB-INF folder of course.
                No beans.xml inside my (EJB project)/META-INF folder.  Does the EJB project also need one ?


                Well, where are your bean classes?



                What else is in your EAR?

                • 6. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                  Arbi Sookazian Master

                  Yes, exactly.  You need to be more specific when asking for help.  We can't help if we don't know what's in your EAR.


                  Try this as well, I did yesterday and it works very well to get started quickly.

                  • 7. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                    Celinio Fernandes Novice

                    Well,
                    here is the content (only the relevant parts) :




                    jar -tf VenteEnLigne.ear : 
                    
                    
                    META-INF/
                    META-INF/MANIFEST.MF
                    META-INF/application.xml
                    VenteEnLigneClient.jar
                    VenteEnLigneEJB.jar
                    VenteEnLigneWeb.war
                    VenteEnLigneWebJSF2.war
                    VenteEnLigneWebStruts2.war
                    
                    jar -tf VenteEnLigneWebJSF2.war (Web app where i put my beans.xml. The POJO is MessageServerBean but 
                    whether it is there or not, i get the same error) :
                    
                    index.html
                    index.xhtml
                    login/
                    login/login.xhtml
                    META-INF/
                    META-INF/MANIFEST.MF
                    WEB-INF/
                    WEB-INF/classes/
                    WEB-INF/classes/com/
                    WEB-INF/classes/com/eni/
                    WEB-INF/classes/com/eni/dvtejb/
                    WEB-INF/classes/com/eni/dvtejb/clientJSF2/
                    WEB-INF/classes/com/eni/dvtejb/clientJSF2/beans/
                    WEB-INF/classes/com/eni/dvtejb/clientJSF2/beans/LoginBean.class
                    WEB-INF/classes/com/eni/dvtejb/clientJSF2/listeners/
                    WEB-INF/classes/com/eni/dvtejb/clientJSF2/pojos/
                    WEB-INF/classes/com/eni/dvtejb/clientJSF2/pojos/MessageServerBean.class
                    WEB-INF/beans.xml
                    WEB-INF/faces-config.xml
                    WEB-INF/lib/
                    WEB-INF/web.xml
                    
                    jar -tf  VenteEnLigneEJB.jar
                    
                    META-INF/
                    META-INF/MANIFEST.MF
                    META-INF/orm.xml
                    META-INF/persistence.xml
                    com/eni/dvtejb/metier/entities/Administrateur.class
                    com/eni/dvtejb/metier/mdb/MailConfirmationMdbBean.class
                    com/eni/dvtejb/metier/sessions/AdresseDAO.class
                    com/eni/dvtejb/metier/sessions/AdresseDAOImpl.class
                    com/eni/dvtjeb/metier/interceptors/AdresseEmailException.class"
                    
                    



                    Any idea now ? Thanks.

                    • 8. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                      John Ament Master

                      If you're expecting anything in VenteEnLigneEJB.jar to be exposed via CDI, you need a beans.xml in META-INF.

                      • 9. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                        Celinio Fernandes Novice

                        John Ament wrote on Dec 30, 2009 20:37:


                        If you're expecting anything in VenteEnLigneEJB.jar to be exposed via CDI, you need a beans.xml in META-INF.


                        Good to know. At the moment I don't but i will.
                        Also, I tried to add a beans.xml file under


                        (VenteEnLigneEJB)/META_INF



                        , it did not fix anything.


                        I am clueless. Any other suggestion ? Thanks.

                        • 10. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                          Nicklas Karlsson Master

                          It appears to come from the line


                          Iterator<BusinessInterfaceDescriptor<?>> it = ejbDescriptor.getLocalBusinessInterfaces().iterator();



                          This could happen if getLocalBusinessInterfaces() returns null (in this case it's a bug or at least a bit blunt since an empty collection would be more appropriate). How does your EJB:s look interface-wise?

                          • 11. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                            Celinio Fernandes Novice

                            good question i guess and you might be pointing to the cause of the problem.
                            Most of my session beans have remote interfaces, no local interfaces.


                            I'm using EJB 3.0 ...


                            you think that's the problem ?

                            • 12. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                              John Ament Master

                              Well, if you're using a Remote interface, then the implication is that all clients will connect to your EJBs will connect remotely, from an external system.  Is this in fact the case?  What about inter-EJB uses?  If so, what kind of use case are you looking at with using CDI; as far as I am aware, the CDI modules are not remote aware (you can't inject into a remote object; that lives somewhere outside of the current app server).

                              • 13. Re: Weld and EJB 3.0 and JSF 2.0 and JBoss 6 M1
                                Celinio Fernandes Novice

                                They're remote interfaces because i plan to use them remotely indeed.


                                Right now, I just want to experiment CDI in my JSF 2.0 client. With and without session beans calls.


                                I could try to systematically add local interfaces to all my EBJs if that could fix it. What do you think ?


                                I guess EJB 3.0 with CDI is not the best option. Too bad JBoss 6 is not supporting EJB 3.1 yet.

                                1 2 Previous Next