0 Replies Latest reply: May 6, 2013 9:46 AM by SRIHARIRAO M RSS

    Cannot acquire data source error in JBOSS 5.1.0 GA using EclipseLink

    SRIHARIRAO M
      i had deployed successfully my project into JBOSS 5.1 GA using eclipselink with jpa 1.0.


      But when i am trying to access the database the below error is showing..

      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



      here is my `persistence.xml` file :

      <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">

           <persistence-unit name="Entity" transaction-type="RESOURCE_LOCAL">

                <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
                <non-jta-data-source>java:/iport</non-jta-data-source>

      <class>env.model.authorization.IptUsers</class>
                <class>env.model.authorization.IptUsersPort</class>
                <class>env.model.authorization.IptUsersAuth</class>

      <properties>
                     <property name="javax.persistence.jdbc.driver"
                          value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
                     <property name="javax.persistence.jdbc.url"
                          value="jdbc:sqlserver://x.x.x.x:1433;databaseName=TEST" />
                     <property name="javax.persistence.jdbc.user" value="xx" />
                     <property name="javax.persistence.jdbc.password" value="xx" />
                     <property name="javax.persistence.weaving" value="false"/>
                </properties>
           </persistence-unit>
      </persistence>



      and my `jboss-web.xml` file is here below


      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <resource-ref>
      <res-ref-name>jdbc/iport</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <jndi-name>iport</jndi-name>
      <res-auth>Container</res-auth>
      </resource-ref>
      </jboss-web>



      and my `jboss-5.1.0.GA/server/default/deploy/iport-ds.xml` is here below...


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE datasources
      PUBLIC "-//JBoss//DTD JBOSS JCA Config 5.0//EN"
      "http://www.jboss.org/j2ee/dtd/jboss-ds_5_0.dtd">
      <datasources>
           <local-tx-datasource>
                <jndi-name>iport</jndi-name>
                <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
                <connection-url>jdbc:sqlserver://x.x.x.x:1433;databaseName=TEST</connection-url>
                <user-name>xx</user-name>
                <password>xx</password>
           </local-tx-datasource>
      </datasources>


      I think the whole problem with my datasource configuration.
      I don't know whether i need to use `<jta-data-source>` or `<non-jta-data-source>`

      Please please help me and tell me what i did wrong??
      Please help me...

      Edited by: sree4j on May 6, 2013 7:44 AM