7 Replies Latest reply on Jul 28, 2003 11:55 AM by akirdat

    NameNotFoundException

    akirdat

      Hi I am trying to use oracle as a datasource.
      Here is what I have in my oracle-ds.xml


      <xa-datasource>
      <jndi-name>OracleDS</jndi-name>
      <track-connection-by-tx>true</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:@db.myserver.com:1521:testdb</xa-datasource-property>
      <xa-datasource-property name="User">test</xa-datasource-property>
      <xa-datasource-property name="Password">test</xa-datasource-property>
      <min-pool-size>5</min-pool-size>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      </xa-datasource>


      <!--End -->

      In my jbosscmp-cmp.xml file I have:

      java:/OracleDS
      <datasource-mapping>Oracle9i</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>


      And throught that file in My EntityBeans I use

      java:/OracleDS
      <datasource-mapping>Oracle9i</datasource-mapping>

      Now, I keep getting an error :

      javax.naming.NameNotFoundException: OracleDS not bound

      I am using jboss-3.2.0.

      Can somebody please help me out?

        • 1. Re: NameNotFoundException
          akirdat

          I think this might be the problem but I am not sure:
          We are trying to migrate from weblogic and in there we had the client code bundled in with the EJBs in a single ear file.
          From what I can see only the client code is throwing the above exception.
          Any thoughts, advice from anybody?

          • 2. Re: NameNotFoundException
            sysuser1

            I have similar problem with MYSQL


            Depends On Me: org.jboss.deployment.DeploymentException: Error: can't find data
            source: java:/MySqlDs; - nested throwable: (javax.naming.NameNotFoundException:


            How to solve this ?

            • 3. Re: NameNotFoundException
              frito

              Look at your logfile. Probably the datasource is not deployed properly.
              Use the jmx-console (jndi view) to determine if the datasource is registered.
              If you are going to deploy the datasource with your .ear, put it into a .sar. It will be deployed before the ejb .jar files are deployed.

              Greetings,
              Frito

              • 4. Re: NameNotFoundException
                akirdat

                The DB pool is being created before the code deploys. From the JNDI-View my Connection pool is registered as java:/OracleDS. The EJBs compile fine too! It is only when the client code tries to do some DB interaction when it blows up.
                Also, the place where it blows up, the code is not trying to access an EJB rather it is trying to make a database connection to run Stored Procedure.

                Any help or advice would be appreciated.

                • 5. Re: NameNotFoundException
                  akirdat

                  I got it fixed!

                  • 6. Re: NameNotFoundException
                    gavin9

                    what was the problem?

                    please note that it is good manners to supply your solution to both the people who may have helped, and to people in a similar situation :)

                    • 7. Re: NameNotFoundException
                      akirdat

                      gavin9,
                      My apologies! The solution was actually a mistake on our part. Here is what we did wrong. We did not change the JNDI name of the datasource on the client side from the weblogic (OracleDS) to JBOSS compliant one (java:/OracleDS)

                      That change fixed our problems.