title: Cannot acquire data source error in JBOSS 5.1.0 GA using EclipseLink
body: <p>i had deployed successfully my project into JBOSS 5.1 GA using eclipselink with jpa 1.0.</p>
  
  <p>But when i am trying to access the database the below error is showing..</p>
  
  <pre><code>19:40:40,206 INFO  [STDOUT] [EL Severe]: ejb: 2013-05-06 19:40:40.205--ServerSession(32897510)--Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/iport].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: iport
  19:40:40,206 SEVERE [Entity] find by property name failed
  javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/iport].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: iport
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:602)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
  at entity.jpa.EntityManagerHelper.getEntityManager(EntityManagerHelper.java:34)
  at env.acegi.users.IptUsersDAO.getEntityManager(IptUsersDAO.java:40)
  at env.acegi.users.IptUsersDAO.findByProperty(IptUsersDAO.java:169)
  at env.acegi.users.IptUsersDAO.findByUserCode(IptUsersDAO.java:180)
  at env.acegi.security.AcegiAuthentication.loadUserByUsername(AcegiAuthentication.java:45)
  at org.acegisecurity.providers.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:99)
  at org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:122)
  at org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:200)
  at org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:47)
  at org.acegisecurity.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:74)
  at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:252)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.concurrent.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:95)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
  at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  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: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/iport].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: iport
  at org.eclipse.persistence.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:502)
  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:685)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:215)
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:542)
  ... 44 more
  Caused by: javax.naming.InvalidNameException: Not a compound name: iport
  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)
  ... 48 more
  19:40:40,209 ERROR [[default]] Servlet.service() for servlet default threw exception
  javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/iport].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: iport
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:602)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
  at entity.jpa.EntityManagerHelper.getEntityManager(EntityManagerHelper.java:34)
  at env.acegi.users.IptUsersDAO.getEntityManager(IptUsersDAO.java:40)
  at env.acegi.users.IptUsersDAO.findByProperty(IptUsersDAO.java:169)
  at env.acegi.users.IptUsersDAO.findByUserCode(IptUsersDAO.java:180)
  at env.acegi.security.AcegiAuthentication.loadUserByUsername(AcegiAuthentication.java:45)
  at org.acegisecurity.providers.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:99)
  at org.acegisecurity.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:122)
  at org.acegisecurity.providers.ProviderManager.doAuthentication(ProviderManager.java:200)
  at org.acegisecurity.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:47)
  at org.acegisecurity.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:74)
  at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:252)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.concurrent.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:95)
  at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
  at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
  at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  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: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.ValidationException
  Exception Description: Cannot acquire data source [java:/iport].
  Internal Exception: javax.naming.InvalidNameException: Not a compound name: iport
  at org.eclipse.persistence.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:502)
  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:685)
  at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:215)
  at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:542)
  ... 44 more
  Caused by: javax.naming.InvalidNameException: Not a compound name: iport
  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)
  ... 48 more
  </code></pre>
  
  <p>here is my <code>persistence.xml</code> file :</p>
  
  <pre><code>&lt;persistence xmlns="http://java.sun.com/xml/ns/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_1_0.xsd" version="1.0"&gt;
  
  &lt;persistence-unit name="Entity" transaction-type="RESOURCE_LOCAL"&gt;
  
      &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
  
      &lt;non-jta-data-source&gt;java:/iport&lt;/non-jta-data-source&gt;
  
      &lt;class&gt;env.model.authorization.IptUsers&lt;/class&gt;
      &lt;class&gt;env.model.authorization.IptUsersPort&lt;/class&gt;
      &lt;class&gt;env.model.authorization.IptUsersAuth&lt;/class&gt;
  
  &lt;properties&gt;
          &lt;property name="javax.persistence.jdbc.driver"
              value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /&gt;
          &lt;property name="javax.persistence.jdbc.url"
              value="jdbc:sqlserver://x.x.x.x:1433;databaseName=TEST" /&gt;
          &lt;property name="javax.persistence.jdbc.user" value="xx" /&gt;
          &lt;property name="javax.persistence.jdbc.password" value="xx" /&gt;
          &lt;property name="javax.persistence.weaving" value="false"/&gt;
      &lt;/properties&gt;
  
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p></p>
  
  <p>and my <code>jboss-web.xml</code> file is here below</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jboss-web&gt;
      &lt;resource-ref&gt;
          &lt;res-ref-name&gt;jdbc/iport&lt;/res-ref-name&gt;
          &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
          &lt;jndi-name&gt;iport&lt;/jndi-name&gt;
          &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;/resource-ref&gt;
  &lt;/jboss-web&gt;
  </code></pre>
  
  <p>and my <code>jboss-5.1.0.GA/server/default/deploy/iport-ds.xml</code> is here below...</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE datasources
  PUBLIC "-//JBoss//DTD JBOSS JCA Config 5.0//EN"
  "http://www.jboss.org/j2ee/dtd/jboss-ds_5_0.dtd"&gt;
  &lt;datasources&gt;
  &lt;local-tx-datasource&gt;
      &lt;jndi-name&gt;iport&lt;/jndi-name&gt;
      &lt;driver-class&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/driver-class&gt;
      &lt;connection-url&gt;jdbc:sqlserver://x.x.x.x:1433;databaseName=TEST&lt;/connection-url&gt;
      &lt;user-name&gt;xx&lt;/user-name&gt;
      &lt;password&gt;xx&lt;/password&gt;
  &lt;/local-tx-datasource&gt;
  &lt;/datasources&gt;
  </code></pre>
  
  <p>I think the whole problem with my datasource configuration.
  I don't know whether i need to use <code>&lt;jta-data-source&gt;</code> or <code>&lt;non-jta-data-source&gt;</code></p>
  
  <p>Please please help me and tell me what i did wrong??
  Please help me...</p>