NullPointerException on calculateLastModifiedDate Due to Null Value in Attachments Table
This only applies to versions of Confluence 5.5 and below unless the attachments were never migrated to disk which is now default and automatically migrated in any subsequent upgrade with a specific task.
Symptoms
The following appears in the atlassian-confluence.log
:
2008-11-03 12:41:27,120 ERROR [http-9080-Processor2] [[Standalone].\[localhost].[].[file-server]] invoke Servlet.service() for servlet file-server threw exception
java.lang.NullPointerException
at com.atlassian.plugin.servlet.util.LastModifiedHandler.calculateLastModifiedDate(LastModifiedHandler.java:54)
at com.atlassian.plugin.servlet.util.LastModifiedHandler.checkRequest(LastModifiedHandler.java:71)
at com.atlassian.confluence.servlet.download.AttachmentDownload.getStreamForDownload(AttachmentDownload.java:89)
at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload$StreamResultCallback.doInTransaction(ServeAfterTransactionDownload.java:129)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload.getStreamInTransaction(ServeAfterTransactionDownload.java:41)
at com.atlassian.confluence.servlet.download.ServeAfterTransactionDownload.serveFile(ServeAfterTransactionDownload.java:47)
at com.atlassian.plugin.servlet.BaseFileServerServlet.doGet(BaseFileServerServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Cause
This error can occur if your attachments.lastmoddate database table row contains invalid or null records.
Resolution
Always backup your data before performing any modifications to the database.
Populating the rows in attachments.lastmoddate with some valid dates.