"Division by Zero" exception occured while doing "List Statistic" on Datasource, from EAP Admin Console

Solution Verified - Updated -

Issue

  • When calling the datasource statistic on an unused datasource, a division by zero exception occurs as no statistics will be shown:

        Following is the snippet of the exception stack trace:

     Caused by: java.lang.ArithmeticException: / by zero
        at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getAverageBlockTime(InternalManagedConnectionPool.java:591)

          Code snippet that generates a part of the report:

------------
InternalManagedConnectionPool.java:

   public long getAverageBlockTime()
   {
      return connectionCounter.getTotalBlockTime() / 
               getConnectionCreatedCount();
   }
-------------

Environment

  • JBoss Enterprise Application Platform 5.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.