2 Replies Latest reply on Mar 13, 2002 10:34 AM by acarrillo

    jdbc not bound

    acarrillo

      I'm setting up my mySQL's jdbc datasource. I'm using Jboss 2.4.4. with Tomcat 4.0.1 on windows XP but when I'm trying to connect to DB appears the following error message ::

      "javax.naming.NameNotFoundException : jdbc not bound "

      I added mysql datasource to jboss.jcml here is:


      org.gjt.mm.mysql.Driver



      jdbc/PazHorowitzDb
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      jdbc:mysql://localhost/test
      1200000
      root
      10

      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0


      I copied mm.mysql-2.0.4-bin.jar file to jboss\lib\ext

      I have a class that connects to Db here is the code:

      Context jndiContext = new InitialContext();
      ds = (DataSource)jndiContext.lookup("java:jdbc/PazHorowitzDb");

      where jdbc/PazHorowitzDb is the datasource name

      I tested with classic connection way and It works

      Can anyone help please? because I need to start a project this week

      Thanks

        • 1. Re: jdbc not bound
          davidjencks

          1. check jndi view to make sure the datasource is bound and what it is really bound under.

          2. You might need java:/jdbc/PazHorowitzDb.

          3. Some parts of jboss at some times haven't liked to bind compound names. You might need to use just PazHorowitzDb and look up java:/PazHorowitzDb

          • 2. Re: jdbc not bound
            acarrillo

            I've just changed datasource name to only PazHorowitzDb on jboss.jcml . I checked java:Namespace here There's the PazHorowitzDb (class: org.jboss.pool.jdbc.xa.XAPoolDataSource) line. ds = (DataSource)jndiContext.lookup("java:/PazHorowitzDb"); is the line used to connect db on connection class.

            I have the following on server.log

            [10:12:21,139,ConfigurationService] PoolName set to PazHorowitzDb in DefaultDomain:service=XADataSource,name=PazHorowitzDb

            [10:12:21,149,ConfigurationService] DataSourceClass set to org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl in DefaultDomain:service=XADataSource,name=PazHorowitzDb

            [10:12:21,159,ConfigurationService] URL set to jdbc:mysql://localhost/test in DefaultDomain:service=XADataSource,name=PazHorowitzDb

            [10:12:21,159,ConfigurationService] GCMinIdleTime set to 1200000 in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,169,ConfigurationService] JDBCUser set to root in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,169,ConfigurationService] MaxSize set to 10 in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,169,ConfigurationService] GCEnabled set to false in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,179,ConfigurationService] InvalidateOnError set to false in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,179,ConfigurationService] TimestampUsed set to false in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,179,ConfigurationService] Blocking set to true in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,179,ConfigurationService] GCInterval set to 120000 in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,189,ConfigurationService] IdleTimeout set to 1800000 in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,189,ConfigurationService] IdleTimeoutEnabled set to false in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,199,ConfigurationService] LoggingEnabled set to false in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,199,ConfigurationService] MaxIdleTimeoutPercent set to 1.0 in DefaultDomain:service=XADataSource,name=PazHorowitzDb
            [10:12:21,199,ConfigurationService] MinSize set to 0 in DefaultDomain:service=XADataSource,name=PazHorowitzDb

            [10:12:22,131,JdbcProvider] Loaded JDBC-driver:org.gjt.mm.mysql.Driver
            [10:12:22,131,JdbcProvider] Initialized
            [10:12:22,141,PazHorowitzDb] Initializing
            [10:12:22,151,PazHorowitzDb] Initialized

            [10:12:23,473,PazHorowitzDb] Starting
            [10:12:23,613,PazHorowitzDb] XA Connection pool PazHorowitzDb bound to java:/PazHorowitzDb
            [10:12:23,943,PazHorowitzDb] Started

            But I have the same error message "jdbc not bound"


            Note. I tested with MinervaDS java:Namespace but I had the same error message too