title: java.lang.NoClassDefFoundError: Could not initialize class | static block
body: <p>I'm stuck with a strange issue where my JVM is throwing java.lang.NoClassDefFoundError. Any help in identifying the problem is greatly appreciated.</p>
  
  <pre><code>public class AccessorFactory
  {
  private static Map classMap = null;
      static
      {
          classMap = new HashMap(100);
          classMap.put("bills", Class.forName("com.example.BillAccessor"));
      }
  }
  
  public class BillAccessor
  {
      class BillInnerClass
      {
          //some code
      }
  }
  </code></pre>
  
  <p>I have 3 classes AccessorFactory.class, BillAccessor.class and BillAccessor$BillInnerClass.class. All 3 are in same jar file and all are present in the classpath.</p>
  
  <p>I've recently changed something in BillAccessor$BillInnerClass class and replaced this file in the jar file and restarted application instance in server (jboss). </p>
  
  <p>Post restart I'm getting</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class AccessorFactory
  </code></pre>
  
  <p>AccessorFactory class present in the jar file and in the class path. Nothing else is changed except that I've replaced BillAccessor$BillInnerClass.</p>