Unable to Add Comment to Confluence Page Due to NoClassDefFoundError
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
When attempting to add a comment to Confluence, the comment does not get posted but instead we see a long stack trace, which is not fully displayed - see the screenshot below:

[org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n\tat com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:99)\n\tat
And the following appears in the atlassian-confluence.log
:
2012-12-26 16:20:27,677 ERROR [TP-Processor8] [atlassian.event.internal.EventPublisherImpl] invokeListeners There was an exception thrown trying to dispatch event 'com.atlassian.confluence.event.events.content.comment.CommentCreateEvent[source=com.atlassian.confluence.pages.DefaultCommentManager@15dbefd]' from the invoker 'com.atlassian.event.internal.SingleParameterMethodListenerInvoker@3c4870'.
-- url: /wiki/rest/tinymce/1/content/9175075/comment | userName: xxxx | referer: https://xxxx/display/TAS/Test+Page+2
java.lang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:50)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:60)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1.execute(AsynchronousAbleEventDispatcher.java:28)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:56)
......
caused by: java.lang.reflect.UndeclaredThrowableException
at $Proxy1301.createOrUpdate(Unknown Source)
.....
Caused by: java.lang.NoClassDefFoundError: org/postgresql/jdbc4/Jdbc4ParameterMetaData
at org.postgresql.jdbc4.Jdbc4Statement.createParameterMetaData(Jdbc4Statement.java:46)
at org.postgresql.jdbc3.AbstractJdbc3Statement.getParameterMetaData(AbstractJdbc3Statement.java:418)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:221)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:221)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.getParameterMetaData(DelegatingPreparedStatement.java:221)
2012-12-26 16:20:27,754 ERROR [TP-Processor8] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service
-- url: /wiki/rest/tinymce/1/content/9175075/comment | userName: xxxx | referer: https://xxxx/display/TAS/Test+Page+2
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:695)
.....
at com.atlassian.confluence.tinymceplugin.rest.PageResource.createAndRender(PageResource.java:179)
at com.atlassian.confluence.tinymceplugin.rest.PageResource.add(PageResource.java:130)
.....
Cause
There seems to be a missing class of certain libraries or plugins. For this case, it seems to be caused by a corruption in plugin/library cache files or an incomplete plugin/library initialization during startup.
Resolution
To solve this issue, you need to clear the Confluence plugins cache, by following these steps:
Shutdown Confluence
Ensure the user running Confluence has full read/write privileges to the confluence-home directory.
Remove the following directories
⚠️ This will remove the plugin cache files only and will not permanently remove any plugins. These directories will be recreated during the next Confluence startup. However, some third-party plugins may store metadata in these directories, so we recommend creating a temporary backup of the directories.
<confluence-home>/bundled-plugins
<confluence-home>/plugins-cache
<confluence-home>/plugins-osgi-cache
<confluence-home>/plugins-temp
<confluence-home>/bundled-plugins_language
Start Confluence
Was this helpful?