-
Bug
-
Resolution: Fixed
-
High
-
5.5.6, 5.6.6, 5.8.4, 5.8.5, 5.8.9, 5.9.1, 5.8.10, 5.8.14, 5.9.2, 5.8.17, 5.8.18
-
None
Database request is performed before each schedule job is run. If this request fails for any reason (e.g. connection timeout, not enough DB connections in the pool, table missing in DB), the scheduled job will be prevented from running until the instance is restarted.
This is the relevant stack trace:
org.quartz.SchedulerException: JobListener 'ScheduledJobListener' threw exception: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection [See nested exception: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection] at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1951) at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:364) at org.quartz.core.JobRunShell.run(JobRunShell.java:190) at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool.lambda$runInThread$187(ConfluenceQuartzThreadPool.java:19) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.exception.GenericJDBCException: Cannot open connection at org.springframework.orm.hibernate.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:473) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374) at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) at com.sun.proxy.$Proxy33.getTransaction(Unknown Source) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy142.jobToBeExecuted(Unknown Source) at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1949) ... 4 more Caused by: net.sf.hibernate.exception.GenericJDBCException: Cannot open connection at net.sf.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:80) at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69) at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) at net.sf.hibernate.impl.BatcherImpl.convert(BatcherImpl.java:328) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:295) at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3367) at org.springframework.orm.hibernate.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:422) ... 17 more Caused by: java.sql.SQLException: Cannot get a connection, pool error Timeout waiting for idle object at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:126) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:292) ... 20 more at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:446) at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360) at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:118) ... 23 more
Two job listeners are called when execution is starting:
- ExecutingJobsManager keeps a list of jobs which are executing
- ScheduledJobsListener saves execution details to database
If ScheduledJobsListener throws an exception, ExecutingJobsManager will not get notified that the execution got cancelled. Further executions get cancelled because AbstractJob#executeInternal(..) checks ExecutingJobsManager to see if similar (but not same) execution is already happening.
Workaround for Confluence 5.8
For users of Confluence 5.8.18, we are providing a patch file containing a fix for this issue. Please be aware that this patch has not been fully tested and is applied at your own risk. We strongly recommend that you test the patch on a staging instance of Confluence before applying it to a production instance. Refer to https://confluence.atlassian.com/doc/installing-patched-class-files-166528493.html for details on how to apply the patch. Also, make sure that the MaxWaitMillis is set to 10000 so that the connection pool got sometime to recover.
- relates to
-
CONFSERVER-40064 indexing stops working completely after intermittent connection issue
- Closed
- was split from
-
JRASERVER-3745 java.lang.reflect.UndeclaredThrowableException
- Closed
-
BAM-8869 PostChainAction (java.lang.NullPointerException : )
- Closed
-
CONFSERVER-2666 java.util.ConcurrentModificationException
- Closed
-
CONFSERVER-6567 HTML Include macro should rewrite relative links to point to remote site
- Closed
-
CONFSERVER-11838 Extra <html> in Custom HTML field breaks Custom HTML edit page
- Closed
-
CONFSERVER-33445 java.lang.UnsupportedOperationException on search
- Closed
-
JRASERVER-1909 java.io.NotSerializableException: org.apache.log4j.Logger
- Closed
-
JRASERVER-5750 Exception in thread "QuartzSchedulerThread" java.lang.ClassCastException: java.util.Date
- Closed
-
JRASERVER-29133 java.util.ConcurrentModificationException in logs
- Closed
-
CONFSERVER-20305 java.lang.ClassNotFoundException: com.atlassian.confluence.user.ConfluenceLoginInterceptor
- Closed
-
CONFSERVER-25656 Confluence HTML Macro giving "Unknown macro: html"
- Closed
-
I18N-783 HTML content not rendered as html in the InProduct Translation plugin
- Closed
-
JSWSERVER-11433 java.lang.NoClassDefFoundError
- Closed
-
BSERV-3169 Able to send HTML email
- Closed
-
CONFSERVER-868 Inline HTML Macro
- Closed
-
CONFSERVER-2692 Display HTML email as HTML
- Closed
-
CONFSERVER-7629 A secure html macro
- Closed
-
JRASERVER-2783 Change HTML icon for attachments
- Closed
-
JRASERVER-3186 Ability to use HTML on comments
- Closed
-
JRASERVER-19908 JiraVelocityUtils.java
- Closed
-
BAM-1831 HTML Emails
- Closed
- caused
-
HOT-35329 Loading...
- causes
-
HOT-35644 Loading...
- included in
-
CPU-171 Confluence 6.0.0-OD-2015.52.1-0001
-
CPU-179 Confluence 6.0.0-OD-2016.01.1-0002
-
CPU-180 Confluence 6.0.0-OD-2016.01.1-0003
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...