11 Replies Latest reply on Aug 15, 2013 2:19 PM by dprakash

    javax.resource.ResourceException: IJ000453

    dprakash

      I am getting ResourceException: IJ000453 as follows:

       

      java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/APP-PostgresDB

       

      This occurs only after 4-5 hours from the start of the server and it also recovers back to normal state. It occurs many times in a day as well.

       

      Please help to resolve this issue.

       

      AS Version: 7.1.1

      DB: Postgres

       

       

      Configuration:

       

      <subsystem xmlns="urn:jboss:domain:datasources:1.0">

                <datasources>

                          <datasource jndi-name="java:/APP-PostgresDB" pool-name="PostgresDB" enabled="true">

                                    <connection-url>jdbc:postgresql://localhost:5432/appmgmt</connection-url>

                                    <driver>postgresql</driver>

                                    <pool>

                                              <min-pool-size>1</min-pool-size>

                                              <max-pool-size>100</max-pool-size>

                                    </pool>

                                    <validation>

                                              <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>

                                    </validation>

                                    <track-statements>TRUE</track-statements>

                          </datasource>

                          <drivers>

                                    <driver name="postgresql" module="org.postgresql">

                                              <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>

                                    </driver>

                          </drivers>

                </datasources>

      </subsystem>

        • 1. Re: javax.resource.ResourceException: IJ000453
          jaikiran

          What does the entire exception stacktrace look like?

          • 2. Re: javax.resource.ResourceException: IJ000453
            dprakash

            There is no stacktrace...I get only the logs like following:

             

            01:33:43,765 INFO  [stdout] (pool-19-thread-28) DBComp::GetConn::java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/APP-PostgresDB

            01:33:43,781 INFO  [stdout] (pool-19-thread-35) DBComp::GetConn::java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/APP-PostgresDB

            • 3. Re: javax.resource.ResourceException: IJ000453
              dprakash

              Do I need to enable any flag to get the stacktrace or is it just e.printStackTrace?

              • 4. Re: javax.resource.ResourceException: IJ000453
                jesper.pedersen

                Upgrade to latest nightly snapshot, and enable <cache-connection-manager debug="true"/> in :jca: - then watch out for connection leaks in the log

                • 5. Re: javax.resource.ResourceException: IJ000453
                  dprakash

                  Here is the stacktrace...

                   

                  DBComponent::GetConnection::java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/APP-PostgresDB

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23) java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/APP-PostgresDB

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:157)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at com.app.core.database.DBComp.getConnection(DBComp.java:48)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at java.lang.Thread.run(Unknown Source)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23) Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/APP-PostgresDB

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:390)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:368)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:464)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:149)

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           ... 8 more

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23) Caused by: javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (30000 [ms])

                  21:29:42,775 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:377)

                  21:29:42,791 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397)

                  21:29:42,791 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365)

                  21:29:42,791 ERROR [stderr] (pool-20-thread-23)           at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:329)

                  21:29:42,791 ERROR [stderr] (pool-20-thread-23)           ... 11 more

                  • 6. Re: javax.resource.ResourceException: IJ000453
                    dprakash

                    Some update on this will be very much helpful...

                    • 7. Re: javax.resource.ResourceException: IJ000453
                      jaikiran

                      Did you follow Jesper's suggestion? It most likely is a leak or the pool isn't big enough to handle the application's traffic.

                      • 8. Re: javax.resource.ResourceException: IJ000453
                        dprakash

                        Enabling cache-connection-manager shows the stacktraces for each database call even if close connection is in place. I am using AS 7.1.1.

                        Is the behaviour of the cache-connection-manager parameter different in latest snapshot?

                         

                        What could be the cause for IJ000655?

                        • 9. Re: javax.resource.ResourceException: IJ000453
                          rodrigo_sjbv

                          Hi Prakash,

                           

                          Did you found the solution of this problem? I'm still having the same issue!

                           

                          Thanks a lot

                           

                          Rodrigo

                          • 10. Re: javax.resource.ResourceException: IJ000453
                            wdfink

                            Do you see the same stacktrace with IJ000655: No managed connections available within configured blocking timeout (30000 [ms])

                            in that case you should enable the CCM debugging as Jesper mentioned.

                            Also you can check via ManagementConsole whether all connections are in use and blocked for a long time.

                             

                            If you enable CCM you will see a message "closing a connection for you" with a stacktrace.

                            You need to check your code because the connection received from pool but the code did not call .close() to put it back to pool.

                            • 11. Re: javax.resource.ResourceException: IJ000453
                              dprakash

                              Jboss version: AS 7.1.1

                               

                               

                              Issue faced: "ResourceException: IJ000453" due to "No managed connections available within configured blocking timeout (30000 [ms])"

                               

                               

                              The issue I was facing is related to the database connection request timeout.

                               

                               

                              This was happening due to large number of threads in the thread pool and the total number of possible database connection request which could have been possible at any given time was well above the max connection specified in the configuration if all the threads would have executed (this is valid under heavy traffic conditions).

                               

                               

                              I could suppress this issue by reducing the maximum number of database connections that could be possible from my code base at any given point in time just by decreasing(proportional) the thread count in the pools (by tuning the thread pools, no performance degrade).

                               

                               

                              Since then my application has not reported the resource exception and still going strong.

                               

                               

                              Options are:

                                        - Check if result sets/statements/connections are closed (Do not wait to close them by JBoss)

                                                  - To check this follow the suggestions by Jesper/Wolf-Dieter Fink

                                        - Tune your thread pool(s) if you are using

                                        - Log the number of opened connections using a bat file when you get the exceptionas this could give a rough idea

                                        - Increase the blocking-timeout-millis (By default 30s; this is not the ideal fix)

                                        - Increase the number of connections if and only if necessary