java.lang.IllegalStateException: Multiple plugins with the same key and version:com.atlassian.jira.ext.charting 2

Atlassian JIRA | Dieter Greiner | 4 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Hi Atlassian, I have noticed in catalina.out a flood of errors like these {code} Error getting plugins java.lang.IllegalStateException: Multiple plugins with the same key and version:com.atlassian.jira.ext.charting 2 at com.atlassian.jira.startup.PluginComparator.compare(PluginComparator.java:28) at com.atlassian.jira.startup.PluginComparator.compare(PluginComparator.java:7) at java.util.TreeMap.compare(TreeMap.java:1188) at java.util.TreeMap.put(TreeMap.java:531) at java.util.TreeSet.add(TreeSet.java:255) at java.util.AbstractCollection.addAll(AbstractCollection.java:334) at java.util.TreeSet.addAll(TreeSet.java:312) at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.getPlugins(ExtendedSystemInfoUtilsImpl.java:643) at org.apache.jsp._500page_jsp._jspService(_500page_jsp.java:1195) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) {code} Likely this is thrown when an error 500 occurs but this is not the problem. The problem is that ExtendedSystemInfoUtilsImpl.getPlugins() throws an IllegalStateException when run on JDK 1.7.0_13 but not on JDK 1.6.0_39. Since we need to switch to JDK 1.7 this bug has very high priority for us to be fixed. The problem likely lies in the different behaviour of JRE 6 and 7 when adding elements to an empty TreeSet. The problem can be reproduced with the following code in the Groovy Script Runner {code} import com.atlassian.jira.util.system.ExtendedSystemInfoUtils import com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl; import com.atlassian.jira.web.bean.I18nBean import com.atlassian.plugin.Plugin ExtendedSystemInfoUtils extendedSystemInfoUtils = new ExtendedSystemInfoUtilsImpl(new I18nBean(Locale.ENGLISH)); Collection<Plugin> plugins = extendedSystemInfoUtils.getPlugins() {code} I'm not sure if this behaviour came with JDK 1.7.0_13 or has been in JDK 1.7 since the beginning. Regards, Dieter h3. Workaround Move JIRA over to Java 6. Please note as per our [Supported Platforms|http://confluence.atlassian.com/display/JIRA/Supported+Platforms] Java 6 is not supported in JIRA 6. # Install Java 6 JRE/JDK. # Stop JIRA. # Change the {{$JAVA_HOME}} to point to the Java 6 JRE/JDK. # Clear our the plugin cache, as it is Java version dependent (starting up will cause failures if we don't clear it). To do so, remove the following directories: {noformat} $JIRA_HOME/plugins/.bundled_plugins $JIRA_HOME/plugins/.osgi_plugins {noformat} (i) These are temporary files and folders and will be recreated when JIRA starts. # Start JIRA. # Test you can create a Support Email.

    Atlassian JIRA | 4 years ago | Dieter Greiner
    java.lang.IllegalStateException: Multiple plugins with the same key and version:com.atlassian.jira.ext.charting 2
  2. 0

    Hi Atlassian, I have noticed in catalina.out a flood of errors like these {code} Error getting plugins java.lang.IllegalStateException: Multiple plugins with the same key and version:com.atlassian.jira.ext.charting 2 at com.atlassian.jira.startup.PluginComparator.compare(PluginComparator.java:28) at com.atlassian.jira.startup.PluginComparator.compare(PluginComparator.java:7) at java.util.TreeMap.compare(TreeMap.java:1188) at java.util.TreeMap.put(TreeMap.java:531) at java.util.TreeSet.add(TreeSet.java:255) at java.util.AbstractCollection.addAll(AbstractCollection.java:334) at java.util.TreeSet.addAll(TreeSet.java:312) at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.getPlugins(ExtendedSystemInfoUtilsImpl.java:643) at org.apache.jsp._500page_jsp._jspService(_500page_jsp.java:1195) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) {code} Likely this is thrown when an error 500 occurs but this is not the problem. The problem is that ExtendedSystemInfoUtilsImpl.getPlugins() throws an IllegalStateException when run on JDK 1.7.0_13 but not on JDK 1.6.0_39. Since we need to switch to JDK 1.7 this bug has very high priority for us to be fixed. The problem likely lies in the different behaviour of JRE 6 and 7 when adding elements to an empty TreeSet. The problem can be reproduced with the following code in the Groovy Script Runner {code} import com.atlassian.jira.util.system.ExtendedSystemInfoUtils import com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl; import com.atlassian.jira.web.bean.I18nBean import com.atlassian.plugin.Plugin ExtendedSystemInfoUtils extendedSystemInfoUtils = new ExtendedSystemInfoUtilsImpl(new I18nBean(Locale.ENGLISH)); Collection<Plugin> plugins = extendedSystemInfoUtils.getPlugins() {code} I'm not sure if this behaviour came with JDK 1.7.0_13 or has been in JDK 1.7 since the beginning. Regards, Dieter h3. Workaround Move JIRA over to Java 6. Please note as per our [Supported Platforms|http://confluence.atlassian.com/display/JIRA/Supported+Platforms] Java 6 is not supported in JIRA 6. # Install Java 6 JRE/JDK. # Stop JIRA. # Change the {{$JAVA_HOME}} to point to the Java 6 JRE/JDK. # Clear our the plugin cache, as it is Java version dependent (starting up will cause failures if we don't clear it). To do so, remove the following directories: {noformat} $JIRA_HOME/plugins/.bundled_plugins $JIRA_HOME/plugins/.osgi_plugins {noformat} (i) These are temporary files and folders and will be recreated when JIRA starts. # Start JIRA. # Test you can create a Support Email.

    Atlassian JIRA | 4 years ago | Dieter Greiner
    java.lang.IllegalStateException: Multiple plugins with the same key and version:com.atlassian.jira.ext.charting 2

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Multiple plugins with the same key and version:com.atlassian.jira.ext.charting 2

      at com.atlassian.jira.startup.PluginComparator.compare()
    2. com.atlassian.jira
      PluginComparator.compare
      1. com.atlassian.jira.startup.PluginComparator.compare(PluginComparator.java:28)
      2. com.atlassian.jira.startup.PluginComparator.compare(PluginComparator.java:7)
      2 frames
    3. Java RT
      TreeSet.addAll
      1. java.util.TreeMap.compare(TreeMap.java:1188)
      2. java.util.TreeMap.put(TreeMap.java:531)
      3. java.util.TreeSet.add(TreeSet.java:255)
      4. java.util.AbstractCollection.addAll(AbstractCollection.java:334)
      5. java.util.TreeSet.addAll(TreeSet.java:312)
      5 frames
    4. com.atlassian.jira
      ExtendedSystemInfoUtilsImpl.getPlugins
      1. com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.getPlugins(ExtendedSystemInfoUtilsImpl.java:643)
      1 frame
    5. org.apache.jsp
      _500page_jsp._jspService
      1. org.apache.jsp._500page_jsp._jspService(_500page_jsp.java:1195)
      1 frame
    6. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      1 frame
    8. GWT dev
      JspServlet.service
      1. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
      2. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      3. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
      3 frames