title: Unable to deploy WAR in an EAR on WebLogic
body: <p>I have a web application running on JSF 2.2 on WebLogic Application server 12.2.1.1.</p>
  
  <p>I have a simple java class and trying to initialize it as an ApplicationScoped object using CDI. This gets deployed perfectly fine as a WAR.</p>
  
  <pre><code>import javax.enterprise.context.ApplicationScoped;
  import javax.inject.Named;
  
  @Named
  @ApplicationScoped
  public class AppContext {
      public AppContext() {
      }
  }
  </code></pre>
  
  <p>However, when I add this WAR to an EAR it fails to deploy. I am trying all possible solutions and nothing seems to work at this point. The exception log is as below:</p>
  
  <pre><code>weblogic.management.DeploymentException: CDI deployment failure:WELD-001414: Bean name is ambiguous. Name appContext resolves to beans: [Managed Bean [class beans.AppContext] with qualifiers [@Default @Any @Named], Managed Bean [class beans.AppContext] with qualifiers [@Default @Any @Named]]:org.jboss.weld.exceptions.DeploymentException:WELD-001414: Bean name is ambiguous. Name appContext resolves to beans: [Managed Bean [class beans.AppContext] with qualifiers [@Default @Any @Named], Managed Bean [class beans.AppContext] with qualifiers [@Default @Any @Named]]
      at org.jboss.weld.bootstrap.Validator.validateBeanNames(Validator.java:641)
      at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:487)
      at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:446)
      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
      at com.oracle.injection.provider.weld.WeldInjectionContainer.start(WeldInjectionContainer.java:150)
      Truncated. see log file for complete stacktrace
  </code></pre>
  
  <p>Also WEB-INF\beans.xml is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Application Running On:</p>
  
  <pre><code>NetBeans IDE 8.2;
  JDK 1.8 b121;
  Mojarra JSF 2.2;
  WebLogic 12.2.1.1;
  </code></pre>
  
  <p>Any hint on fixing this issue is highly appreciated.</p>