9 Replies Latest reply on Mar 27, 2012 9:04 AM by daxxy

    Adding seam-faces ends up with weld error

    daxxy

      I am trying to add seam-faces to my little app.  I am on as 7.1.0.Final and am using jboss dev studio 5.  I get the same error on eclipse indigo though.

       

      Using seam-bom to manage versions.

       

      It seems that whenever I try to add a seam module I end up with a slew of classnotfound exceptions.  I add maven artifacts one at a time to handle them.  Now that they have all been handled, I ended up with a Weld error.

       

      Here is what I ended up with in my POM when I added seam-faces.  Each of these was added to handle a ClassNotFound exception

       

          <dependency>

            <groupId>org.jboss.seam.faces</groupId>

            <artifactId>seam-faces</artifactId>

          </dependency>

          <dependency>

            <groupId>org.jboss.seam.security</groupId>

            <artifactId>seam-security-api</artifactId>

          </dependency>

          <dependency>

            <groupId>org.jboss.seam.faces</groupId>

            <artifactId>seam-faces-api</artifactId>

          </dependency>

          <dependency>

            <groupId>joda-time</groupId>

            <artifactId>joda-time</artifactId>

          </dependency>

          <dependency>

            <groupId>org.jboss.seam.transaction</groupId>

            <artifactId>seam-transaction-api</artifactId>

          </dependency>

          <dependency>

            <groupId>org.jboss.seam.persistence</groupId>

            <artifactId>seam-persistence-api</artifactId>

          </dependency>

          <dependency>

            <groupId>org.jboss.seam.international</groupId>

            <artifactId>seam-international-api</artifactId>

          </dependency>

          <dependency>

            <groupId>com.ocpsoft</groupId>

            <artifactId>prettyfaces-core</artifactId>

            <version>3.3.2</version>

          </dependency>

       

      Here is what I ended up with. I don't have any idea how to interpret or fix this

       

      12:36:45,463 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."contacts-as7.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."contacts-as7.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Messages] with qualifiers [@Default] at injection point [[parameter 2] of [method] org.jboss.seam.faces.status.MessagesAdapter.convert(PhaseEvent, Messages)]

      at org.jboss.as.weld.services.WeldService.start(WeldService.java:83)

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]

      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]

      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Messages] with qualifiers [@Default] at injection point [[parameter 2] of [method] org.jboss.seam.faces.status.MessagesAdapter.convert(PhaseEvent, Messages)]

      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:275)

      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:244)

      at org.jboss.weld.bootstrap.Validator.validateObserverMethods(Validator.java:512)

      at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:336)

      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

      at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:83)

      at org.jboss.as.weld.services.WeldService.start(WeldService.java:76)

      ... 5 more

       

       

      What is this error telling me?  Any idea how to fix it?

       

      TDR

        • 1. Re: Adding seam-faces ends up with weld error
          lightguard

          Looks like you're missing the impl for seam-international. Are you using the Seam BOM?

          • 2. Re: Adding seam-faces ends up with weld error
            daxxy

            I am using the seam-bom.  I added seam-international-impl to my pom and now I get a different Weld error

             

            Caused by:

            org.jboss.weld.exceptions.DeploymentException

            : WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default] at injection point [[parameter 1] of [constructor] @Inject public org.jboss.seam.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()]]]

             

            seam-international-impl requires seam-solder. I excluded seam-solder in my pom and get

             

             

            Caused by:

            java.lang.ClassNotFoundException

            : org.jboss.seam.solder.messages.MessageBundle

             

            So I am un-excluding it which leaves me again with "Ambiguous dependencies" 

             

            ?

            • 3. Re: Adding seam-faces ends up with weld error
              lightguard

              You have two versions of Solder then. org.jboss.seam.solder and org.jboss.solder

              • 4. Re: Adding seam-faces ends up with weld error
                daxxy

                I actually did figure that out on my own before you responded.  Now I'm getting

                 

                15:40:23,777 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."contacts-as7.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."contacts-as7.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "contacts-as7.war"
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]
                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]
                Caused by: java.lang.NoClassDefFoundError: org/jboss/logmanager/Logger$AttachmentKey
                at org.jboss.seam.solder.logging.internal.JBossLogManagerProvider.<clinit>(JBossLogManagerProvider.java:36)
                at org.jboss.seam.solder.logging.internal.LoggerProviders.findProvider(LoggerProviders.java:33)
                at org.jboss.seam.solder.logging.internal.LoggerProviders.<clinit>(LoggerProviders.java:28)
                at org.jboss.seam.solder.logging.internal.Logger.getLogger(Logger.java:2164)
                at org.jboss.seam.logging.Logger.<init>(Logger.java:44)
                at org.jboss.seam.logging.Logger.getLogger(Logger.java:1965)
                at org.jboss.seam.logging.Logger.getLogger(Logger.java:1991)
                at org.jboss.seam.solder.bean.defaultbean.DefaultBeanExtension.<clinit>(DefaultBeanExtension.java:85)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_25]
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_25]
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_25]
                at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_25]
                at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:117)
                at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100)
                at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86)
                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final-redhat-1.jar:7.1.0.Final-redhat-1]
                ... 5 more
                Caused by: java.lang.ClassNotFoundException: org.jboss.logmanager.Logger$AttachmentKey from [Module "deployment.contacts-as7.war:main" from Service Module Loader]
                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                 

                 

                The libraries are

                 

                commons-beanutils-1.8.0.jar
                commons-digester-2.0.jar
                commons-logging-1.1.1.jar
                joda-time-1.6.jar
                picketlink-idm-api-1.5.0.Alpha02.jar
                picketlink-idm-common-1.5.0.Alpha02.jar
                picketlink-idm-spi-1.5.0.Alpha02.jar
                prettyfaces-core-3.3.2.jar
                seam-faces-3.1.0.CR1.jar
                seam-faces-api-3.1.0.CR1.jar
                seam-international-api-3.1.0.CR1.jar
                seam-international-impl-3.0.0.Final.jar
                seam-persistence-api-3.1.0.CR1.jar
                seam-security-api-3.1.0.CR1.jar
                seam-solder-3.1.0.Beta2.jar
                seam-solder-api-3.1.0.Beta2.jar
                seam-solder-logging-3.1.0.Beta2.jar
                seam-transaction-api-3.1.0.CR1.jar

                 

                 

                I had to tinker a bit with the seam-solder dependencies.  I"ll append my current pom.xml if you are interested in taking a look.

                 

                 

                Thanks,

                TDR

                • 5. Re: Adding seam-faces ends up with weld error
                  lightguard

                  Why not use the 3.1.0.Final versions?

                  1 of 1 people found this helpful
                  • 6. Re: Adding seam-faces ends up with weld error
                    daxxy

                    No reason except that they were the latest.  So I switched the versions to 3.0.0.Final and NOW I get this error. 

                     

                     

                    Caused by: java.lang.ClassNotFoundException: org.jboss.solder.reflection.annotated.AnnotatedTypeBuilder

                     

                     

                    I cannot find the library that contains this class.  Let me know if you want the full stack trace. 

                     

                    I can find org.jboss.seam.solder.reflection....etc but not org.jboss.solder.reflection...etc.  I checked in 3.0.0.Final and 3.1.0.Beta2 for both seam-solder and seam-solder-api

                     

                     

                    This is really maddening, but without eclipse/maven/m2e all the jboss tools, etc it would be impossible!!

                     

                    • 7. Re: Adding seam-faces ends up with weld error
                      daxxy

                      OK I see you said 3.1.0.Final versions. These are not on my nexus server and that's why I didn't you them.

                      Not sure what to do at this point.  Just download em and stick em in lib I guess.

                      • 8. Re: Adding seam-faces ends up with weld error
                        lightguard

                        They've been released for few months now. Some of them may have even been merged into maven central now, but for sure they're on the JBoss Nexus server.

                        • 9. Re: Adding seam-faces ends up with weld error
                          daxxy

                          I finally got this working. For all the other neophytes out there, here is what I learned

                           

                          1) A Weld unsatisfied dependency is like a class not found exception. You are missing a library.

                           

                          2) A Weld ambiguous dependency is like a class cast exception. You've got a duplicate library somewhere -- probably a different version of the same library. Check your WEB-INF lib and then using the maven POM editor in eclipse identify the duplicate and which library depends on it and then exclude it.  If you are not already using eclipse, start now!  I couldn't imagine doing this part without it.

                           

                          3) The "solder" libraries move from org.jboss.seam.solder to org.jboss.solder for 3.1.0. This was very confusing.  When adding a dependency in eclipse I rely on entering a filter string. I entered seam-solder and so was unaware there was a 3.1.0.Final version because the artifact name for the 3.1.0 solder libraries does not have the word "seam" in them.

                           

                          And in the course of writing this up, I just realized that the version of seam-bom I was using was 3.1.0.CR1 NOT 3.1.0.Final so the final lesson is....rely on the bom! Just make sure you have the right one...

                           

                          Thanks for your help Jason.

                          TDR