Error occurred while starting component 'com.atlassian.jira.cache.monitor.CacheStatisticsMonitor'. caused by: org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:D

This question is in reference to Atlassian Documentation: Troubleshooting JIRA Startup Failed Error

Have just installed JIRA and get this error message when starting it up.

Error occurred while starting component 'com.atlassian.jira.cache.monitor.CacheStatisticsMonitor'. caused by: org.ofbiz.core.entity.GenericDataSourceException: Generic Entity Exception occurred in deleteByAnd (SQL Exception while executing the following:DELETE FROM PUBLIC.clusteredjob WHERE JOB_ID=? (The database has been closed [90098-185]))

Used express install and have not made any configuration.

 

1 answer

Hi Benny!

Your problem might have happened because the database connections are being dropped due to connection closures.

Explanation

When a database server reboots or a network failure has occurred, all connections in the database connection pool are broken. To overcome this issue, JIRA would normally need restarting (or for JIRA WAR distributions, the application server running JIRA would need restarting).

However, database connections in the database connection pool can be validated by running a simple SQL query. If a broken database connection is detected in the pool, a new one is created to replace it.

To do this, you need to specify an optional <validation-query/> element (in thedbconfig.xml file of your JIRA Home Directory), whose content is the query which validates connections in the database connection pool. See the following procedure for details.

To resolve your issue, you have to ensure that the validation query is set:

  1. Shut down JIRA (or the Tomcat installation running JIRA).
  2. Edit the dbconfig.xml file at the root of your JIRA Home Directory or use the Advanced tab of the JIRA Configuration Tool to configure the relevant settings.
  3. Configure the validation query for your type of database:
    • If editing the dbconfig.xml file, add the <validation-query/>element with the appropriate validation query for your type of database, as shown in the example below for MySQL. (See Determining the Validation Query below for details.)

      &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      
      &lt;jira-database-config&gt;
        &lt;name&gt;defaultDS&lt;/name&gt;
        &lt;delegator-name&gt;default&lt;/delegator-name&gt;
        &lt;database-type&gt;mysql&lt;/database-type&gt;
        &lt;jdbc-datasource&gt;
          &lt;url&gt;jdbc:mysql://dbserver:3306/jiradb?useUnicode=true&amp;amp;characterEncoding=UTF8&amp;amp;sessionVariables=storage_engine=InnoDB&lt;/url&gt;
          &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;
          &lt;username&gt;jiradbuser&lt;/username&gt;
          &lt;password&gt;password&lt;/password&gt;
          &lt;pool-min-size&gt;20&lt;/pool-min-size&gt;
          &lt;pool-max-size&gt;20&lt;/pool-max-size&gt;
          &lt;pool-max-wait&gt;30000&lt;/pool-max-wait&gt;
      
          &lt;validation-query&gt;select 1&lt;/validation-query&gt;
          &lt;min-evictable-idle-time-millis&gt;60000&lt;/min-evictable-idle-time-millis&gt;
          &lt;time-between-eviction-runs-millis&gt;300000&lt;/time-between-eviction-runs-millis&gt;
      
          &lt;pool-max-idle&gt;20&lt;/pool-max-idle&gt;
          &lt;pool-remove-abandoned&gt;true&lt;/pool-remove-abandoned&gt;
          &lt;pool-remove-abandoned-timeout&gt;300&lt;/pool-remove-abandoned-timeout&gt;
      
          &lt;pool-test-on-borrow&gt;false&lt;/pool-test-on-borrow&gt;
          &lt;pool-test-while-idle&gt;true&lt;/pool-test-while-idle&gt;
          &lt;validation-query-timeout&gt;3&lt;/validation-query-timeout&gt;
      
        &lt;/jdbc-datasource&gt;
      &lt;/jira-database-config&gt;
    • If using the JIRA Configuration Tool, on the Advanced tab, select theValidation Query check box and enter the appropriate validation query for your type of database. (See Determining the Validation Query below for details.)

  4. Specify a validation query timeout for your validation query, whose value is the appropriate length of time (in seconds) that the system should wait for a validation query to succeed before the system considers the database connection broken:
    • If editing the dbconfig.xml file, add the <validation-query-timeout/> element with the appropriate length of time (in seconds). warning This should only be done for MySQL.
    • If using the JIRA Configuration Tool, on the Advanced tab, select theValidation Query Timeout check box and enter the appropriate length of time (in seconds).
  5. Save your edited dbconfig.xml file (or click the Save button if using theJIRA Configuration Tool).

  6. Restart JIRA (or the Tomcat installation running JIRA).

Please Note

If you continue to have problems with connections closing, you may need to set the time-between-eviction-runs-millis parameter to a lower value or as a last resort, set test-on-borrow to true. For more information about test-on-borrow, see Tuning Database Connections - Connection pool settings section.

 

Hope this answer might help, and I wish you a good day laugh

Warm cheers,

Ezra A.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in United States

Topic Tuesday: What's your favorite topic?

Good morning All, Our goal is to get you into the habit of while enjoying your favorite morning drink you are checking the NOVA "space" for topics and comments. Your input is really needed and...

62 views 4 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you