"Division by Zero" exception occured while doing "List Statistic" on Datasource, from EAP Admin Console
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, tools, and much more.