11 Replies Latest reply on Oct 11, 2013 7:13 AM by radhikarathi

    The DataSource is UNKNOWN run state

    frankv

      Hello,

       

      I'm new to JBoss ...
      I have installed jboss-5.1.0.GA and run it in default environment
      Before running it, I've put under JBOSS_HOME/server/default/libmysql-connector-java-5.1.10-bin.jar and I've taken from docs/examples/jca the mysql-ds.xml file that i've modified with the right database properties (connection url, user and password - same properties i've used with SQuirrel) and put to default/deploy.
      The admin console shows me an UNKNOWN run state for this datasource.
      Any ideas on where should I look at ?
      Thanks for your help
      Frank

        • 1. Re: The DataSource is UNKNOWN run state
          emuckenhuber

          Do you see any deployment exceptions in the console output or server.log ?

          • 2. Re: The DataSource is UNKNOWN run state
            frankv

            Hello,

             

            the only message related to my Datasource in server.log is the following:

             

            2010-04-27 14:37:59,747 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (main) Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySqlDS' to JNDI name 'java:MySqlDS'

             

            it's an INFO message

             

            Here is the mysql-ds.xml contents:

             

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

            <!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
            <!-- $Id: mysql-ds.xml 88948 2009-05-15 14:09:08Z jesper.pedersen $ -->
            <!--  Datasource config for MySQL using 3.0.9 available from:
            http://www.mysql.com/downloads/api-jdbc-stable.html
            -->

            <datasources>
              <local-tx-datasource>
                <jndi-name>MySqlDS</jndi-name>
                <connection-url>jdbc:mysql://localhost:3306/myDatabase</connection-url>
                <driver-class>com.mysql.jdbc.Driver</driver-class>
                <user-name>root</user-name>
                <password>frankv</password>
                <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
                <!-- should only be used on drivers after 3.22.1 with "ping" support
                <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
                -->
                <!-- 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 - MySQLValidConnectionChecker is preferred for newer drivers
                <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
                  -->

                <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
                <metadata>
                   <type-mapping>mySQL</type-mapping>
                </metadata>
              </local-tx-datasource>
            </datasources>

             

            I can access myDatabase from the MySQLAdministrator tool or SQuirreL tool

            At jboss admin console the datasource status is DOWN and Run State UNKNOWN

             

            Maybe the mysql connector is not at the right place (server/default/lib)

             

            Frank

            • 3. Re: The DataSource is UNKNOWN run state
              emuckenhuber

              Frank Vestris wrote:

               

              I can access myDatabase from the MySQLAdministrator tool or SQuirreL tool

              At jboss admin console the datasource status is DOWN and Run State UNKNOWN

               

              Hmm, in this case it might be just that the admin-console does not get the correct RunState. Therfore the DataSource is shown as unavailable. This is likely a bug and i'll see if i can find what's causing this.

              However there should be a "Test Connection" operation in the "Control" tab of the DS - so you might want to try that, if this operations is successful then you should be able to use the DataSource.

              • 4. Re: The DataSource is UNKNOWN run state
                frankv

                In the 'Control' tab of DS, there's no 'Test Connection' operation but 'Flush' , 'List Formatted Sub Pool Statistics' and 'List Statistics' : all operations are successful after hit them

                The JBoss version is 5.1 GA.

                Where can I find bugs ? (which url)

                Thanks

                • 5. Re: The DataSource is UNKNOWN run state
                  jaikiran

                  The "Test Connection" features isn't available in AS 5.1.0. It was added after 5.1.0 was released.

                  • 6. Re: The DataSource is UNKNOWN run state
                    frankv

                    I'm going to try it with JBoss 6

                    • 7. Re: The DataSource is UNKNOWN run state
                      frankv

                      So ....

                      I tried it in JBoss 6 and actually I could test the "Test Connection" button and the status is "Successful" but I still have the information:

                      MySqlDS "DOWN"

                      I've also tested with two others connectors versions: mysql-connector-java-5.0.8-bin.jar, mysql-connector-java-5.1.7-bin.jar ( initially  it was mysql-connector-java-5.1.10-bin.jar ) and it's the same behaviour.

                      • 8. Re: The DataSource is UNKNOWN run state
                        emuckenhuber

                        Frank Vestris wrote:

                         

                        I tried it in JBoss 6 and actually I could test the "Test Connection" button and the status is "Successful" but I still have the information:

                        MySqlDS "DOWN"

                        I've also tested with two others connectors versions: mysql-connector-java-5.0.8-bin.jar, mysql-connector-java-5.1.7-bin.jar ( initially  it was mysql-connector-java-5.1.10-bin.jar ) and it's the same behaviour.

                        Yes, the UNKOWN run state is a bug. This should be fixed as in the AS 6.0.0.M3 release, which should be available soon. So you maybe want to give it a try once released. The related jira is: http://jira.jboss.org/jira/browse/JBAS-7984

                        • 9. Re: The DataSource is UNKNOWN run state
                          frankv

                          Thank you Emanuel for your answer,

                           

                          I'll try the next release

                           

                          Frank

                          • 10. Re: The DataSource is UNKNOWN run state
                            acebass

                            Frank Vestris wrote:

                             

                            Yes, the UNKOWN run state is a bug. This should be fixed as in the AS 6.0.0.M3 release, which should be available soon. So you maybe want to give it a try once released. The related jira is: http://jira.jboss.org/jira/browse/JBAS-7984

                             

                            We are using 5.1.0 and I get this when attempting to run 2 instances on the same machine, however, I do not have the luxury of being able to change versions, so is there a work around for those of us who are not able to upgrade....

                            • 11. Re: The DataSource is UNKNOWN run state
                              radhikarathi


                              For th people who dont have flexibility to upgrade JBOSS can go with this workaround. Since jndi created in JBOSS 5.1.0 works with specific jndi names (not sure which logic it uses). Hence, try to keep the Jndi name such that which is always in UP state. Later keep changing its connection properties to connect to different machines. Hope this helps !!!