<!DOCTYPE html>
<!-- Server: sfn-web-3 -->


  










<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]>--> <html lang="en" class="no-js"> <!--<![endif]-->
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
    <title>Joda - Time / Bugs / #3 NullPointerException in ISOChronology</title>
    

<script src="http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/js/sftheme/modernizr.custom.90514.js"></script>

<script src="http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/js/sftheme/jquery-1.8.0.min.js"></script>

<script src="http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/js/sftheme/header.js"></script>
<!--[if lt IE 7 ]>
  <script src="http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/js/sftheme/dd_belatedpng.js"></script>
  <script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
<![endif]-->
<link href='//fonts.googleapis.com/css?family=Ubuntu:regular' rel='stylesheet' type='text/css'>
<style type="text/css">
    @font-face {
        font-family: "Pictos";
        src: url('http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.eot');
        src: local("☺"), url('http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.woff') format('woff'), url('http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.ttf') format('truetype'), url('http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/css/fonts/sftheme/pictos-web.svg') format('svg');
    }
</style>
    <script type="text/javascript">
            /*jslint onevar: false, nomen: false, evil: true, css: true, plusplus: false, white: false, forin: true, on: true, immed: false */
            /*global confirm, alert, unescape, window, jQuery, $, net, COMSCORE */
    </script>
    
      <!-- ew:head_css -->

    
      <link rel="stylesheet"
                type="text/css"
                href="http://a.fsdn.com/allura/nf/1362067951/_ew_/_slim/css?href=allura%2Fcss%2Fforge%2Fhilite.css%3Btool%2Ftickets%2Fcss%2Ftracker.css"
                >
    
      <link rel="stylesheet"
                type="text/css"
                href="http://a.fsdn.com/allura/nf/1362067951/_ew_/theme/sftheme/css/forge.css"
                >
    
      <link rel="stylesheet"
                type="text/css"
                href="http://a.fsdn.com/allura/nf/1362067951/_ew_/_slim/css?href=css%2Fmarkitup_sf.css%3Bcss%2Fpage_list.css"
                >
    
      <style>
            input.label_edit{ float: left; }
            .tagEditor{
                margin: 4px 0;
                padding: 0;
                float: left;
            }

            .tagEditor li, .removable{
                display: inline;
                background-image: url('http://a.fsdn.com/allura/nf/1362067951/_static_/images/minus_small.png');
                background-color: #eef;
                background-position: right center;
                background-repeat: no-repeat;
                list-style-type: none;
                padding: 0 18px 0 6px;
                margin: 0 4px;
                cursor: pointer;
                -moz-border-radius: 5px;
                -webkit-border-radius: 5px;
            }

            .tagEditor li:hover{
                background-color: #ebebeb;
            }</style>
    
      <link rel="stylesheet"
                type="text/css"
                href="http://a.fsdn.com/allura/nf/1362067951/_ew_/_slim/css?href=css%2Fautocomplete.css"
                >
    
      
<!-- /ew:head_css -->

    
    
    
      <!-- ew:head_js -->

    
      
<!-- /ew:head_js -->

    
    

    
      <style type="text/css">
        #page-body.project---init-- #top_nav { display: none; }
#page-body.project---init-- #nav_menu_holder { display: none; margin-bottom: 0; }
#page-body.project---init-- #content_base {margin-top: 0; }
      </style>
    
    
<style type="text/css">
  input[name='ticket_form.summary']{
    top: 5px;
    position: absolute;
    z-index: 21;
  }
  div.form_holder .reply textarea{
    height: 60px;
  }
  div.actions{
    width: 150px;
  }
  .markdown_edit textarea {
    height: 100px;
  }
</style>

      <style>.XbCVcBhvaptSSQArHJwo { display:none }</style>

    
  <link rel="alternate" type="application/rss+xml" title="RSS" href="feed.rss"/>
  <link rel="alternate" type="application/atom+xml" title="Atom" href="feed.atom"/>

    
    


<script type="text/javascript">
    var _gaq = _gaq || [];

    function _add_tracking(prefix, tracking_id, send_user) {
        _gaq.push([prefix+'._setAccount', tracking_id]);
        _gaq.push([prefix+'._setCustomVar', 1, 'Page Type', 'Tickets', 3]);_gaq.push([prefix+'._trackPageview']);
    }
      _add_tracking('sfnt1', 'UA-32013-6', true);
      _add_tracking('sfnt2', 'UA-36130941-1', true);
    

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
</script>
  </head>

  <body id="forge">
    
      <!-- ew:body_top_js -->

    
      
<!-- /ew:body_top_js -->

    
    
<header id="site-header">
    <div class="wrapper">
        <a href="/" class="logo">
            <span>SourceForge</span>
        </a>
        
        <form method="get" action="/directory/">
            <input type="text" id="words" name="q" placeholder="Search">
        </form>
        
        <!--Switch to {language}-->
        <nav id="nav-site">
            <a href="/directory/" title="Browse our software.">Browse</a>
            <a href="/blog/" title="Read the latest news from the SF HQ.">Blog</a>
            <a href="/support" title="Contact us for help and feedback.">Help</a>
            <a href="/jobs?source=header" title="Search 80k+ tech jobs." class="featured-link">Jobs</a>
        </nav>
        <nav id="nav-account">
            
              <div class="logged_out">
                <a href="/account/login.php">Log In</a>
                <span>or</span>
                <a href="https://sourceforge.net/user/registration/">Join</a>
              </div>
            
        </nav>
        
    </div>
</header>
<header id="site-sec-header">
    <div class="wrapper">
        <nav id="nav-hubs">
            <h4>Solution Centers</h4>
            <a href="http://ibmsmartercommerce.sourceforge.net/">Smarter Commerce</a>
            <a href="http://goparallel.sourceforge.net/">Go Parallel</a>
            <a href="http://html5center.sourceforge.net/">HTML5</a>
            <a href="http://ibmsmarteritservices.sourceforge.net/">Smarter IT</a>
        </nav>
        <nav id="nav-collateral">
            <a href="http://library.geeknetmedia.com">Resources</a>
            
            <a href="">Newsletters</a>
            
        </nav>
    </div>
</header>
    
    <section id="page-body" class=" neighborhood-Projects project-joda-time mountpoint-bugs">
	  <div class="grid-24" id="nav_menu_holder">
            
            


  
  <a href="/p/joda-time/">
    
	<h1 class="project_title">
      
        Joda - Time
      
	</h1>
	</a>

            
      </div>
      <div id="top_nav" class="">
        
        
  
    <a href="/projects/joda-time/" class="ui-icon-tool-summary">
      Summary
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/wiki/" class="ui-icon-tool-wiki">
      Wiki
      
        
      
      
      
    </a>
	
    <a href="/projects/joda-time/files/" class="ui-icon-tool-files">
      Files
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/mailman/" class="ui-icon-tool-mailman">
      Mailing Lists
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/code/" class="ui-icon-tool-git">
      Code
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/svn/" class="ui-icon-tool-svn">
      Svn
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/_list/tickets" class="ui-icon-tool-tickets">
      Tickets
      
        
          <span class="diamond"></span>
        
      
      
      
        <span class="tool-count">2</span>
      
    </a>
	
    <a href="/p/joda-time/news/" class="ui-icon-tool-blog">
      News
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/discussion/" class="ui-icon-tool-discussion">
      Discussion
      
        
      
      
      
    </a>
	
    <a href="/p/joda-time/donate/" class="ui-icon-tool-link">
      Donate
      
        
      
      
      
    </a>
	
	<div style="clear:both"></div>

        
      </div>
      <div id="content_base">
			  
			    
          


<div id="sidebar">
  
    <form id="search" method="GET" action="/p/joda-time/bugs/search/">
      <input name="q" type="text" title="Search Bugs" placeholder="Search Bugs">
    </form>
  
    
    
      
        
    
      <ul class="sidebarmenu">
      
    
    <li>
      <a href="/p/joda-time/bugs/stats"><b data-icon="Y" class="ico ico-stats"></b> <span>View Stats</span></a>
    </li>
  
      
        
    
      </ul>
      
    
    
      <h3 class="">Group</h3>
    
  
      
        
    
      <ul class="sidebarmenu">
      
    
    <li>
      <a href="/p/joda-time/bugs/milestone/v1.0_%28example%29/" class="milestones"><span>v1.0_(example)</span></a>
    </li>
  
      
        
    
      </ul>
      
    
    
      <h3 class="">Searches</h3>
    
  
      
        
    
      <ul class="sidebarmenu">
      
    
    <li>
      <a href="/p/joda-time/bugs/search/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed&amp;sort=mod_date_dt+desc" class="search_bin"><span>Changes</span></a>
    </li>
  
      
        
    
    <li>
      <a href="/p/joda-time/bugs/search/?q=status%3Awont-fix+or+status%3Aclosed" class="search_bin"><span>Closed Tickets</span></a>
    </li>
  
      
        
    
    <li>
      <a href="/p/joda-time/bugs/search/?q=%21status%3Awont-fix+%26%26+%21status%3Aclosed" class="search_bin"><span>Open Tickets</span></a>
    </li>
  
      
        
    
      </ul>
      
    
    
      <h3 class="">Help</h3>
    
  
      
        
    
      <ul class="sidebarmenu">
      
    
    <li>
      <a href="/p/joda-time/bugs/markdown_syntax"><span>Formatting Help</span></a>
    </li>
  
      
    
    
      </ul>
      
    
    
      <script>
                $(function() {
            $.ajax({
                url:'/p/joda-time/bugs/bin_counts',
                success: function(data) {
                    $.each(data.bin_counts, function(i, item) {
                        var $span = $('.search_bin span:contains("' + item.label + '")');
                        if ($span) {
                            $span.after('<small>' + item.count + '</small>').fadeIn('fast');
                        }
                    });
                }
            });
            if ($('.milestones').length > 0) {
                $.ajax({
                    url: '/p/joda-time/bugs/milestone_counts',
                    success: function(data) {
                        $.each(data.milestone_counts, function(i, item) {
                            var $span = $('.milestones span:contains("' + item.name + '")');
                            if ($span) {
                                $span.after('<small>' + item.count + '</small>').fadeIn('fast');
                            }
                        });
                    }
                });
            }
        });
      </script>
    
</div>
          
          
			  
			  
          
        
        <div class="grid-20 pad">
          <h2 class="dark title">#3 NullPointerException in ISOChronology
            <!-- actions -->
            <small>
            
<a href="/p/joda-time/bugs/3/feed.rss" title="Follow this Ticket"><b data-icon="f" class="ico ico-feed"></b></a>




            </small>
            <!-- /actions -->
          </h2>
		
<div class="editbox">
  <div class="form_holder" style="display: none">
    
<form method="POST" action="/p/joda-time/bugs/3/update_ticket_from_widget" enctype="multipart/form-data">
  <input id="w-13b.ticket_num" name="ticket_form.ticket_num" type="hidden" value="3">
  
  <div class="grid-18">
      <input id="w-13b.summary" name="ticket_form.summary" placeholder="Title" style="width: 425px" type="text" value="NullPointerException in ISOChronology">
  </div>
    
      <div class="grid-6">
        <label class="cr">Milestone:</label>
        <select id="w-13b._milestone" name="ticket_form._milestone">

<option value="v1.0_(example)">v1.0_(example)</option>

</select>
      </div>
    
    <div class="grid-6">
      <label class="cr">Status:</label>
      <select id="w-13b.status" name="ticket_form.status">

<option value="open">open</option>

<option value="unread">unread</option>

<option value="accepted">accepted</option>

<option value="pending">pending</option>

<option selected value="closed">closed</option>

<option value="wont-fix">wont-fix</option>

</select>
    </div>
    <div class="grid-6">
      <label class="cr">Owner:</label>
      <div>
  <input type="text" id="w-13b.assigned_to" name="ticket_form.assigned_to" class="ui-autocomplete-input project_user_select" value="broneill"/>
</div>
    </div>
  <div style="clear:both">&nbsp;</div>
  
  
    

  
  
    <div class="grid-6">
      <label for="w-13b.custom_fields._priority" class="cr">Priority:</label>
      <select id="w-13b.custom_fields._priority" name="ticket_form.custom_fields._priority">

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

<option selected value="5">5</option>

<option value="6">6</option>

<option value="7">7</option>

<option value="8">8</option>

<option value="9">9</option>

</select>
      
    </div>
  

  
  <div style="clear:both">&nbsp;</div>
  <div class="grid-12">
    <label class="cr">Labels:</label>
    <div>
  <input id="w-13b.labels" name="ticket_form.labels" type="text" value="" class="label_edit ticket_form_tags">
</div>
  </div>
  <div class="grid-6">
    <input type="checkbox" class="unlabeled" id="w-13b.private" name="ticket_form.private">
<label for="w-13b.private">Mark as Private</label>
  </div>  
  <div style="clear:both">&nbsp;</div>
  <div class="grid-6">
    <label class="simple">Updated:</label>
    
      
    <span title="Mon Oct 08, 2012 04:48 PM UTC">
      2012-10-08
    </span>

    
  </div>
  <div class="grid-6">
    <label class="simple">Created:</label>
    
      
    <span title="Fri May 14, 2004 04:04 PM UTC">
      2004-05-14
    </span>

    
  </div>
  <div class="grid-6">
    <label class="simple">Creator:</label>
    
      <a href="/u/lelands/">Leland Schroll</a>
    
  </div>
  <div style="clear:both">&nbsp;</div>
  <div class="grid-18">
    
<div class="markdown_edit">
  <a href="#" class="markdown_preview btn" title="Preview"><b data-icon="s" class="ico ico-search"></b> Preview</a>
  <a href="#" class="markdown_edit btn" style="display:none" title="Edit"><b data-icon="p" class="ico ico-pencil"></b> Edit</a>
  <a href="/p/joda-time/bugs/markdown_syntax_dialog" class="markdown_help btn" title="Formatting Help"><b data-icon="h" class="ico ico-help"></b> Formatting Help</a>
  <div style="clear:both"></div>
  <textarea id="w-13b.description" name="ticket_form.description" class="auto_resize" style="width: 95%">When using the timezone GMT-5:00 as the user.timezone
property,  ISOChronology will throw a
NullPointerException due the the static initializer order.

Starting up a simple test class that calls new
DateTime() with:

java -Duser.timezone=GMT-5:00 

the NullPointerException is thrown.

I&#39;ve noticed this behavior on Windows XP when running
WSAD.  WSAD sets the user.timezone property on start-up
to some OS default.  On machines that have not modifed
the date/time with the OS software, this exception can
occur.  If I modify the timezone with the Windows OS
date/time software, the OS sets the timezone to
America/New_York or whatever and WSAD starts our server
fine.

ISOChronology.java:

private static final INSTANCE_UTC = new
ISOChronology(GregorianChronology.getInstanceUTC());

This call would call ISOChronology
getInstance(DateTimeZone) before the class is
completely initialized leading cCache to be null which
the synchronized(cCache) throws an Exception in.

Moving the creation of INSTANCE_UTC to the static code
block so that all of the variables are created seemed
to do the trick.

This is a problem only with offsets in GMT.  (GMT+/-nn:nn)

....
    /** Singleton instance of a UTC ISOChronology */
    private static final ISOChronology INSTANCE_UTC;
                                                      
                                        
    private static final int FAST_CACHE_SIZE = 64;
                                                      
                                        
    /** Fast cache of zone to chronology */
    private static final ISOChronology[] cFastCache =
new ISOChronology[FAST_CACHE_SIZE];
                                                      
                                        
    /** Cache of zone to chronology */
    private static final Map cCache = new HashMap();
                                                      
                                        
    static {
        // Moved here so all variables are created
        INSTANCE_UTC = new
ISOChronology(GregorianChronology.getInstanceUTC());
        cCache.put(DateTimeZone.UTC, INSTANCE_UTC);
    }
...

                                                      
                                        

Exception in thread &#34;main&#34;
java.lang.ExceptionInInitializerError
        at
org.joda.time.chrono.GregorianChronology.&lt;clinit&gt;(GregorianChronology.java:101)
        at
org.joda.time.chrono.ISOChronology.&lt;clinit&gt;(ISOChronology.java:92)
        at
org.joda.time.AbstractDateTime.&lt;init&gt;(AbstractDateTime.java:110)
        at org.joda.time.DateTime.&lt;init&gt;(DateTime.java:112)
        at JodaTest.main(JodaTest.java:14)
Caused by: java.lang.NullPointerException
        at
org.joda.time.chrono.ISOChronology.getInstance(ISOChronology.java:136)
        at
org.joda.time.format.DateTimeFormatterBuilder.&lt;init&gt;(DateTimeFormatterBuilder.java:115)
        at
org.joda.time.DateTimeZone.offsetFormatter(DateTimeZone.java:404)
        at
org.joda.time.DateTimeZone.getInstance(DateTimeZone.java:256)
        at
org.joda.time.DateTimeZone.&lt;clinit&gt;(DateTimeZone.java:149)
</textarea>
  <div class="markdown_preview" style="display:none"></div>
  <a href="#" class="markdown_preview btn" title="Preview"><b data-icon="s" class="ico ico-search"></b> Preview</a>
  <a href="#" class="markdown_edit btn" style="display:none" title="Edit"><b data-icon="p" class="ico ico-pencil"></b> Edit</a>
  <div class="modal markdown_help" style="display:none">
    <b data-icon="D" class="ico ico-close close"></b>
    <div class="markdown_help_contents"></div>
  </div>
  <input type="hidden" class="markdown_project" value="joda-time">
  <input type="hidden" class="markdown_neighborhood" value="4be2faf8898e33156f00003d">
  <input type="hidden" class="markdown_app" value="bugs">
</div>
  </div>
  <div style="clear:both">&nbsp;</div>
  <div class="grid-18">
    
      <div class="clearfix">
      
      </div>
      <div style="clear:both">&nbsp;</div>
    
    <div id="show_attach">
      <input type="checkbox"> I would like to add an attachment
    </div>
    <div style="clear:both">&nbsp;</div>
    <div id="view_attach" style="display:none">
      <input id="w-13b.attachment" name="ticket_form.attachment" type="file">
    </div>
  </div>
  <div style="clear:both">&nbsp;</div>
  <div class="reply discussion-post" style="position:relative;">
    <div class="grid-2 tcenter">
      <p class="gravatar">
      
  
    <b data-icon="U" class="ico emboss ico-user x48"></b>
  <br>
      <small><a href="/u/userid-None/">Anonymous</a></small>
      </p>
    </div>
    <div class="grid-16">
      
<div class="markdown_edit">
  <a href="#" class="markdown_preview btn" title="Preview"><b data-icon="s" class="ico ico-search"></b> Preview</a>
  <a href="#" class="markdown_edit btn" style="display:none" title="Edit"><b data-icon="p" class="ico ico-pencil"></b> Edit</a>
  <a href="/p/joda-time/bugs/markdown_syntax_dialog" class="markdown_help btn" title="Formatting Help"><b data-icon="h" class="ico ico-help"></b> Formatting Help</a>
  <div style="clear:both"></div>
  <textarea id="w-13b.comment" name="ticket_form.comment" class="auto_resize" style="min-height:7em; width:97%"></textarea>
  <div class="markdown_preview" style="display:none"></div>
  <a href="#" class="markdown_preview btn" title="Preview"><b data-icon="s" class="ico ico-search"></b> Preview</a>
  <a href="#" class="markdown_edit btn" style="display:none" title="Edit"><b data-icon="p" class="ico ico-pencil"></b> Edit</a>
  <div class="modal markdown_help" style="display:none">
    <b data-icon="D" class="ico ico-close close"></b>
    <div class="markdown_help_contents"></div>
  </div>
  <input type="hidden" class="markdown_project" value="joda-time">
  <input type="hidden" class="markdown_neighborhood" value="4be2faf8898e33156f00003d">
  <input type="hidden" class="markdown_app" value="bugs">
</div>
      <span class="arw"><span></span></span>
    </div>
  </div>
  <div style="clear:both">&nbsp;</div>
  <div class="grid-18">
    <input class="ui-button ui-widget ui-state-default ui-button-text-only" name="ticket_form.submit" type="submit" value="Save">
    <a href="/p/joda-time/bugs/" class="btn link cancel_form">Cancel</a>
  </div>
</form>
  </div>
  <div class="view_holder">
      
      <div class="grid-4">
        <label class="simple">Status: </label>
        <span class="closed">closed</span>
      </div>
      <div class="grid-5 ticket-assigned-to">
        <label class="simple">Owner: </label>
        
          <a href="/u/broneill/">Brian S O&#39;Neill</a>
        
      </div>
      <div class="grid-4">
        <label class="simple">Labels: </label>
        
          None
        
      </div>
    <div style="clear:both"></div>
    
    
      
      
        
      
        
          
            <div class="grid-4">
              <label class="simple">Priority:</label>
              
                5
              
            </div>
          
        
      
    
    <div style="clear:both"></div>
    <div class="grid-4">
      <label class="simple">Updated:</label>
      
    <span title="Mon Oct 08, 2012 04:48 PM UTC">
      2012-10-08
    </span>

    </div>
    <div class="grid-4">
      <label class="simple">Created:</label>
      
    <span title="Fri May 14, 2004 04:04 PM UTC">
      2004-05-14
    </span>

    </div>
    <div class="grid-5">
      <label class="simple">Creator:</label>
      <a href="/u/lelands/">Leland Schroll</a>
    </div>
    <div class="grid-4">
      <label class="simple">Private:</label>
      No
    </div>
  </div>
</div>

          <div>
            
            

<div id="ticket_content">
  <div class="markdown_content"><p>When using the timezone GMT-5:00 as the user.timezone<br />
property,  ISOChronology will throw a<br />
NullPointerException due the the static initializer order.</p>
<p>Starting up a simple test class that calls new<br />
DateTime() with:</p>
<p>java -Duser.timezone=GMT-5:00 </p>
<p>the NullPointerException is thrown.</p>
<p>I've noticed this behavior on Windows XP when running<br />
WSAD.  WSAD sets the user.timezone property on start-up<br />
to some OS default.  On machines that have not modifed<br />
the date/time with the OS software, this exception can<br />
occur.  If I modify the timezone with the Windows OS<br />
date/time software, the OS sets the timezone to<br />
America/New_York or whatever and WSAD starts our server<br />
fine.</p>
<p>ISOChronology.java:</p>
<p>private static final INSTANCE_UTC = new<br />
ISOChronology(GregorianChronology.getInstanceUTC());</p>
<p>This call would call ISOChronology<br />
getInstance(DateTimeZone) before the class is<br />
completely initialized leading cCache to be null which<br />
the synchronized(cCache) throws an Exception in.</p>
<p>Moving the creation of INSTANCE_UTC to the static code<br />
block so that all of the variables are created seemed<br />
to do the trick.</p>
<p>This is a problem only with offsets in GMT.  (GMT+/-nn:nn)</p>
<p>....<br />
    /*<em> Singleton instance of a UTC ISOChronology </em>/<br />
    private static final ISOChronology INSTANCE_UTC;</p>
<div class="codehilite"><pre><span class="n">private</span> <span class="n">static</span> <span class="n">final</span> <span class="n">int</span> <span class="n">FAST_CACHE_SIZE</span> <span class="p">=</span> 64<span class="p">;</span>

<span class="o">/**</span> <span class="n">Fast</span> <span class="n">cache</span> <span class="n">of</span> <span class="n">zone</span> <span class="n">to</span> <span class="n">chronology</span> <span class="o">*/</span>
<span class="n">private</span> <span class="n">static</span> <span class="n">final</span> <span class="n">ISOChronology</span><span class="p">[]</span> <span class="n">cFastCache</span> <span class="p">=</span>
</pre></div>
<p>new ISOChronology<span>[FAST_CACHE_SIZE]</span>;</p>
<div class="codehilite"><pre><span class="cm">/** Cache of zone to chronology */</span>
<span class="n">private</span> <span class="k">static</span> <span class="k">final</span> <span class="n">Map</span> <span class="n">cCache</span> <span class="o">=</span> <span class="k">new</span> <span class="n">HashMap</span><span class="p">();</span>

<span class="k">static</span> <span class="p">{</span>
    <span class="c1">// Moved here so all variables are created</span>
    <span class="no">INSTANCE_UTC</span> <span class="o">=</span> <span class="k">new</span>
</pre></div>
<p>ISOChronology(GregorianChronology.getInstanceUTC());<br />
        cCache.put(DateTimeZone.UTC, INSTANCE_UTC);<br />
    }<br />
...</p>
<p>Exception in thread "main"<br />
java.lang.ExceptionInInitializerError<br />
        at<br />
org.joda.time.chrono.GregorianChronology.(GregorianChronology.java:101)<br />
        at<br />
org.joda.time.chrono.ISOChronology.(ISOChronology.java:92)<br />
        at<br />
org.joda.time.AbstractDateTime.(AbstractDateTime.java:110)<br />
        at org.joda.time.DateTime.(DateTime.java:112)<br />
        at JodaTest.main(JodaTest.java:14)<br />
Caused by: java.lang.NullPointerException<br />
        at<br />
org.joda.time.chrono.ISOChronology.getInstance(ISOChronology.java:136)<br />
        at<br />
org.joda.time.format.DateTimeFormatterBuilder.(DateTimeFormatterBuilder.java:115)<br />
        at<br />
org.joda.time.DateTimeZone.offsetFormatter(DateTimeZone.java:404)<br />
        at<br />
org.joda.time.DateTimeZone.getInstance(DateTimeZone.java:256)<br />
        at<br />
org.joda.time.DateTimeZone.(DateTimeZone.java:149)</p></div>
  
</div>

          </div>
			
          
  
  
  <div id="discussion_holder">
    <h2>Discussion</h2>
    
    

<div>
                <div class="row">
                        <div class="column grid_12">
      
        <div>
  <div class="page_list">
    
    
  </div>
  <div class="clear"></div>
</div>
      
      <div id="comment">
        
          
            
            <ul>
              <!-- post_thread -->
<li>



  



<div>
  <div id="1adc" class="discussion-post">
    <div class="row">
      <div class="grid-2 tcenter gravatar">
       <p class="gravatar">
        
        
  
    <img src="https://secure.gravatar.com/avatar/6563d8f89d2ba3ff3eea3a3c001afd84?r=pg"
         alt="Brian S O&#39;Neill"
         title="Brian S O&#39;Neill"
         class="emboss x48">
  <br>
        <small><a href="/u/broneill/">Brian S O&#39;Neill</a></small>
        <br>
        <small>
    <span title="Sat May 15, 2004 04:32 AM UTC">
      2004-05-15
    </span>
</small>
       </p>
      </div>
      <div class="grid-14" style="width: 525px">
        <div class="display_post">
          
            
            <div class="markdown_content"><p>Logged In: YES <br />
user_id=405651</p>
<p>I've applied this fix, which prevents the<br />
ExceptionInInitializerError, but there are still a whole<br />
bunch of "chicken or the egg" problems due to the massive<br />
cyclic dependencies within all the static initializers.<br />
There is an important exeception which is being dropped<br />
inside DateTimeZone's static initializer. I'm working on a<br />
solution.</p></div>&nbsp;
            
  
            
          
        </div>
        
        
        
        </div>
        <div class="options grid-3">
        
        <div style="clear:both">
            <div class="little_link">
                <a href="http://sourceforge.net/p/joda-time/bugs/3/#1adc" class="little_link shortlink"><span>Link</span></a><br/>
                
            </div>
            
          
        </div>
      </div>
      <div class="shortlink_popup modal" style="display: none">
        <b data-icon="D" class="ico ico-close close"></b>
        If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
        <input type="text" style="width:100%" value="http://sourceforge.net/p/joda-time/bugs/3/#1adc">
      </div>
    </div>
    <ul>
      <li>
        
      </li>
    </ul>
  </div>

  
</div>


<style type="text/css">
    div.moderate {
        color:grey;
    }
</style>

    <!-- post_thread replies -->
    <ul>
    </ul>
    <!-- post_thread /replies -->
</li>
<!-- /post_thread -->
            </ul>
            
          
        
      </div>
      <div style="clear:both"></div>
      
      <div style="clear:both"></div>
    </div>
  </div>
</div>

  </div>

        </div>
      </div>
    </section>
      
<footer id="site-footer">
    <div class="wrapper">
        <nav>
            <h5>SourceForge</h5>
            <a href="/about">About</a>
            <a href="/blog/category/sitestatus/">Site Status</a>
            <a href="http://twitter.com/sfnet_ops">@sfnet_ops</a>
        </nav>
        <nav>
            <h5>Find and Develop Software</h5>
            <a href="/create/">Create a Project</a>
            <a href="/directory/">Software Directory</a>
            <a href="/top">Top Downloaded Projects</a>
        </nav>
        <nav>
            <h5>Community</h5>
            <a href="/blog/">Blog</a>
            <a href="http://twitter.com/sourceforge">@sourceforge</a>
            <a href="/jobs?source=footer">Job Board</a>
        </nav>
        <nav>
            <h5>Help</h5>
            <a href="/apps/trac/sourceforge/wiki/WikiStart">Site Documentation</a>
            <a href="/support">Support Request</a>
            <a href="https://sourceforge.net/p/forge/documentation/Support%20via%20IRC/">Real-Time Support</a>
        </nav>
    </div>
</footer>
<footer id="site-copyright-footer">
    <div class="wrapper">
        <div id="copyright">
            Copyright &copy; 2013 SourceForge. All Rights Reserved.<br />
            SourceForge is a <a href="http://www.diceholdingsinc.com/phoenix.zhtml?c=211152&amp;p=irol-landing">Dice Holdings, Inc.</a> company.
        </div>
        <nav>
            <a href="http://geeknetmedia.com/terms-of-use">Terms</a>
            <a href="http://geeknetmedia.com/privacy-statement/">Privacy</a>
            <a href="http://geeknetmedia.com/opt-out-choices">Cookies/Opt Out</a>
            <a href="http://geeknetmedia.com">Advertise</a>
            <a href="http://sourceforge.jp/">SourceForge.JP</a>
        </nav>
    </div>
</footer>
    <div id="messages">
        
    </div>
    
      <!-- ew:body_js -->

    
      <script type="text/javascript" src="http://a.fsdn.com/allura/nf/1362067951/_ew_/_slim/js?href=allura%2Fjs%2Fjquery-base.js%3Ballura%2Fjs%2Fjquery.notify.js%3Ballura%2Fjs%2Fsylvester.js%3Ballura%2Fjs%2Fpb.transformie.min.js%3Ballura%2Fjs%2Fallura-base.js%3Bjs%2Fjquery.autosize-min.js%3Bjs%2Fjquery.lightbox_me.js%3Bjs%2Fjquery.textarea.js%3Bjs%2Fsf_markitup.js%3Bjs%2Fjquery.tag.editor.js%3Bjs%2Fvote.js"></script>
    
      
<!-- /ew:body_js -->

    
    
      <!-- ew:body_js_tail -->

    
      <script type="text/javascript">$(function () {
            $('textarea.auto_resize').focus(function(){$(this).autosize();});
        });
$(document).ready(function () {
            $("a.attachment_form_add_button").click(function(evt){
                $(this).hide();
                $(".attachment_form_fields", this.parentNode).show();
                evt.preventDefault();
            });
            $("a.cancel_edit_post").click(function(evt){
                $("textarea", this.parentNode).val($("input.original_value", this.parentNode).val());
                $(".attachment_form_fields input", this.parentNode).val('');
                evt.preventDefault();
            });
         });

        (function () {
            $('div.discussion-post').each(function () {
                var post = this;
                $('.submit', post).button();
                $('.flag_post', post).click(function (ele) {
                    this.parentNode.submit();
                    return false;
                });
                $('.moderate_post', post).click(function(e){
                    e.preventDefault();
                    var mod = $(this).text();
                    var id_post = $(post).attr('id');
                    $.ajax({
                        type: 'POST',
                        url: this.parentNode.action,
                        data: jQuery(this.parentNode).serialize(),
                        success: function() {
                            if (mod == 'Delete'){
                                $(post).remove();
                            }
                            else if (mod == 'Approve'){
                                $('a.reply_post, a.shortlink, form.moderate_spam, form.moderate_approve', post).toggle();
                                $('div.moderate', post).removeClass('moderate');
                            }
                            else if (mod == 'Spam'){
                                $(post).remove();
                            }
                        }
                    });
                });

                if($('a.edit_post', post)){
                    $('a.edit_post', post).click(function (ele) {
                        $('.display_post', post).hide();
                        $('.edit_post_form', post).show();
                        $('.edit_post_form textarea', post).focus();
                        return false;
                    });
                    $("a.cancel_edit_post", post).click(function(evt){
                        $('.display_post', post).show();
                        $('.edit_post_form', post).hide();
                    });
                }
                if($('.reply_post', post)){
                    $('.reply_post', post).click(function (ele) {
                        $('.reply_post_form', post).show();
                        $('.reply_post_form textarea', post).focus();
                        return false;
                    });
                    $('.reply_post', post).button();
                }
                if($('.add_attachment', post)){
                    $('.add_attachment', post).click(function (ele) {
                        $('.add_attachment_form', post).show();
                        return false;
                    });
                }
                if($('.promote_to_thread', post)){
                    $('.promote_to_thread', post).click(function (ele) {
                        $('.promote_to_thread_form', post).show();
                        return false;
                    });
                }
                if($('.shortlink', post)){
                    var popup = $('.shortlink_popup', post);
                    $('.shortlink', post).click(function(evt){
                        evt.preventDefault();
                        popup.lightbox_me({
                            onLoad: function() {
                                $('input', popup).select();
                            }
                        });
                    });
                    $('.close', popup).bind('click', function() {
                        popup.hide();
                    });
                }
            });
        }());
        
$(function () {
            $('select.results_per_page').change(function () {
                this.form.submit();});});
$(function () {
          $('input.label_edit').tagEditor({
            confirmRemoval: false,
            completeOnSeparator: true,
            completeOnBlur: true
          });
        });

        $(document).ready(function () {
            var thread_tag = $('a.thread_tag');
            var thread_spam = $('a.sidebar_thread_spam');
            var tag_thread_holder = $('#tag_thread_holder');
            var allow_moderate = $('#allow_moderate');
            var mod_thread_link = $('#mod_thread_link');
            var mod_thread_form = $('#mod_thread_form');
            if (mod_thread_link.length) {
                if (mod_thread_form.length) {
                    mod_thread_link.click(function (e) {
                        mod_thread_form.show();
                        return false;
                    });
                }
            }
            if (thread_tag.length) {
                if (tag_thread_holder.length) {
                    var submit_button = $('input[type="submit"]', tag_thread_holder);
                    var cancel_button = $('<a href="#" class="btn link">Cancel</a>').click(function(evt){
                        evt.preventDefault();
                        tag_thread_holder.hide();
                        thread_tag.removeClass('active');
                    });
                    submit_button.after(cancel_button);
                    thread_tag.click(function (e) {
                        tag_thread_holder.show();
                        thread_tag.addClass('active');
                        // focus the submit to scroll to the form, then focus the subject for them to start typing
                        submit_button.focus();
                        $('input[type="text"]', tag_thread_holder).focus();
                        return false;
                    });
                }
            }
            if (thread_spam.length) {
                if (allow_moderate.length) {
                    var cval = $.cookie('_session_id');
                    thread_spam[0].style.display='block';
                }
            }
        });
        
$(function () {
          $('input.project_user_select').autocomplete({
            source: function (request, response) {
              $.ajax({
                url: "/p/joda-time/user_search",
                dataType: "json",
                data: {
                  term: request.term
                },
                success: function (data) {
                  response(data.users);
                }
              });
            },
            minLength: 2
          });});

        $(function(){
            $('#show_attach input').click(function(){
                $('#view_attach').show();
                $('#show_attach').hide();
            });
            $('form').submit(function() {
                $('input[type=submit]', this).attr('disabled', 'disabled');
            });
            $('div.reply.discussion-post a.markdown_preview').click(function(){
                var arrow = $(this).closest('.discussion-post').find('span.arw');
                arrow.hide();
            });
            $('div.reply.discussion-post a.markdown_edit').click(function(){
                var arrow = $(this).closest('.discussion-post').find('span.arw');
                arrow.show();
            });
        });</script>
    
      
<!-- /ew:body_js_tail -->

    
    
  

    
      
    
    
   
    
  </body>
</html>