6 Replies Latest reply on Mar 6, 2012 12:08 AM by zeeman

    WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final

    Giancarlo Machado Newbie

      Hi

       

       

      When I put the faces together with the Security it gives problems of duplicity

      I'm trying to find what might be wrong many days

       

      Without Faces its work

       

      <dependency>

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

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

         <version>3.1.0.Final</version>

      </dependency>

      <dependency>

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

         <artifactId>seam-security</artifactId>

         <version>3.1.0.Final</version>

         <scope>runtime</scope>

      </dependency>

       

      WITH

       

      <dependency>

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

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

         <version>3.1.0.Final</version>

      </dependency>

       

      <dependency>

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

         <artifactId>seam-faces</artifactId>

         <version>3.1.0.Final</version>

         <scope>runtime</scope>

      </dependency>

       

       

       

       

       

       

      23:05:03,812 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.unit."application-ear.ear".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."application-ear.ear".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [SeamTransaction] with qualifiers [@DefaultTransaction] at injection point [[field] @Inject @DefaultTransaction private org.jboss.seam.faces.transaction.TransactionPhaseListener.transaction]. Possible dependencies [[Managed Bean [class org.jboss.seam.transaction.EntityTransaction] with qualifiers [@Any @DefaultTransaction], Managed Bean [class org.jboss.seam.transaction.HibernateTransaction] with qualifiers [@Any @DefaultTransaction]]]

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

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_23]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_23]

          at java.lang.Thread.run(Thread.java:679) [:1.6.0_23]

      Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [SeamTransaction] with qualifiers [@DefaultTransaction] at injection point [[field] @Inject @DefaultTransaction private org.jboss.seam.faces.transaction.TransactionPhaseListener.transaction]. Possible dependencies [[Managed Bean [class org.jboss.seam.transaction.EntityTransaction] with qualifiers [@Any @DefaultTransaction], Managed Bean [class org.jboss.seam.transaction.HibernateTransaction] with qualifiers [@Any @DefaultTransaction]]]

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

          at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)

          at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:129)

          at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351)

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

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

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

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

          ... 5 more

       

       

      Any help is welcome

       

       

      tks

        • 1. Re: WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final
          zeeman Novice

          Use seam bom so it can manage versions and scopes for you for Seam dependencies. You have wrong scopes.

           

          Add to your pom:

           


          <dependencyManagement>


          <dependencies>



          <dependency>




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




          <artifactId>seam-bom</artifactId>




          <version>${seam.version}</version>




          <type>pom</type>




          <scope>import</scope>



          </dependency>

           

           

          In your dependency section add only:

           



          <dependency>



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



          <artifactId>seam-faces</artifactId>


          </dependency>

          And

           



          <dependency>



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



          <artifactId>seam-security</artifactId>
          <!--

          -->


          </dependency>
          • 2. Re: WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final
            Giancarlo Machado Newbie

            Tanks for reply

             

             

            I put this in my pom.xml.

             

             

            But, his find for jsf-api ?

            this should be within the Seam-Faces?

             

            12:51:40,115 WARN  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016006: Could not load portable extension class org.jboss.seam.faces.context.FacesAnnotationsAdapterExtension: java.lang.reflect.InvocationTargetException

                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_03]

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [rt.jar:1.6.0_03]

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [rt.jar:1.6.0_03]

                at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [rt.jar:1.6.0_03]

                at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:117) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

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

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

                at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_03]

            Caused by: java.lang.NoClassDefFoundError: javax/faces/bean/RequestScoped

                at org.jboss.seam.faces.context.FacesAnnotationsAdapterExtension.<init>(FacesAnnotationsAdapterExtension.java:56) [seam-faces-3.1.0.Final.jar:3.1.0.Final]

                ... 13 more

            • 3. Re: WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final
              zeeman Novice

              Looks like you're missing dependencies.

               

               

              Add to your pom:

               



              <dependency>



              <groupId>javax.servlet</groupId>



              <artifactId>javax.servlet-api</artifactId>



              <version>3.0.1</version>



              <scope>provided</scope>


              </dependency>


              <!-- Provided scope comes from the app server jars -->


              <dependency>



              <groupId>org.jboss.spec</groupId>



              <artifactId>jboss-javaee-6.0</artifactId>



              <type>pom</type>



              <scope>provided</scope>


              </dependency>

              1st is only needed if you have any servelt 3.0 annotations.

              The 2nd one will import needed depenecies.

              • 4. Re: WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final
                Giancarlo Machado Newbie

                Tks

                 

                I put this dependencies

                 

                 

                Verify he loaded the jboss-jsf-api_2.0_spec-1.0.0.Final.jar via jboss-JavaEE-6.0

                but yet he looks for jsf-api

                 

                 

                 

                 

                 

                23:23:31,456 WARN  [org.jboss.weld] (MSC service thread 1-1) Could not load portable extension org.jboss.seam.faces.context.FacesAnnotationsAdapterExtension: java.lang.reflect.InvocationTargetException

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_23]

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [:1.6.0_23]

                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [:1.6.0_23]

                    at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [:1.6.0_23]

                    at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:117) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]

                    at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]

                    at org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_23]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_23]

                    at java.lang.Thread.run(Thread.java:679) [:1.6.0_23]

                Caused by: java.lang.NoClassDefFoundError: javax/faces/bean/RequestScoped

                    at org.jboss.seam.faces.context.FacesAnnotationsAdapterExtension.<init>(FacesAnnotationsAdapterExtension.java:56) [seam-faces-3.1.0.Final.jar:]

                    ... 13 more

                Caused by: java.lang.ClassNotFoundException: javax.faces.bean.RequestScoped from [Module "deployment.creditocidadao-ear.ear:main" from Service Module Loader]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)

                    ... 14 more

                • 5. Re: WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final
                  Giancarlo Machado Newbie

                  And with

                   

                  <dependency>
                  <groupId>org.jboss.spec.javax.faces</groupId>
                  <artifactId>jboss-jsf-api_2.0_spec</artifactId>
                  <version>1.0.0.Final</version>

                  </dependency>

                   

                   

                  throws

                   

                  12:58:31,202 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

                      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.config.processor.F

                  12:58:31,202 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Critical error during deployment: : com.sun.faces.config.ConfigurationException: Factory 'javax.faces.application.ApplicationFactory' was not configured properly.

                      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_23]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_23]

                      at java.lang.Thread.run(Thread.java:679) [:1.6.0_23]

                  Caused by: javax.faces.FacesException: org.jboss.seam.faces.environment.SeamApplicationFactory

                      at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:616) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:949) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      ... 11 more

                  actoryConfigProcessor.process(FactoryConfigProcessor.java:219) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3368) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3821) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_23]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_23]

                      at java.lang.Thread.run(Thread.java:679) [:1.6.0_23]

                  Caused by: javax.faces.FacesException: org.jboss.seam.faces.environment.SeamApplicationFactory

                      at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:616) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:482) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder.access$400(FactoryFinder.java:138) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:949) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:316) [jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar:2.0.0.Beta1]

                      at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]

                      ... 11 more

                  • 6. Re: WELD-001409 Ambiguous dependencies in faces-3.1.0.Final + security-3.1.0.Final
                    zeeman Novice

                    Looks like you have some POM issues. Look at booking example POM https://github.com/seam/examples/tree/master/booking

                    and be sure you're latest latest Seam 3.1 BOM.