9 Replies Latest reply on May 10, 2005 10:54 AM by Periannan Chandrasekaran

    Error: can't find data source: java:/DefaultDS

    Werner Baderschneider Newbie

      Hi,

      when I try to deploy the application as written in Nr. 4.1.8 of "getting started with JBoss 4.0", Release 3, I get the Error message you can see in the subject. Looking at the startup-log I find the following lines:

      -----------------------------
      14:52:41,015 INFO [STDOUT] [Server@16e1782]: Startup sequence completed in 515 ms.
      14:52:41,015 INFO [STDOUT] [Server@16e1782]: 2005-02-26 14:52:41.015 HSQLDB server 1.7.2 is online
      14:52:41,015 INFO [STDOUT] [Server@16e1782]: To close normally, connect and execute SHUTDOWN SQL
      14:52:41,015 INFO [STDOUT] [Server@16e1782]: From command line, use [Ctrl]+[C] to abort abruptly
      14:52:41,437 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      MBeans waiting for other MBeans:
      ObjectName: jboss.ejb:persistencePolicy=database,service=EJBTimerService
      state: CONFIGURED
      I Depend On: jboss.jca:name=DefaultDS,service=DataSourceBinding

      Depends On Me:
      ObjectName: jboss.mq:service=InvocationLayer,type=HTTP
      state: CONFIGURED
      I Depend On: jboss.mq:service=Invoker
      jboss.web:service=WebServer



      [...] (Some more of this, and then...)

      ObjectName: jboss.jca:name=DefaultDS,service=DataSourceBinding
      state: CONFIGURED
      I Depend On: jboss.jca:name=DefaultDS,service=LocalTxCM
      jboss:service=invoker,type=jrmp

      Depends On Me: jboss.ejb:persistencePolicy=database,service=EJBTimerService
      jboss:service=KeyGeneratorFactory,type=HiLo
      jboss.mq:service=StateManager
      jboss.mq:service=PersistenceManager


      MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
      ObjectName: jboss:database=localDB,service=Hypersonic
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: jboss.jca:name=DefaultDS,service=ManagedConnectionFactory
      ----------------------------------------------------------------


      Can anyone help me?

      Werner

        • 1. Re: Error: can't find data source: java:/DefaultDS
          Darran Lofthouse Master

          Have you made any changes to the default datasource?

          • 2. Re: Error: can't find data source: java:/DefaultDS
            Werner Baderschneider Newbie

            I did the changes to /server/default/deploy/hsqldb-ds.xml that are described in Chapter 4.1.7.1 (enabling one connection-url and mbean and disabling the other ones)

            • 3. Re: Error: can't find data source: java:/DefaultDS
              Werner Baderschneider Newbie

              I tried again. Installed JBoss4.0.1 from scratch, started it. Everything OK. Then changed hsqldb-ds.xml as written in Ch. 4.1.7.1 . Now I have the same startup log as above. Can anyone find a mistake in this hsqldb-ds.xml?

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

              <!-- The Hypersonic embedded database JCA connection factory config
              $Id: hsqldb-ds.xml,v 1.15 2004/09/15 14:37:40 loubyansky Exp $ -->



              <local-tx-datasource>

              <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
              <!-- Datasources are not available outside the virtual machine -->
              <jndi-name>DefaultDS</jndi-name>

              <!-- for tcp connection, allowing other processes to use the hsqldb
              database. This requires the org.jboss.jdbc.HypersonicDatabase mbean.-->
              <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>

              <!-- for totally in-memory db, not saved when jboss stops.
              The org.jboss.jdbc.HypersonicDatabase mbean necessary
              <connection-url>jdbc:hsqldb:.</connection-url>
              -->
              <!-- for in-process persistent db, saved when jboss stops. The
              org.jboss.jdbc.HypersonicDatabase mbean is necessary for properly db shutdown

              <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
              -->
              <!-- The driver class -->
              <driver-class>org.hsqldb.jdbcDriver</driver-class>

              <!-- The login and password -->
              <user-name>sa</user-name>


              <!--example of how to specify class that determines if exception means connection should be destroyed-->
              <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->

              <!-- this will be run before a managed connection is removed from the pool for use by a client-->
              <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->

              <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
              <min-pool-size>5</min-pool-size>

              <!-- The maximum connections in a pool/sub-pool -->
              <max-pool-size>20</max-pool-size>

              <!-- The time before an unused connection is destroyed -->
              <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
              <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
              <idle-timeout-minutes>0</idle-timeout-minutes>

              <!-- sql to call when connection is created
              <new-connection-sql>some arbitrary sql</new-connection-sql>
              -->

              <!-- sql to call on an existing pooled connection when it is obtained from pool
              <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
              -->

              <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
              <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
              -->

              <!-- Whether to check all statements are closed when the connection is returned to the pool,
              this is a debugging feature that should be turned off in production -->
              <track-statements/>

              <!-- Use the getConnection(user, pw) for logins
              <application-managed-security/>
              -->

              <!-- Use the security domain defined in conf/login-config.xml -->
              <security-domain>HsqlDbRealm</security-domain>

              <!-- Use the security domain defined in conf/login-config.xml or the
              getConnection(user, pw) for logins. The security domain takes precedence.
              <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
              -->

              <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

              <type-mapping>Hypersonic SQL</type-mapping>


              <!-- This mbean can be used when using in process persistent hypersonic -->
              jboss:service=Hypersonic,database=localDB
              </local-tx-datasource>

              <!-- This mbean should be used only when using tcp connections. Uncomment
              when the tcp based connection-url is used. -->

              1701
              true
              default
              false
              true



              <!-- This mbean can be used when using in process persistent db

              localDB
              true

              -->

              • 4. Re: Error: can't find data source: java:/DefaultDS
                Werner Baderschneider Newbie

                Looks like soliloquising.
                In my last post the xml-text seems to have been partly destroyed. The forum software seems to dislike some xml-tags. The part of hsqldb-ds.xml about mbean-declaration in the file is, different to what it looks like in my post, with correct xml-tags.

                • 5. SOLVED: Error: can't find data source: java:/DefaultDS
                  Werner Baderschneider Newbie

                  Seems as if the "Getting Started.."- document contains an error. The hsqldb-ds.xml contains a line

                  <depends>jboss:service=Hypersonic,database=localDB</depends>

                  According to the document you have to activate not the localDB-mbean, but the standalone-mbean. This leads to the error I got. Changing the line above to
                  <depends>jboss:service=Hypersonic</depends>

                  seems to solve the problem.

                  • 6. Re: Error: can't find data source: java:/DefaultDS
                    Ömür Camc? Newbie

                    i had your problem, and it is not solved only by your suggestion. In addition to your suggestion, i replaced all

                    <datasource>DefaultDS</datasource>


                    with

                    <datasource>java:/DefaultDS</datasource>


                    in the files "standardjaws.xml, standardjbosscmp-jdbc.xml" over "C:\jboss-4.0.1sp1\server\default\conf" and then so my problem is exactly solved

                    best regards,

                    • 7. Re: Error: can't find data source: java:/DefaultDS
                      daniel w Newbie

                      i had the same database issue using JBoss 4.0.2 as well as with
                      version [whatever the latest version of was with the latest CVS checkout on May 8].

                      The simple solution pointed out by zaphod68 seemed to work for me, namely
                      to change:


                      <depends>jboss:service=Hypersonic,database=localDB</depends>
                      

                      to


                      <depends>jboss:service=Hypersonic</depends>


                      No other changes, and it went just as the documentation said it would.

                      Thanks, zaphod68, for finding that...

                      If someone were to care to explain -why- this happened, that would be nice...





                      • 8. Re: Error: can't find data source: java:/DefaultDS
                        Periannan Chandrasekaran Newbie

                        I was just about to start posting exactly the same problem and found you guys discussing it.
                        I will try your suggestion.


                        Thanks
                        Chandra

                        • 9. Re: Error: can't find data source: java:/DefaultDS
                          Periannan Chandrasekaran Newbie

                          Just deleting the localDB phrase does it.
                          Startsup fine.

                          Thanks guys
                          Chandra