java.util.Date can't be cast to java.sql.Timestamp - exception while upgrading

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

The following appears in the atlassian-jira.log:

IssueIndexer:thread-3 INFO [jira.upgrade.tasks.UpgradeTask_Build646] Re-indexing is 82% complete. Current index: Issue
main ERROR [atlassian.jira.upgrade.UpgradeManagerImpl] Exception thrown during upgrade: java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp
at com.atlassian.jira.index.FutureResult.await(FutureResult.java:35)
at com.atlassian.jira.index.CompositeResultBuilder$CompositeResult.await(CompositeResultBuilder.java:82)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.atlassian.util.profiling.object.ObjectProfiler.profiledInvoke(ObjectProfiler.java:81)
at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:28)
at $Proxy131.reIndexAll(Unknown Source)
at com.atlassian.jira.util.index.IndexLifecycleManager$Composite.reIndexAll(IndexLifecycleManager.java:112)
at com.atlassian.jira.upgrade.tasks.AbstractReindexUpgradeTask.doUpgrade(AbstractReindexUpgradeTask.java:43) 

Also, following appears in the atlassian-jira.log:

main ERROR [jira.issue.managers.DefaultCustomFieldManager] Could not load custom field type plugin with key 'com.pyxis.greenhopper.jira:greenhopper-ranking'. Is the plugin present and enabled? 2011-09-22 11:34:36,335 main ERROR [jira.issue.managers.DefaultCustomFieldManager] Could not load custom field type plugin with key 'com.pyxis.greenhopper.jira:greenhopper-releasedmultiversionhistory'. Is the plugin present and enabled? 2011-09-22 11:34:36,355 main ERROR [jira.issue.managers.DefaultCustomFieldManager] Could not load custom field type plugin with key 'org.deblauwe.jira.plugin.database-values-plugin:databasevaluesselectionfield'. Is the plugin present and enabled?

Cause

Some custom field records are corrupted or wrongly generated by 3rd party plugin in the database. 
There are some third party plugins installed on the instance, most likely the JIRA application enhancer which are not compatible with versions of JIRA applications. 

Resolution

  1. Upgrade or disable the faulty plugin (example : JIRA application enhancer).
  2. After this, re-index the instance. This should fix the problem.

Last modified on Nov 25, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.