title: final static LocalDateTime retrieving from another class is throwing java.lang.ExceptionInInitializerError
body: <p>I have a variable <code>MINDATE</code> in <code>MyConstants</code> file. You can see the declaration below.</p>
  
  <pre><code>public static final LocalDateTime MINDATE =  LocalDateTime.of(LocalDate.of(2011, 1, 1), LocalTime.MIDNIGHT);
  </code></pre>
  
  <p>I am consuming this variable in another class just by using <code>MyConstants.MINDATE</code>
  then I get the following exception</p>
  
  <pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError
      at com.cw.na.vos.DateTest.main(DateTest.java:14)
  Caused by: java.lang.IllegalArgumentException: Unknown pattern letter: T
      at java.time.format.DateTimeFormatterBuilder.parsePattern(Unknown Source)
      at java.time.format.DateTimeFormatterBuilder.appendPattern(Unknown Source)
      at java.time.format.DateTimeFormatter.ofPattern(Unknown Source)
      at com.cw.na.vos.MyConstants.&lt;clinit&gt;(MyConstants.java:228)
      ... 1 more
  </code></pre>
  
  <p>I am unable to understand the reason behind it.</p>
  
  <pre><code>public class DateTest {
  
      static final LocalDateTime minD =  LocalDateTime.of(LocalDate.of(2011, 1, 1), LocalTime.MIDNIGHT);
      public static void main(String[] args) {
  
  LocalDateTime ldt = LocalDateTime.of(LocalDate.of(2011, 1, 1), LocalTime.MIDNIGHT);
  
  
          System.out.println(minD); // success 
          System.out.println(ldt); //success 
  System.out.println(MyConstants.MINDATE); //ExceptionInInitializerError
      }
  
  }
  </code></pre>
  
  <p>If I create the same variable in the class locally then it works but when I access similar <code>LocalDateTime</code> variable from different class then it throws an exception.</p>
  
  <p>Need Help. </p>