title: Cannot acquire data source. Can't Use JPA EntityManager (EclipseLink) with JBoss 5.1
body: <p>I'm facing a lot of difficulties to put the JPA (EclipseLink) working in the JBoss Server. I normally use Tomcat and it's quite simple...</p>
  
  <ol>
  <li>I copied the mysql-ds.xml from /jboss-5.1.0.GA/docs/examples/jca to /jboss-5.1.0.GA/servers/default/deploy/ and then I configured it. </li>
  </ol>
  
  <p>mysql-ds.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;datasources&gt;
    &lt;local-tx-datasource&gt;
      &lt;jndi-name&gt;EDeliveryUnit&lt;/jndi-name&gt;
      &lt;connection-url&gt;jdbc:mysql://localhost:3306/edelivery_db&lt;/connection-url&gt;
      &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;
      &lt;user-name&gt;root&lt;/user-name&gt;
      &lt;password&gt;root&lt;/password&gt;
      &lt;exception-sorter-class-name&gt;org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter&lt;/exception-sorter-class-name&gt;
      &lt;check-valid-connection-sql&gt;SELECT * FROM systemuser&lt;/check-valid-connection-sql&gt;
      &lt;metadata&gt;
         &lt;type-mapping&gt;mySQL&lt;/type-mapping&gt;
      &lt;/metadata&gt;
    &lt;/local-tx-datasource&gt;
  &lt;/datasources&gt;
  </code></pre>
  
  <ol>
  <li>Then I configured the persistence.xml in my WebApplication.</li>
  </ol>
  
  <p>persistence.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
  version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"&gt;
  &lt;persistence-unit name="edeliveryPU"
      transaction-type="RESOURCE_LOCAL"&gt;
      &lt;jta-data-source&gt;jdbc/EDeliveryUnit&lt;/jta-data-source&gt;
      &lt;non-jta-data-source&gt;jdbc/EDeliveryUnit&lt;/non-jta-data-source&gt;
      &lt;class&gt;pt.inov.spocs.board.server.model.entity.SystemUser&lt;/class&gt;
      &lt;class&gt;pt.inov.spocs.board.server.model.entity.UserSession&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/edelivery_db" /&gt;
          &lt;property name="javax.persistence.jdbc.user" value="root" /&gt;
          &lt;property name="javax.persistence.jdbc.password" value="root" /&gt;
          &lt;property name="eclipselink.jdbc.batch-writing" value="JDBC" /&gt;
          &lt;property name="eclipselink.ddl-generation" value="drop-and-create-tables" /&gt;
      &lt;/properties&gt;
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>
  
  <p>Finale I instantiate the EntityManager:</p>
  
  <pre><code>private EntityManagerFactory emf;
  private EntityManager em;
  
  public Controller() {
      System.out.println("Begin..");
  
      emf = Persistence.createEntityManagerFactory("edeliveryPU");
      em = emf.createEntityManager();
  
      user = em.find(SystemUser.class, new Long(1));
      System.out.println("Username: " + user.getUsername() + " | pass: "
              + user.getPassword());
  }
  </code></pre>
  
  <p>When I deploy it I got these error in my jboss:</p>
  
  <pre><code>2012-07-20 13:22:15,762 INFO  [STDOUT] (http-127.0.0.1-8080-1) Begin..
  2012-07-20 13:22:16,346 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The access type for the persistent class [class pt.inov.spocs.board.server.model.entity.UserSession] is set to [FIELD].
  2012-07-20 13:22:16,414 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The target entity (reference) class for the many to one mapping element [field user] is being defaulted to: class pt.inov.spocs.board.server.model.entity.SystemUser.
  2012-07-20 13:22:16,417 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The access type for the persistent class [class pt.inov.spocs.board.server.model.entity.SystemUser] is set to [FIELD].
  2012-07-20 13:22:16,419 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The alias name for the entity class [class pt.inov.spocs.board.server.model.entity.UserSession] is being defaulted to: UserSession.
  2012-07-20 13:22:16,424 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The table name for entity [class pt.inov.spocs.board.server.model.entity.UserSession] is being defaulted to: USERSESSION.
  2012-07-20 13:22:16,468 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [sessionKey] is being defaulted to: SESSIONKEY.
  2012-07-20 13:22:16,470 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [endDate] is being defaulted to: ENDDATE.
  2012-07-20 13:22:16,472 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [beginDate] is being defaulted to: BEGINDATE.
  2012-07-20 13:22:16,472 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [ip] is being defaulted to: IP.
  2012-07-20 13:22:16,474 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The alias name for the entity class [class pt.inov.spocs.board.server.model.entity.SystemUser] is being defaulted to: SystemUser.
  2012-07-20 13:22:16,475 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The table name for entity [class pt.inov.spocs.board.server.model.entity.SystemUser] is being defaulted to: SYSTEMUSER.
  2012-07-20 13:22:16,476 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [id] is being defaulted to: ID.
  2012-07-20 13:22:16,477 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [username] is being defaulted to: USERNAME.
  2012-07-20 13:22:16,477 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The column name for element [password] is being defaulted to: PASSWORD.
  2012-07-20 13:22:16,479 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The pk column value for the table generator named [SystemUserGenerator] defined on [class pt.inov.spocs.board.server.model.entity.SystemUser] from [class pt.inov.spocs.board.server.model.entity.SystemUser] is being defaulted to: SystemUserGenerator.
  2012-07-20 13:22:16,526 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The primary key column name for the mapping element [field user] is being defaulted to: ID.
  2012-07-20 13:22:16,526 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Config]: The foreign key column name for the mapping element [user] is being defaulted to: USER_ID.
  2012-07-20 13:22:16,696 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Warning]: PersistenceUnitInfo edeliveryPU has transactionType RESOURCE_LOCAL and therefore jtaDataSource will be ignored
  2012-07-20 13:22:16,700 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Info]: EclipseLink, version: Eclipse Persistence Services - 2.3.2.v20111125-r10461
  2012-07-20 13:22:16,716 INFO  [STDOUT] (http-127.0.0.1-8080-1) [EL Severe]: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  2012-07-20 13:22:16,717 SEVERE [org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage] (http-127.0.0.1-8080-1) Error Rendering View[/index.xhtml]
  javax.el.ELException: /index.xhtml: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at org.apache.myfaces.view.facelets.compiler.TextInstruction.write(TextInstruction.java:57)
  at org.apache.myfaces.view.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:46)
  at org.apache.myfaces.view.facelets.compiler.UILeaf.encodeAll(UILeaf.java:214)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
  at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1159)
  at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
  at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
  at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  at java.lang.Thread.run(Thread.java:662)
  Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:517)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
  at pt.inov.spocs.board.server.model.entity.Controller.&lt;init&gt;(Controller.java:19)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
  at java.lang.Class.newInstance0(Class.java:355)
  at java.lang.Class.newInstance(Class.java:308)
  at org.apache.myfaces.config.annotation.TomcatAnnotationLifecycleProvider.newInstance(TomcatAnnotationLifecycleProvider.java:49)
  at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:162)
  at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:303)
  at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:266)
  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
  at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
  at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:65)
  at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:96)
  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
  at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
  at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
  at org.apache.el.parser.AstValue.getValue(AstValue.java:107)
  at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
  at org.apache.myfaces.view.facelets.el.ELText$ELTextVariable.writeText(ELText.java:213)
  at org.apache.myfaces.view.facelets.el.ELText$ELTextComposite.writeText(ELText.java:125)
  at org.apache.myfaces.view.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
  ... 28 more
  Caused by: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at org.eclipse.persistence.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:497)
  at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:109)
  at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
  at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:584)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
  ... 55 more
  Caused by: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at javax.naming.CompoundName.addAll(CompoundName.java:445)
  at org.jnp.interfaces.NamingContext.composeName(NamingContext.java:1077)
  at org.jnp.interfaces.NamingContext.getAbsoluteName(NamingContext.java:1855)
  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:717)
  at javax.naming.InitialContext.lookup(InitialContext.java:396)
  at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:103)
  ... 59 more
  2012-07-20 13:22:16,764 SEVERE [org.apache.myfaces.renderkit.ErrorPageWriter] (http-127.0.0.1-8080-1) An exception occurred
  javax.faces.FacesException: javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
  at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
  at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:258)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:191)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  at java.lang.Thread.run(Thread.java:662)
  Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:517)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:294)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:272)
  at pt.inov.spocs.board.server.model.entity.Controller.&lt;init&gt;(Controller.java:19)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
  at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
  at java.lang.Class.newInstance0(Class.java:355)
  at java.lang.Class.newInstance(Class.java:308)
  at org.apache.myfaces.config.annotation.TomcatAnnotationLifecycleProvider.newInstance(TomcatAnnotationLifecycleProvider.java:49)
  at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:162)
  at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:303)
  at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:266)
  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
  at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
  at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:65)
  at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:96)
  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
  at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:142)
  at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:61)
  at org.apache.el.parser.AstValue.getValue(AstValue.java:107)
  at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
  at org.apache.myfaces.view.facelets.el.ELText$ELTextVariable.writeText(ELText.java:213)
  at org.apache.myfaces.view.facelets.el.ELText$ELTextComposite.writeText(ELText.java:125)
  at org.apache.myfaces.view.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
  at org.apache.myfaces.view.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:46)
  at org.apache.myfaces.view.facelets.compiler.UILeaf.encodeAll(UILeaf.java:214)
  at javax.faces.component.UIComponent.encodeAll(UIComponent.java:614)
  at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1159)
  at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
  at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85)
  at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
  ... 21 more
  Caused by: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/EDeliveryUnit].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at org.eclipse.persistence.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:497)
  at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:109)
  at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
  at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:584)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:488)
  ... 55 more
     Caused by: javax.naming.InvalidNameException: Not a compound name: EDeliveryUnit
  at javax.naming.CompoundName.addAll(CompoundName.java:445)
  at org.jnp.interfaces.NamingContext.composeName(NamingContext.java:1077)
  at org.jnp.interfaces.NamingContext.getAbsoluteName(NamingContext.java:1855)
  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:717)
  at javax.naming.InitialContext.lookup(InitialContext.java:396)
  at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:103)
  ... 59 more
  </code></pre>
  
  <p>I tried in many different ways but I can't put these working.</p>
  
  <p>Anyone can help me please?</p>