1 2 Previous Next 19 Replies Latest reply on Jun 8, 2009 4:02 PM by cpopetz

    WebBeans on JBoss AS 5.1

    meetoblivion

      I can't tell if this belongs in the JBoss As 5 forum or not.  But let's throw it here and see what happens.


      I get the following exception during deployment.  I do have webbeans in my archive (the ejb jar) but no beans.xml.  I don't particularly see a reason why it would be failing.  Maybe I should update the webbeans impl? Any ideas how?  Thanks!



      09:58:55,864 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/ state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error deploying: vfszip:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/
           at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
           at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:136)
           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.deploy(AbstractRealDeployerWithInput.java:125)
           at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.deployComponents(AbstractComponentDeployer.java:102)
           at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.internalDeploy(AbstractComponentDeployer.java:82)
           at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
           at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
           at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
           at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
           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:361)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
           at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
           at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
           at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
           at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
           at org.jboss.Main.boot(Main.java:221)
           at org.jboss.Main$1.run(Main.java:556)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.IllegalArgumentException: Exception loading class for ScopeKey addition.
           at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:67)
           at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126)
           ... 34 more
      Caused by: java.lang.ClassNotFoundException: org.jboss.webbeans.bootstrap.WebBeansBootstrap from BaseClassLoader@54012da5{VFSClassLoaderPolicy@195bd6b9{name=vfszip:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/ domain=ClassLoaderDomain@34883357{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@761a626f} roots=[MemoryContextHandler@1550719152[path= context=vfsmemory://4sg3s5y-fpl3q6-fv83pc2k-1-fv83pwcl-2n real=vfsmemory://4sg3s5y-fpl3q6-fv83pc2k-1-fv83pwcl-2n], DelegatingHandler@1075247672[path=ImageServer.ear context=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ real=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear], DelegatingHandler@612733799[path=ImageServer.ear/imageserver-ejb.jar context=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ real=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/imageserver-ejb.jar]]  delegates=null exported=[web.images.server.web, web.images.db, web.images.utils, web.images.server.utils, web.images.db.dao, META-INF] <IMPORT-ALL>NON_EMPTY}}
           at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
           at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:63)
           ... 35 more
      09:58:56,157 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS IN ERROR:
        Deployment "vfszip:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.jboss.webbeans.bootstrap.WebBeansBootstrap from BaseClassLoader@54012da5{VFSClassLoaderPolicy@195bd6b9{name=vfszip:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/ domain=ClassLoaderDomain@34883357{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@761a626f} roots=[MemoryContextHandler@1550719152[path= context=vfsmemory://4sg3s5y-fpl3q6-fv83pc2k-1-fv83pwcl-2n real=vfsmemory://4sg3s5y-fpl3q6-fv83pc2k-1-fv83pwcl-2n], DelegatingHandler@1075247672[path=ImageServer.ear context=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ real=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear], DelegatingHandler@612733799[path=ImageServer.ear/imageserver-ejb.jar context=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ real=file:/opt/jboss/jboss-5.1.0.GA/server/all/deploy/ImageServer.ear/imageserver-ejb.jar]]  delegates=null exported=[web.images.server.web, web.images.db, web.images.utils, web.images.server.utils, web.images.db.dao, META-INF] <IMPORT-ALL>NON_EMPTY}}



        • 1. Re: WebBeans on JBoss AS 5.1
          nickarls

          We'll have to check with Pete if he has updated the deployers for 5.1

          • 2. Re: WebBeans on JBoss AS 5.1
            meetoblivion

            It was working fine in CR1 as a pure WAR deployment (without a webbeans rebuild).  Let me try to make it a WAR file instead of an EAR and see what happens.  Also, would it be getting confused because my single jar file has persistence in it as well?

            • 3. Re: WebBeans on JBoss AS 5.1
              meetoblivion

              so apparently the issue was that I was missing commons-digester.  I only got that error once I converted to war deployment and tried to deploy.  weird that ear deployment didn't give that error.

              • 4. Re: WebBeans on JBoss AS 5.1
                meetoblivion

                apparently, I get to eat my words.  Still not deploying as an ear. grrr.

                • 5. Re: WebBeans on JBoss AS 5.1
                  meetoblivion

                  It looks like there's some discrepancies in where to put beans.xml depending on your deployment type.


                  For war file, it has to be WEB-INF.  It cannot be in a JAR file.  That seems annoying, especially if I'm trying to make something that can run on multiple containers.


                  For EJB, it seems like it has to be in the ejb module.   I guess you can only have 1 ejb module in this case?

                  • 6. Re: WebBeans on JBoss AS 5.1
                    pmuir

                    John Ament wrote on Jun 01, 2009 16:05:


                    It looks like there's some discrepancies in where to put beans.xml depending on your deployment type.

                    For war file, it has to be WEB-INF.  It cannot be in a JAR file.  That seems annoying, especially if I'm trying to make something that can run on multiple containers.

                    For EJB, it seems like it has to be in the ejb module.   I guess you can only have 1 ejb module in this case?


                    You can put beans.xml in any jar or war that you want 299-enabled. If this isn't the case, please file an issue in JIRA.


                    You saying I do have webbeans in my archive (the ejb jar) but no beans.xml. concerns me somewhat. Do you mean you have the Web Beans jars in the archive? This doesn't work.

                    • 7. Re: WebBeans on JBoss AS 5.1
                      meetoblivion

                      Pete,


                      I haven't fully tested it, as I've got a few oddities I'm seeing.  So far, I haven't gotten an ear deployment to work, and looking at the examples it appears that the examples show it in META-INF for the JAR file.  If I can confirm I'll file a JIRA.


                      As for what I have, no I'm not including the jar files.  Sorry it wasn't clear, just meant that I have classes that are decorated.

                      • 8. Re: WebBeans on JBoss AS 5.1
                        meetoblivion

                        Just reading this line over again.  and looking at my other issue(s)...




                        You can put beans.xml in any jar or war that you want 299-enabled. If this isn't the case, please file an issue in JIRA.

                        But then, what about ear files?  Where should the beans.xml file go?  or does it have to go into each JAR file i create and each war file i create?

                        • 9. Re: WebBeans on JBoss AS 5.1
                          meetoblivion

                          So, i guess that was the issue, at some level or another.


                          I added beans.xml to both WEB-INF in my war and META-INF in my jar.  I have a feeling only the JAR one is required.


                          That still didn't work 100%.  I got back to my other error about improper dependencies.  I converted by DAOs to stateful EWB's and that allowed everyting to run correctly.  Very, very weird.  Is that the expected behavior?

                          • 10. Re: WebBeans on JBoss AS 5.1
                            gavin.king
                            But then, what about ear files?  Where should the beans.xml file go?  or does it have to go into each JAR file i create and each war file i create?


                            Into every one that has beans you want to inject using 299.

                            • 11. Re: WebBeans on JBoss AS 5.1
                              gavin.king

                              Do you mean you have the Web Beans jars in the archive? This doesn't work.

                              Yeah, you can't package jars inside of other jars, not even EJB jars.


                              You can only package them in the lib dir of an ear or the WEB-INF/lib dir of a war.

                              • 12. Re: WebBeans on JBoss AS 5.1
                                meetoblivion

                                like I said, i was by no means trying to introduce some kind of odd packaging strategy.


                                anyways, is the behavior i got expected? why do my DAOs need to be EWB if they're being injected into other beans, instead of into a JSF view?

                                • 13. Re: WebBeans on JBoss AS 5.1
                                  pmuir

                                  Right, but you can't put Web Beans itself in the WAR or the EAR if you are using something like JBoss AS, which has Web Beans built in.

                                  • 14. Re: WebBeans on JBoss AS 5.1
                                    meetoblivion

                                    But, I'm not attempting to do that at all.  I think we need to come up with a good name for the individual Beans that get managed by the JCDI container.

                                    1 2 Previous Next