title: Deployment error on JBoss 6.1.0 when using different EJB module name than EJB jar file name
body: <p>I'm using JBoss AS 6.1.0 with Java 1.7. and I'm building my EAR v6 with Maven, and it appends version number to every EJB 3.1 module file name and EAR file name and I like it, but I don't want portable JNDI names of my beans changed every time I change version, so I define static EJB module names in ejb-jar.xml (EJB module names are different than EJB JAR file names inside EAR). I got deployment error in server.log. When EJB jars have the same names as module names then everything is fine. Please help.</p>
  
  <p><a href="http://www.sendspace.com/file/5sy8v3" rel="nofollow">Link to EAR</a></p>
  
  <p>ejb-jar.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:ejb="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1"&gt;
    &lt;module-name&gt;TestEjb&lt;/module-name&gt;
    &lt;display-name&gt;TestEjb&lt;/display-name&gt;
  &lt;/ejb-jar&gt;
  </code></pre>
  
  <p>application.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;application 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/application_6.xsd" version="6"&gt;
    &lt;application-name&gt;TestEar&lt;/application-name&gt;
    &lt;display-name&gt;TestEar&lt;/display-name&gt;
    &lt;module&gt;
      &lt;ejb&gt;TestEjb-0.0.1-SNAPSHOT.jar&lt;/ejb&gt;
    &lt;/module&gt;
    &lt;library-directory&gt;APP-INF/lib&lt;/library-directory&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>TestBean:</p>
  
  <pre><code>@Remote
  public interface TestEjbRemote {
  
     public void testMethod();
  
  }
  
  
  @Stateless
  public class TestEjb implements TestEjbRemote {
  
     @Override
     public void testMethod() {   
  
     }
  }
  </code></pre>
  
  <p>boot.log:</p>
  
  <pre><code>16:07:19,855 INFO  [JBossASKernel] Created KernelDeployment for: TestEjb-0.0.1-SNAPSHOT.jar
  16:07:19,855 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=TestEar-0.0.1-SNAPSHOT.ear,jar=TestEjb-0.0.1-SNAPSHOT.jar,name=TestEjb,service=EJB3
  16:07:19,855 INFO  [JBossASKernel]   with dependencies:
  16:07:19,855 INFO  [JBossASKernel]   and demands:
  16:07:19,855 INFO  [JBossASKernel]  jboss.ejb:service=EJBTimerService; Required: Described
  16:07:19,855 INFO  [JBossASKernel]  jboss-switchboard:appName=TestEar,module=TestEjb,name=TestEjb; Required: Create
  16:07:19,855 INFO  [JBossASKernel]   and supplies:
  16:07:19,855 INFO  [JBossASKernel]  jndi:TestEar-0.0.1-SNAPSHOT/TestEjb/remote
  16:07:19,870 INFO  [JBossASKernel]  jndi:TestEjb
  16:07:19,870 INFO  [JBossASKernel]  Class:com.test.client.TestEjbRemote
  16:07:19,870 INFO  [JBossASKernel]  jndi:TestEar-0.0.1-SNAPSHOT/TestEjb/remote-com.test.client.TestEjbRemote
  16:07:19,870 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=TestEar-0.0.1-SNAPSHOT.ear,jar=TestEjb-0.0.1-SNAPSHOT.jar,name=TestEjb,service=EJB3) to KernelDeployment of: TestEjb-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>server.log:</p>
  
  <pre><code>2012-10-15 16:07:20,198 ERROR [ProfileServiceBootstrap] (Thread-2) Failed to load profile:: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
  
  DEPLOYMENTS MISSING DEPENDENCIES:
    Deployment "jboss.ejb3:application=TestEar-0.0.1-SNAPSHOT,module=TestEjb-0.0.1-SNAPSHOT,component=TestEjb,service=EjbEncFactory" is missing the following dependencies:
      Dependency "jboss.naming:application=TestEar-0.0.1-SNAPSHOT,component=TestEjb,module=TestEjb-0.0.1-SNAPSHOT" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'jboss.naming:application=TestEar-0.0.1-SNAPSHOT,component=TestEjb,module=TestEjb-0.0.1-SNAPSHOT' **")
    Deployment "jboss.j2ee:ear=TestEar-0.0.1-SNAPSHOT.ear,jar=TestEjb-0.0.1-SNAPSHOT.jar,name=TestEjb,service=EJB3" is missing the following dependencies:
      Dependency "jboss.ejb3:application=TestEar-0.0.1-SNAPSHOT,component=TestEjb,module=TestEjb-0.0.1-SNAPSHOT,service=EjbEncFactory" (should be in state "Installed", but is actually in state "Described")
      Dependency "org.jboss.ejb.bean.instantiator/TestEar-0.0.1-SNAPSHOT/TestEjb-0.0.1-SNAPSHOT/TestEjb" (should be in state "Installed", but is actually in state "** NOT FOUND Depends on 'org.jboss.ejb.bean.instantiator/TestEar-0.0.1-SNAPSHOT/TestEjb-0.0.1-SNAPSHOT/TestEjb' **")
    Deployment "jboss.j2ee:ear=TestEar-0.0.1-SNAPSHOT.ear,jar=TestEjb-0.0.1-SNAPSHOT.jar,name=TestEjb,service=EJB3_endpoint" is missing the following dependencies:
      Dependency "jboss.j2ee:ear=TestEar-0.0.1-SNAPSHOT.ear,jar=TestEjb-0.0.1-SNAPSHOT.jar,name=TestEjb,service=EJB3" (should be in state "Installed", but is actually in state "Instantiated")
  
  DEPLOYMENTS IN ERROR:
    Deployment "org.jboss.ejb.bean.instantiator/TestEar-0.0.1-SNAPSHOT/TestEjb-0.0.1-SNAPSHOT/TestEjb" is in error due to the following reason(s): ** NOT FOUND Depends on 'org.jboss.ejb.bean.instantiator/TestEar-0.0.1-SNAPSHOT/TestEjb-0.0.1-SNAPSHOT/TestEjb' **
    Deployment "jboss.ejb3:application=TestEar-0.0.1-SNAPSHOT,component=TestEjb,module=TestEjb-0.0.1-SNAPSHOT,service=EjbEncFactory" is in error due to the following reason(s): Described
    Deployment "jboss.naming:application=TestEar-0.0.1-SNAPSHOT,component=TestEjb,module=TestEjb-0.0.1-SNAPSHOT" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.naming:application=TestEar-0.0.1-SNAPSHOT,component=TestEjb,module=TestEjb-0.0.1-SNAPSHOT' **
  
      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.2.GA]
      at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.2.GA]
      at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.1.0.Final]
      at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]
      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.1.0.Final]
      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0.Final]
      at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
      at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-6]
      at java.lang.Thread.run(Thread.java:722) [:1.7.0_04]
  </code></pre>