title: Error while starting Wildfly 11 App Server - persistence unit named null
body: <p>I'm developing a maven based JSF+JPA+EJB 3.2 Project using Eclipse and Wildfly 11.
  While starting the App Server am getting the following error :</p>
  
  <pre><code>    20:37:27,664 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment erpmini.war
  
  20:37:28,116 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-4) HV000001: Hibernate Validator 5.3.5.Final
  
  20:37:28,552 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-4) WFLYEJB0473: JNDI bindings for session bean named 'UserManagementServiceSlsb' in deployment unit 'deployment "erpmini.war"' are as follows:
  
  
  java:global/erpmini/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
  
  java:app/erpmini/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
  
  java:module/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
  
  java:jboss/exported/erpmini/UserManagementServiceSlsb!com.itsys.erp.server.commonservices.usermgmt.UserManagementService
  
  java:global/erpmini/UserManagementServiceSlsb
  
  java:app/erpmini/UserManagementServiceSlsb
  
  java:module/UserManagementServiceSlsb
  
  20:37:29,879 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."erpmini.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."erpmini.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "erpmini.war"
  
  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
  
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
  
  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
  
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  
  at java.lang.Thread.run(Thread.java:748)
  
  Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class com.itsys.erp.server.commonservices.usermgmt.slsbadapter.UserManagementServiceSlsb for component UserManagementServiceSlsb has errors:
  
  WFLYJPA0033: Can't find a persistence unit named null in deployment "erpmini.war"
  
  at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:157)
  
  at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
  
  at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:186)
  
  at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:143)
  
  at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
  
  ... 5 more
  
  20:37:30,098 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-2) ISPN000128: Infinispan version: Infinispan 'Chakra' 8.2.8.Final
  
  20:37:31,825 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 63) WFLYCLINF0002: Started client-mappings cache from ejb container
  
  20:37:32,131 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" =&gt; "erpmini.war")]) - failure description: {
  
      "WFLYCTL0080: Failed services" =&gt; {"jboss.deployment.unit.\"erpmini.war\".INSTALL" =&gt; "WFLYSRV0153: Failed to process phase INSTALL of deployment \"erpmini.war\"
  
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0041: Component class com.itsys.erp.server.commonservices.usermgmt.slsbadapter.UserManagementServiceSlsb for component UserManagementServiceSlsb has errors:
  
  WFLYJPA0033: Can't find a persistence unit named null in deployment \"erpmini.war\""},
  
      "WFLYCTL0412: Required services that are not installed:" =&gt; ["jboss.deployment.unit.\"erpmini.war\".beanmanager"],
  
      "WFLYCTL0180: Services with missing/unavailable dependencies" =&gt; [
  
      "jboss.deployment.unit.\"erpmini.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"erpmini.war\".beanmanager]",
  
      "jboss.deployment.unit.\"erpmini.war\".batch.artifact.factory is missing [jboss.deployment.unit.\"erpmini.war\".beanmanager]"
  
      ]
  
  }
  </code></pre>
  
  <p>I'm injecting the EntityManager in stateless bean:</p>
  
  <pre><code>@Stateless
  public class UserManagementServiceSlsb implements UserManagementService {
  
       /** The Entity Manager */
       @PersistenceContext(name = "TELCOAppPU")
       private EntityManager entityManager;
  
       private UserManagementService userMgmtService;
   ....
  }
  </code></pre>
  
  <p>Why the Container is not able to find persistence.xml file? persistence.xml is present in META-INF directory. Any help would be appreciated.
  Thanks. <br/>
  UPDATE :
  here is Project dir structure , persistence.xml is present in META-INF directory.</p>
  
  <p><a href="https://i.stack.imgur.com/GCjpR.png" rel="nofollow noreferrer">Project dir structure</a></p>
  
  <p>persistence.xml contains Entity classes and MySql database connection details.</p>
  
  <pre><code>&lt;persistence-unit name="TELCOAppPU"&gt;
      &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
      &lt;class&gt;com.itsys.erp.server.dal.entities.City&lt;/class&gt;
      &lt;class&gt;com.itsys.erp.server.dal.entities.Machine&lt;/class&gt;
      &lt;class&gt;com.itsys.erp.server.dal.entities.Product&lt;/class&gt;
      &lt;class&gt;com.itsys.erp.server.dal.entities.ProductType&lt;/class&gt;
      &lt;class&gt;com.itsys.erp.server.dal.entities.ProductionLog&lt;/class&gt;
      ...
      &lt;properties&gt;
          &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/erpdb" /&gt;
          &lt;property name="javax.persistence.jdbc.user" value="root" /&gt;
          &lt;property name="javax.persistence.jdbc.password" value="root" /&gt;
          &lt;property name="hibernate.show_sql" value="true" /&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>