title: How to select a container by qualifyer from arquillian.xml?
body: <p>I want to have different container configurations in my arquillian.xml and select them in my test. But I am unable to load any container but the default one.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;arquillian
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://jboss.org/schema/arquillian"
      xsi:schemaLocation="http://jboss.org/schema/arquillian http://www.jboss.org/schema/arquillian/arquillian_1_0.xsd"&gt;
  
      &lt;container qualifier="weld" default="false"&gt;
      &lt;/container&gt;
  &lt;/arquillian&gt;
  </code></pre>
  
  <p>Test case:</p>
  
  <pre><code>@Deployment(name="depl1")
  @TargetsContainer("weld")
  public static JavaArchive createTestArchive() throws UnsupportedEncodingException {
      return ShrinkWrap
              .create(JavaArchive.class, "test.jar")
              .addClasses(SomeOtherCdiService.class)
              .addAsManifestResource(new ByteArrayAsset(beansXmlContent.getBytes("utf-8")), ArchivePaths.create("beans.xml"));
  }
  
  @Test
  @OperateOnDeployment("depl1")
  public void shouldBeAbleToInjectInject() {
      assertNotNull(someOtherCdiService);
  }
  </code></pre>
  
  <p>But the tests does not start because Arquilian does not find the container</p>
  
  <blockquote>
    <p>org.jboss.arquillian.container.test.impl.client.deployment.ValidationException:
    DeploymentScenario contains targets not matching any defined Container
    in the registry. weld. Possible causes are: No Deployable Container
    found on Classpath or your have defined a
    @org.jboss.arquillian.container.test.api.Deployment with a
    @org.jboss.arquillian.container.test.api.TargetsContainer value that
    does not match any found/configured Containers (see arquillian.xml
    container@qualifier)</p>
  </blockquote>
  
  <p>I have had a look into the source and found that Aquilian in only finding the <code>_DEFAULT_</code> Container.</p>
  
  <p>The tests work, when I remove <code>@TargetsContainer("weld")</code> from the deployer method. So I think the general test is ok.</p>
  
  <p>The tests also work if I modify the container configuration to <code>default="true"</code> (<code>&lt;container qualifier="weld" default="ture"&gt;</code>) then the tests work, so I think the configuration file is loaded.</p>
  
  <p><strong>Does anybody has an Idea what is going wrong?</strong></p>
  
  <hr>
  
  <p>Details</p>
  
  <p>Complete Stacktrace:</p>
  
  <pre><code>org.jboss.arquillian.container.test.impl.client.deployment.ValidationException:
  DeploymentScenario contains targets not matching any defined Container in the registry. weld.
  Possible causes are: No Deployable Container found on Classpath or your have defined a
  @org.jboss.arquillian.container.test.api.Deployment with a
  @org.jboss.arquillian.container.test.api.TargetsContainer value that does not match any found/configured Containers
  (see arquillian.xml container@qualifier) 
  at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.validate(DeploymentGenerator.java:102)
  at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:84)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
  at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
  at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
  at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
  at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
  at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
  at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134)
  at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
  at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
  at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:179)
  at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:311)
  at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
  at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:196)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
  at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:144)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
  </code></pre>
  
  <p>POM.XML Dependencies</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
          &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
          &lt;version&gt;1.0-SP4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
          &lt;artifactId&gt;jsr250-api&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;version&gt;1.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.validation&lt;/groupId&gt;
          &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;version&gt;1.0.0.GA&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;4.0.0.GA&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.faces&lt;/groupId&gt;
          &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
          &lt;version&gt;2.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- ejb --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.ejb&lt;/groupId&gt;
          &lt;artifactId&gt;ejb-api&lt;/artifactId&gt;
          &lt;version&gt;3.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;!-- Test --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.10&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-core&lt;/artifactId&gt;
          &lt;version&gt;${hamcrest.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
          &lt;artifactId&gt;hamcrest-library&lt;/artifactId&gt;
          &lt;version&gt;${hamcrest.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.arquillian.junit&lt;/groupId&gt;
          &lt;artifactId&gt;arquillian-junit-container&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.CR6&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.arquillian.container&lt;/groupId&gt;
          &lt;artifactId&gt;arquillian-weld-se-embedded-1.1&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.CR3&lt;/version&gt;
          &lt;!-- works with arquillian core 1.0.0.CR6 --&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- do not use org.jboss.weld.se:weld-se because is contains the CODE
          of slf4j in an not compatible version so we need the parts of weld-se seperate:
          weld-se-core, weld-core, org.javassist, slf4j-jdk14 https://issues.jboss.org/browse/WELD-903 --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.weld.se&lt;/groupId&gt;
          &lt;artifactId&gt;weld-se-core&lt;/artifactId&gt;
          &lt;version&gt;1.1.5.Final&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.weld&lt;/groupId&gt;
          &lt;artifactId&gt;weld-core&lt;/artifactId&gt;
          &lt;version&gt;1.1.5.Final&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.javassist&lt;/groupId&gt;
          &lt;artifactId&gt;javassist&lt;/artifactId&gt;
          &lt;version&gt;3.14.0-GA&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-jdk14&lt;/artifactId&gt;
          &lt;version&gt;1.6.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>