5 Replies Latest reply on Jul 9, 2002 10:43 AM by Jamie Burns

    how to look up my DataSource

    Xbird Newbie

      after put my oracle-service.xml to the jboss deploy folder.(The database JNDI name is oradb)
      when i use following codes in my servlet:
      InitialContext jndiContext = new InitialContext();
      DataSource ds=(DataSource) jndiContext.lookup("java:comp/env/OracleDS");

      but jboss report javax.naming.NameNotFoundException: OracleDS not bound.

      how i can do?

        • 1. Re: how to look up my DataSource
          Xbird Newbie

          sorry ! JNDI name is:OracleDS

          • 2. Re: how to look up my DataSource
            Xbird Newbie

            messages given by jboss:
            10:38:37,328 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=OracleDS
            does not implement any Service methods
            10:39:04,640 INFO [JBossManagedConnectionPool] Creating
            10:39:04,656 INFO [JBossManagedConnectionPool] Created
            10:39:04,656 INFO [JBossManagedConnectionPool] Starting
            10:39:04,671 INFO [JBossManagedConnectionPool] Started
            10:39:04,671 INFO [MainDeployer] Successfully completed deployment of package:
            now i can get the DataSource via
            DataSource ds=(DataSource) jndiContext.lookup("java:/OracleDS");
            but i can not get a connecttion via:
            Connection con=ds.getConnection();

            • 3. Re: how to look up my DataSource
              David Jencks Master

              Maybe your db url or user/pw is wrong? Are the Oracle driver classes available? What exactly happens instead of getting the desired connection?

              • 4. Re: how to look up my DataSource
                shiva Newbie

                I am also facing same problem.
                One of the difference i found with deployment message hsql DefaultDS to the one i deploy for oracle is that in DefaultDS deployment it prints the jndi name java:/DefaultDS to which the data source is bound where as on deployoment of oracle data source, it doesn't give.
                I am still looking into cause .....

                • 5. Re: how to look up my DataSource
                  Jamie Burns Newbie

                  Was this ever resolved?