3 Replies Latest reply on Jan 24, 2012 4:32 PM by anchaljain

    You are trying to use a connection factory that has been shut down

    abr

      Hi,

       

      I have an application running on jboss5 and sometime we lose the database connection.

      In the log I get this exception:

       

      12/Jan/2011 14:58:59 ERROR [STDERR] Caused by: javax.resource.ResourceException: You are trying to use a connection factory that has been shut down: ManagedConnectionFactory is null.

      12/Jan/2011 14:58:59 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:487)

      12/Jan/2011 14:58:59 ERROR [STDERR]     at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

      12/Jan/2011 14:58:59 ERROR [STDERR]     at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)

       

      I trying to investigate on this, but I don't really know how to start.

      If I restart jboss, the datasource are ok (my application works fine), but the administration console displays this datasource as unavailable.

       

      The strange thing is that I have other datasources that are marked as available.

       

      below the DS definition of the unavailable DS:

      <datasources>

          <local-tx-datasource>

              <jndi-name>jdbc/customerDS</jndi-name>

              <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:CUSTOMER</connection-url>

              <driver-class>oracle.jdbc.OracleDriver</driver-class>

              <user-name>ncgest</user-name>

              <password>Sec_52jlkhin_b4hdh</password>

              <track-statements>true</track-statements>

                      <min-pool-size>20</min-pool-size>

                      <max-pool-size>50</max-pool-size>

                      <idle-timeout-minutes>1</idle-timeout-minutes>

                      <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

                      <validate-on-match>false</validate-on-match>

                      <allocation-retry-wait-millis>200</allocation-retry-wait-millis>

          </local-tx-datasource>

      </datasources>

       

      and the definition of the available one:

      <datasources>

              <local-tx-datasource>

                      <jndi-name>jdbc/reportTxDS</jndi-name>

                      <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:REPORT

                      </connection-url>

                      <driver-class>oracle.jdbc.OracleDriver</driver-class>

                      <user-name>netreport</user-name>

                      <password>netreport</password>

                      <max-pool-size>5</max-pool-size>

                      <query-timeout>0</query-timeout>

              </local-tx-datasource>

      </datasources>

       

      My question is:

      Is there any way to know why the DS is marked as unavailable?

      How can it be marked as unavailable and still the application can access the database through the DS?

       

      Antoine

        • 1. You are trying to use a connection factory that has been shut down
          wdfink

          No idea ATM :-(

          What about if you set the parameter equal to the working one? Is it possible?

          Do you see WARN before the ERROR?

          Could you check both pool's within the jmx-console?

           

          Maybe setting

          org.jboss.resource.connectionmanager

          or

          org.jboss.resource

          will give hints.

          • 2. Re: You are trying to use a connection factory that has been shut down
            abr

            Wolf-Dieter Fink wrote:

             

            No idea ATM :-(

            What about if you set the parameter equal to the working one? Is it possible?

            Do you see WARN before the ERROR?

            Could you check both pool's within the jmx-console?

            I went to the Admin console, one datasourse is marked as "unavailable", Running State: UNKNOWN whereas the other is ok.

            The thing is that in spite of this, the application acceses the database.

             

            Maybe setting

            org.jboss.resource.connectionmanager

            or

            org.jboss.resource

            will give hints.

             

            OK, I've added those in my log4j conf file withe DEBUG level.

            There is no visible error concerning this datasource

            All I see is

            14/Jan/2011 14:10:22 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/customerDS' to JNDI name 'java:jdbc/customerDS'

             

            and the same for the other DS.

             

            Nevertheless  'jdbc/customerDS' is marked as unvailable in the jboss admin console.

            Is there anything else to troubleshoot a little further?

            • 3. Re: You are trying to use a connection factory that has been shut down
              anchaljain

              I am facing the same issue with one of our clients. Have you tried removing the tmp and work folders under jboss, restarting the jboss server and trying again?