title: WFLYEE0040: A component named '...' is already defined in this module
body: <p>I get this error in a Java maven project. The weird thing is, it doesn't appear on every machine so I assume it has something to do with a configuration issue.</p>
  
  <p>The class RoleKeyCacheImpl is a @Startup @Singleton:</p>
  
  <pre><code>@Startup
  @Singleton
  public class RoleKeyCacheImpl implements RoleKeyCache { ... }
  </code></pre>
  
  <p>That's the error Wildfly triggers when deploying the service.</p>
  
  <blockquote>
    <p>Caused by: java.lang.IllegalArgumentException: WFLYEE0040: A component
    named 'RoleKeyCacheImpl' is already defined in this module    at
    org.jboss.as.ee.component.EEModuleDescription.addComponent(EEModuleDescription.java:167)
      at
    org.jboss.as.ejb3.deployment.processors.EJBComponentDescriptionFactory.addComponent(EJBComponentDescriptionFactory.java:58)</p>
  </blockquote>
  
  <p>I've tried:</p>
  
  <ul>
  <li>installing a new Wildfly (V10, V13) on the same machine -> doesn't help</li>
  <li>installing a completely new Eclipse on this machine -> doesn't help</li>
  <li>cleaning &amp; rebuilding all related projects</li>
  <li>making sure the deployments-folder is empty and doesn't contain old versions of the same WAR</li>
  <li>read the related question here which also didn't help (they use Spring): <a href="https://stackoverflow.com/questions/13171339/a-component-named-xxx-is-already-defined-in-this-module-in-jboss-7-1-1">A component named &#39;XXX&#39; is already defined in this module in JBoss 7.1.1</a></li>
  <li>read and tried this q&amp;a: <a href="https://stackoverflow.com/questions/31833704">Wrong dependencies with EJB in JBoss Wildfly</a>  (server-clean) -> doesn't help</li>
  <li><p>deleted and rebuilt the local maven rep (".m2") -> no effect</p></li>
  <li><p>checking out the same source on another computer -> does work on one machine, on another it gives the same error</p></li>
  </ul>
  
  <p>I have absolutely no clue what the issue is or even could be. On one machine, we check it out and it runs without errors. On others, the exact same error happens. </p>
  
  <p>Does anybody have an idea? </p>