Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-22388

JIRA plugins and (bundled-plugins) can fail with a NullPointerException if switching server from a Turkish to Non-Turkish locale or vise-versa

    XMLWordPrintable

Details

    Description

      Symptoms

      We had this happen.

      1. Customer started up JIRA under Turkish locale. JIRA does not work under Turkish locale.
      2. We told customer to start JIRA with "-Duser.language=en -Duser.country=US -Dfile.encoding=UTF8"
      3. Customer then gets:

      java.lang.NullPointerException
      	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.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:150)
      	at $Proxy106.getIssue(Unknown Source)
      	at com.pyxis.greenhopper.jira.util.collector.SummaryIssueStatsCollector.saveIssue(SummaryIssueStatsCollector.java:46)
      
      Workaround.

      Delete your $JIRA_HOME/plugins/.bundled-plugins and $JIRA_HOME/plugins/.osgi-plugins directories and then restart JIRA under the correct locale.

      Detailed Problem.

      The problem is that the .transformed-plugins/jira-greenhopper-plugin-5.2_1283493059000.jar has been created under the Turkish locale. It has an entry

        <beans:bean id="ıssueFactory" class="com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean">
          <beans:property name="filter" value="(&amp;(bean-name=ıssueFactory)(plugins-host=true))"/>
          <beans:property name="interfaces">
            <beans:list>
              <beans:value>com.atlassian.jira.issue.IssueFactory</beans:value>
            </beans:list>
          </beans:property>
        </beans:bean>
      

      Notice the special Turkish character "ı" in "ıssueFactory". This is generated from "IssueFactory".toLowerCase("tr", "TR"). Unfortunately when we started up JIRA under en_US the proxy (DynamicServiceInvocationHandler) around the IssueFactory in the Greenhopper plugin continued to look for an "ıssueFactory" but under the en_US locale it is registered under the "issueFactory" name. This causes the proxy to throw a NPE because it never finds the host service.

      Resource: http://www.mattryall.net/blog/2009/02/the-infamous-turkish-locale-bug

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bbain bain
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: