9 Replies Latest reply on Feb 28, 2011 5:32 AM by Prasad Deshpande Branched to a new discussion.

    jboss 6 jpa datasource jndi not bound error

    Prasad Deshpande Expert

      Hi,

       

      I'm having trouble with JBoss 6 & JPA. I have a persistence.xml like this :

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence">

                <persistence-unit name="efp">

                          <jta-data-source>jdbc/eFpDataSource</jta-data-source>

                          <provider>org.hibernate.ejb.HibernatePersistence</provider>

                          <properties>

                                    <property name="hibernate.show_sql" value="false"/>

                                    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

                                    <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                          </properties>

                </persistence-unit>

      </persistence>

       

      and have Datasource definition as:

       

        <xa-datasource>

          <jndi-name>jdbc/eFpDataSource</jndi-name>

          <track-connection-by-tx/>

          <isSameRM-override-value>false</isSameRM-override-value>

          <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

          <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:PR</xa-datasource-property>

          <xa-datasource-property name="User">PRO</xa-datasource-property>

          <xa-datasource-property name="Password">PRO</xa-datasource-property>

          <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->

          <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->

          <!-- Checks the Oracle error codes and messages for fatal errors -->

          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

            <metadata>

               <type-mapping>Oracle9i</type-mapping>

            </metadata>

                <min-pool-size>10</min-pool-size>

                <max-pool-size>100</max-pool-size>

          <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

          <no-tx-separate-pools/>

        </xa-datasource>

       

      I get logs saying datasource deployed & bound properly:

      09:22:16,750 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/eFpDataSource' to JNDI name 'java:jdbc/eFpDataSource'

       

      I get exception while deploying persistence unit as:

       

      09:24:40,937 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=efp.ear/efprocess.jar#efp state=Create: javax.naming.NameNotFoundException: jdbc not bound

                at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]

                at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]

                at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]

                at org.jnp.server.NamingServer.lookup(NamingServer.java:396) [:5.0.5.Final]

                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]

                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]

                at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_22]

                at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:120) [:2.0.0]

                at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:252) [:1.0.2-alpha-3]

       

       

      Same configuration works fine on JBoss 5.1.0. I'm trying to port it to JBoss 6. Any idea what's going wrong?

        • 1. jboss 6 jpa datasource jndi not bound error
          jaikiran pai Master

          By default the datasources are bound in java: namespace. So change your persistence.xml from

           

          <jta-data-source>jdbc/eFpDataSource</jta-data-source>

           

          to

           

          <jta-data-source>java:jdbc/eFpDataSource</jta-data-source>

          • 2. jboss 6 jpa datasource jndi not bound error
            Prasad Deshpande Expert

            I tried on nighty build http://hudson.jboss.org/hudson/view/JBoss%20AS/job/JBoss-AS-6.0.x/ as well, same error

             

            09:52:12,484 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=efp.ear/efprocess.jar#efp state=Create: javax.naming.NameNotFoundException: jdbc not bound

                      at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]

                      at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]

                      at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]

                      at org.jnp.server.NamingServer.lookup(NamingServer.java:396) [:5.0.5.Final]

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]

                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]

                      at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_22]

                      at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:120) [:3.0.0-alpha-5]

                      at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:252) [:3.0.0-alpha-5]

                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

            • 3. jboss 6 jpa datasource jndi not bound error
              Prasad Deshpande Expert

              Thanks for reply Jaikiran,

               

              I knew you'll be fastest one to reply.

               

              I tried your suggestion already looking at logs that it prints on the console while deploying DS.  Neither "java:jdbc/eFpDataSource" nor "java:/jdbc/eFpDataSource" worked. I tried removing leading "jdbc/" from DS & persistence.xml both as well, it gave me error "eFpDataSource" not bound.I Also looked at example of DefaultDS & jboss-ejb3-timerservice-mk2.jar. That is getting deployed,

               

              09:50:15,312 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'

              09:50:15,812 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb

               

              Not sure what's wrong with my persistence.xml

              • 4. jboss 6 jpa datasource jndi not bound error
                jaikiran pai Master

                What is the exact name of your datasource file and where exactly is it placed? And can you post the entire exception stacktrace and also the complete datasource file?

                • 5. jboss 6 jpa datasource jndi not bound error
                  Prasad Deshpande Expert

                  here is my "efp-ds.xml" datasource file, It is placed in deploy directory of my domain:

                   

                  <?xml version="1.0" encoding="UTF-8"?>

                  <datasources>

                    <local-tx-datasource>

                      <jndi-name>jdbc/eFpNonXADataSource</jndi-name>

                      <connection-url>jdbc:oracle:thin:@localhost:1521:PR</connection-url>

                      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

                  <user-name>PRO</user-name>

                  <password>PRO</password>

                      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

                        <metadata>

                           <type-mapping>Oracle9i</type-mapping>

                        </metadata>

                            <min-pool-size>10</min-pool-size>

                            <min-pool-size>30</min-pool-size>

                    </local-tx-datasource>

                   

                    <xa-datasource>

                      <jndi-name>jdbc/eFpDataSource</jndi-name>

                      <track-connection-by-tx/>

                      <isSameRM-override-value>false</isSameRM-override-value>

                      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

                      <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:PR</xa-datasource-property>

                      <xa-datasource-property name="User">PRO</xa-datasource-property>

                      <xa-datasource-property name="Password">PRO</xa-datasource-property>

                      <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->

                      <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->

                      <!-- Checks the Oracle error codes and messages for fatal errors -->

                      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

                        <metadata>

                           <type-mapping>Oracle9i</type-mapping>

                        </metadata>

                            <min-pool-size>10</min-pool-size>

                            <max-pool-size>100</max-pool-size>

                      <no-tx-separate-pools/>

                    </xa-datasource>

                   

                    <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"

                           name="jboss.jca:service=OracleXAExceptionFormatter">

                      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>

                    </mbean>

                  </datasources>

                   

                  I can see data source is deployed in logs:

                  10:06:23,890 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/eFpNonXADataSource' to JNDI name 'java:jdbc/eFpNonXADataSource'

                  10:06:24,031 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/eFpDataSource' to JNDI name 'java:jdbc/eFpDataSource'

                  10:06:24,859 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'

                   

                   

                  And here is complete stacktrace:

                   

                  10:07:09,656 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=efp.ear/efprocess.jar#efp state=Create: javax.naming.NameNotFoundException: jdbc not bound

                            at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]

                            at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]

                            at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]

                            at org.jnp.server.NamingServer.lookup(NamingServer.java:396) [:5.0.5.Final]

                            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]

                            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]

                            at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_22]

                            at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:120) [:3.0.0-alpha-5]

                            at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:252) [:3.0.0-alpha-5]

                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_22]

                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_22]

                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_22]

                            at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_22]

                            at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60) [jboss-reflect.jar:2.2.1.GA]

                            at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:168) [jboss-reflect.jar:2.2.1.GA]

                            at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) [jboss-reflect.jar:2.2.1.GA]

                            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:202) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]

                            at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]

                            at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]

                            at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]

                            at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]

                            at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.1.0-SNAPSHOT]

                            at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

                            at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

                            at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

                            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

                            at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]

                            at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]

                            at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]

                            at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]

                            at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]

                            at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]

                            at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]

                            at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.1.0-SNAPSHOT]

                            at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.1.0-SNAPSHOT]

                            at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

                            at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

                            at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]

                   

                  Please let me know if you need any information.

                   

                  Thanks,

                  Prasad

                  • 6. jboss 6 jpa datasource jndi not bound error
                    Prasad Deshpande Expert

                    Just for your information,

                     

                    I can see datasource in my JNDI tree:

                     

                    java: Namespace

                     

                      +- securityManagement (class: org.jboss.security.integration.JNDIBasedSecurityManagement)
                      +- comp (class: javax.naming.Context)
                      |   +- TransactionSynchronizationRegistry[link -> java:TransactionSynchronizationRegistry] (class: javax.naming.LinkRef)
                      |   +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
                      |   +- env (class: org.jnp.interfaces.NamingContext)
                      |   |   +- security (class: org.jnp.interfaces.NamingContext)
                      |   |   |   +- securityMgr[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
                      |   |   |   +- subject[link -> java:/jaas/jboss-web-policy/subject] (class: javax.naming.LinkRef)
                      |   |   |   +- realmMapping[link -> java:/jaas/jboss-web-policy/realmMapping] (class: javax.naming.LinkRef)
                      |   |   |   +- security-domain[link -> java:/jaas/jboss-web-policy] (class: javax.naming.LinkRef)
                      |   |   |   +- authorizationMgr[link -> java:/jaas/jboss-web-policy/authorizationMgr] (class: javax.naming.LinkRef)
                      |   +- ORB[link -> java:/JBossCorbaORB] (class: javax.naming.LinkRef)
                      |   +- BeanManager (class: org.jnp.interfaces.MarshalledValuePair)
                      |   +- ModuleName (class: java.lang.String)
                      +- XAConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
                      +- JmsXA (class: org.hornetq.ra.HornetQRAConnectionFactoryImpl)
                      +- policyRegistration (class: org.jboss.security.plugins.JBossPolicyRegistration)
                      +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
                      +- app (class: javax.naming.Context)
                      |   +- jmx-console (class: org.jnp.interfaces.NamingContext)
                      |   +- AppName (class: java.lang.String)
                      +- Mail (class: javax.mail.Session)
                      +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
                      +- ProfileService (class: org.jboss.profileservice.AbstractProfileService)
                      +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                      +- jaas (class: javax.naming.Context)
                      |   +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
                      |   +- hornetq (class: org.jboss.security.plugins.SecurityDomainContext)
                      +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
                      +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
                      +- ConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
                      +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
                      +- jdbc (class: org.jnp.interfaces.NamingContext)
                      |   +- eFpDataSource (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                      |   +- eFpNonXADataSource (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
                      +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)
                    • 7. jboss 6 jpa datasource jndi not bound error
                      jaikiran pai Master

                      There are only 2 things that I can think of:

                       

                      1) The persistence.xml isn't using the correct value for the jta-data-source. Are you sure you changed the correct one to use java: namespace prefix

                      2) Some dependency issue. Hmm, looking at the log timings this can be ruled out safely.

                       

                      How is your application packaged by the way? Does it have any jndi.properties? Can you post the contents of the .ear/.jar/.war?

                      1 of 1 people found this helpful
                      • 8. jboss 6 jpa datasource jndi not bound error
                        Prasad Deshpande Expert

                        I've changed persistence.xml.. I can paste corrected file again here...

                        <?xml version="1.0" encoding="UTF-8"?>

                        <persistence xmlns="http://java.sun.com/xml/ns/persistence">

                                  <persistence-unit name="efp" transaction-type="JTA">

                                            <jta-data-source>java:jdbc/eFpDataSource</jta-data-source>

                                            <provider>org.hibernate.ejb.HibernatePersistence</provider>

                                            <properties>

                                                      <property name="hibernate.show_sql" value="false"/>

                                                      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

                                                      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

                                            </properties>

                                  </persistence-unit>

                        </persistence>

                         

                        Yes, my application does contain "jndi.properties" in lib/jndi-properties.jar, I tried taking that out or leaving as it is... doesn't make any difference..

                         

                        I tried deploying just jar in ear without any war.. result was same.

                         

                        Here is the structure of my ear...

                         

                        ear structure...........

                         

                         

                        META-INF/

                        META-INF/MANIFEST.MF

                        META-INF/application.xml

                        startup.war

                        efprocess.jar

                        lib/<3rd party jars>

                        lib/entities.jar

                        lib/interfaces.jar

                        lib/jndi-properties.jar

                        ======================================================

                         

                         

                        efprocess.jar (all session/mdb ejb3) structure........

                         

                         

                        META-INF/

                        META-INF/MANIFEST.MF

                        mappings/

                        mappings/eFp.hbm.xml

                        com/........................<all classes>

                        ======================================================

                         

                         

                        lib/entities.jar contains POJO entities & persistence.xml

                         

                         

                        META-INF/

                        META-INF/MANIFEST.MF

                        META-INF/persistence.xml

                        com/............<all pojo classes>

                        =======================================================

                         

                        As I said earlier, the same application wothout any change works fine on JBoss 5.1.0, not sure what's the problem here.

                        • 9. jboss 6 jpa datasource jndi not bound error
                          Prasad Deshpande Expert

                          I figured out problem, it was due to I had jboss-jmx.jar in the lib directory of my ear.  I removed it & it deployed persistence unit.