title: Deployment error when defining a security-domain
body: <p>I am working on a JavaEE7 tutorial ; currently I am trying to establish a security domain using wildfly 8.2.0. These are the settings I use:</p>
  
  <p>jboss-web.xml:</p>
  
  <pre><code>&lt;jboss-web&gt;
  &lt;security-domain&gt;my-aktion&lt;/security-domain&gt;
  &lt;/jboss-web&gt;
  </code></pre>
  
  <p>The part of standalone.xml that handles this security-domain:</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:security:1.2"&gt;
      &lt;security-domains&gt;              
          &lt;security-domain name="other" cache-type="default"&gt;
              &lt;authentication&gt;
                  &lt;login-module code="Remoting" flag="optional"&gt;
                      &lt;module-option name="password-stacking" value="useFirstPass"/&gt;
                  &lt;/login-module&gt;
                  &lt;login-module code="RealmDirect" flag="required"&gt;
                      &lt;module-option name="password-stacking" value="useFirstPass"/&gt;
                  &lt;/login-module&gt;
              &lt;/authentication&gt;
          &lt;/security-domain&gt;
          &lt;security-domain name="jboss-web-policy" cache-type="default"&gt;
              &lt;authorization&gt;
                  &lt;policy-module code="Delegating" flag="required"/&gt;
              &lt;/authorization&gt;
          &lt;/security-domain&gt;
          &lt;security-domain name="jboss-ejb-policy" cache-type="default"&gt;
              &lt;authorization&gt;
                  &lt;policy-module code="Delegating" flag="required"/&gt;
              &lt;/authorization&gt;
          &lt;/security-domain&gt;
          &lt;security-domain name="my-aktion" cache-type="default"&gt;
              &lt;authentication&gt;
                  &lt;login-module code="Database" flag="required"&gt;
                      &lt;module-option name="dsJndiName" value="java:jboss/datasources/MyAktionDS"/&gt;
                      &lt;module-option name="principalsQuery" value="select password from organizer where email=?"/&gt;
                      &lt;module-option name="rolesQuery" value="select 'Organizer','Roles' from organizer where email=?"/&gt;
                      &lt;module-option name="hashAlgorithm" value="SHA-256" /&gt;
                      &lt;module-option name="hashEncoding" value="hex" /&gt;
                      &lt;module-option name="hashCharset" value="UTF-8" /&gt;
                  &lt;/login-module&gt;
              &lt;/authentication&gt;
          &lt;/security-domain&gt;
      &lt;/security-domains&gt;
  &lt;/subsystem&gt;
  </code></pre>
  
  <p>And that´s the error I get when I try to deploy: </p>
  
  <pre><code>&gt; "JBAS014771: Services with missing/unavailable dependencies" =&gt; [
  &gt;     "jboss.deployment.unit.\"my-aktion.war\".component.DonationServiceBean.CREATE
  &gt; is missing [jboss.security.security-domain.my-aktion]",
  &gt;     "jboss.deployment.unit.\"my-aktion.war\".component.CampaignServiceBean.CREATE
  &gt; is missing [jboss.security.security-domain.my-aktion]",
  &gt;     "jboss.undertow.deployment.default-server.default-host./my-aktion.UndertowDeploymentInfoService
  &gt; is missing [jboss.security.security-domain.my-aktion]" ]}
  </code></pre>
  
  <p>I can´t make heads or tails from this error message, but it seems to be something I did wrong with the my-aktion security domain, maybe someone has a hint. In any case, I tried deleting jboss-web.xml, the application deploys fine, but I can´t login, probably because the querys handling the login are in the "my-aktion" security-domain. Probably a newbie error here, but I just can´t find it.</p>
  
  <p>EDIT: By the way, just in case it matters: the two Beans mentioned in the error are annotated @Stateless and I have no beans.xml.</p>
  
  <p>EDIT2: I solved the problem, but I still don´t know what caused it. The solution: I deleted myaktion-ds.xml, which contained the registration of my datasource and moved its content to a  tag in my standalone.xml. Now everything works, although why it does is beyond me. 
  I´ll leave this question here for a couple of days, just in case someone can enlighten me. </p>