4 Replies Latest reply on Nov 26, 2011 12:05 PM by Hubert Schumacher

    WELD-001409 Ambiguous dependencies for type ELContext

    Hubert Schumacher Newbie
      Hello, I'm getting a
      "WELD-001409 Ambiguous dependencies for type [ELContext] with qualifiers [@Default]" error message when trying to deploy a 3.1.0.Beta5 SEAM3 project under JBOSS 7.0.2. Any ideas why this might happen?
      Below the stack trace you'll find my pom.xml.

      As I'm new to SEAM3/WELD, your help is really appreciated.
      Hubert


      21:35:21,560 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."owl2.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."owl2.war".WeldService: 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.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]]
              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.7.0]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]
              at java.lang.Thread.run(Thread.java:722) [:1.7.0]
      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.solder.el.Expressions(ELContext, ExpressionFactory)]. Possible dependencies [[Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.solder.el.ELContextProducer.createELContext()], Producer Method [ELContext] with qualifiers [@Any @Default] declared as [[method] @Produces org.jboss.seam.solder.el.ELContextProducer.createELContext()]]]
              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

      ---POM----

      <?xml version="1.0" encoding="UTF-8"?>
      <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <groupId>net.hrrbrt.owl</groupId>
        <artifactId>owl2</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <packaging>war</packaging>
              <properties>
                      <seam.version>3.1.0.Beta5</seam.version>
              </properties>
        <dependencies>
                              <dependency>
                                      <groupId>org.jboss.seam</groupId>
                                      <artifactId>seam-bom</artifactId>
                                      <version>${seam.version}</version>
                                      <scope>import</scope>
                                      <type>pom</type>
                              </dependency>
          <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.0-SP4</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-6.0</artifactId>
            <version>2.0.0.Final</version>
            <type>pom</type>
            <scope>provided</scope>
          </dependency>
              <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.5</version>
          </dependency>
          <dependency>
            <groupId>org.metawidget.forge</groupId>
            <artifactId>metawidget-forge-scaffold</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <exclusions>
              <exclusion>
                      <artifactId>seam-persistence</artifactId>
                      <groupId>org.jboss.seam.persistence</groupId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.6.6.Final</version>
            <scope>provided</scope>
          </dependency>
          <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
          </dependency>
          <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <version>1.0.0.Final-SNAPSHOT</version>
            <scope>test</scope>
          </dependency>
          <dependency>
            <groupId>org.jboss.seam.security</groupId>
            <artifactId>seam-security</artifactId>
            <version>${seam.version}</version>
            <exclusions>
              <exclusion>
                      <artifactId>seam-persistence</artifactId>
                      <groupId>org.jboss.seam.persistence</groupId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.jboss.seam.persistence</groupId>
            <artifactId>seam-persistence</artifactId>
            <version>${seam.version}</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.seam.remoting</groupId>
            <artifactId>seam-remoting</artifactId>
            <version>${seam.version}</version>
          </dependency>
          <dependency>
            <groupId>org.jboss.seam.faces</groupId>
            <artifactId>seam-faces</artifactId>
            <version>${seam.version}</version>
          </dependency>
          <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-impl</artifactId>
            <version>4.1.0-SNAPSHOT</version>
          </dependency>
          <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-components-ui</artifactId>
            <version>4.1.0.20111101-M4</version>
          </dependency>
          <dependency>
            <groupId>com.drewnoakes</groupId>
            <artifactId>metadata-extractor</artifactId>
            <version>2.3.1</version>
          </dependency>
              <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>1.6</version>
         </dependency>
              <dependency>
                      <groupId>com.ocpsoft</groupId>
                      <artifactId>prettyfaces-jsf2</artifactId>
                      <version>3.3.0</version>
              </dependency>
        </dependencies>
        <repositories>
          <repository>
            <id>JBOSS_NEXUS</id>
            <url>http://repository.jboss.org/nexus/content/groups/public</url>
          </repository>
          <repository>
            <id>maven2</id>
            <url>http://uk.maven.org/maven2/</url>
          </repository>
        </repositories>
        <build>
          <finalName>owl2</finalName>
          <plugins>
            <plugin>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>2.3.2</version>
              <configuration>
                <source>1.6</source>
                <target>1.6</target>
              </configuration>
            </plugin>
            <plugin>
              <artifactId>maven-war-plugin</artifactId>
              <configuration>
                <failOnMissingWebXml>true</failOnMissingWebXml>
              </configuration>
            </plugin>
               <!-- This plugin config is used to set the Dependencies entry in META-INF/MANIFEST.MF so that in AS7
                    both JBoss Logging and the JBoss Log manager will be available in the classpath -->
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-jar-plugin</artifactId>
                  <configuration>
                     <archive>
                        <manifestEntries>
                           <Dependencies>org.jboss.logging,org.jboss.logmanager</Dependencies>
                        </manifestEntries>
                     </archive>
                  </configuration>
               </plugin>
           
          </plugins>
        </build>
        <profiles>
          <profile>
            <id>arq-jbossas-7-managed</id>
            <dependencies>
              <dependency>
                <groupId>org.jboss.as</groupId>
                <artifactId>jboss-as-arquillian-container-managed</artifactId>
                <version>7.0.2.Final</version>
                <scope>test</scope>
              </dependency>
            </dependencies>
          </profile>
        </profiles>
      </project>