Jira server fails to start or functionality fails with ClassNotFoundException in logs

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

A JIRA application instance may encounter one of the below situations:

  1. The application may fail to start.
  2. Operations may throw a stack trace with a ClassNotFoundException or NoSuchMethodException

A stacktrace like the following appears in the atlassian-jira.log:

ERROR      [500ErrorPage.jsp] Exception caught in 500 page com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NoClassDefFoundError: com/opensymphony/user/User
com.atlassian.util.concurrent.LazyReference$InitializationException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NoClassDefFoundError: com/opensymphony/user/User
...
Caused by: java.lang.ClassNotFoundException: com.opensymphony.user.User
...
tip/resting Created with Sketch.

Note that any ClassNotFoundException or NoSuchMethodException has in general the same root cause.

Diagnosis

Carefully analyse the atlassian-jira.log file to identify the plugin that is causing these exceptions. Search the logs for the strings ClassNotFound, NoClassDefFound, or NoSuchMethod. In those stacktraces having a closer look at the reported class names will help to identify the plugin that is causing these error.

For example:

Example 1

 This string:

Caused by: java.lang.ClassNotFoundException: Class 'com.xiplink.jira.git.revisions.RevisionIndexService' not found.

Above this line, the below error can be noticed: 

2012-03-08 18:05:37,424 main ERROR [atlassian.jira.service.OfBizServiceConfigStore] Unable to create a service config for service with the name : Git Revision Indexing Service

This is the JIRA Git plugin which can be identified from the ERROR statement as well as the class name com.xiplink.jira.git.revisions.RevisionIndexService

Example 2

This error:

Caused by: java.lang.NoClassDefFoundError: com/opensymphony/user/User

Has the cause above it:

2012-03-08 18:36:40,666 Spring executor 20 ERROR [plugin.osgi.factory.OsgiPlugin] Unable to start the Spring context for plugin is.origo.jira.tempo-plugin

This is the Tempo Plugin.

By following the above procedure, in most case the plugin that needs to be upgraded or removed can be identified.

Example 3

 This string:

Caused by: java.lang.NoSuchMethodError: com.atlassian.jira.issue.customfields.searchers.DateTimeRangeSearcher.

Above this line, the below error can be noticed: 

The data before the upgrade has been exported to /var/atlassian/application-data/jira/export/jira_autoexport_20130612_052939.zip    2013-06-12 05:30:37 error  
Exception thrown during upgrade: java.lang.NoSuchMethodError: com.atlassian.jira.issue.customfields.searchers.DateTimeRangeSearcher.

This is the Charting plugin

Cause

A plugin is installed in the instance that is no longer compatible with the upgraded application version. 

Note that there may be some alternative causes, especially with JIRA applications EAR/WAR installation. See also NoClassDefFoundError in Tomcat EAR-WAR.

Resolution

  1. Stop JIRA
  2. Go to your the $JIRA-Home/plugins/installed-plugins directory
  3. Rename the $JIRA-Home/plugins/installed-plugins directory to $JIRA-Home/plugins/installed-plugins2

  4. Restart JIRA - This will re-create the the $JIRA-Home/plugins/installed-plugins directory but JIRA will start without any plugins
  5. If the issue is no longer reproducible, Reinstall the add-on with the latest version through the Administration > Add-ons > Find new add-ons page.
  6. You may later delete the $JIRA-Home/plugins/installed-plugins2 directory which is no longer in use. 

    Note that the later versions of JIRA applications natively bundles some plugins which were optional in the earlier versions. This can be checked by expanding the 'System Plugins' in the Universal Plugin Manager.

Last modified on Sep 25, 2019

Was this helpful?

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