title: Error while creating bean: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
body: <p>I am facing the following error when I try to create bean using Application Context for the circle class! Circle class implements the <code>Shape</code> interface which contains a method <code>draw()</code>.</p>
  
  <p><strong>Configuration:</strong></p>
  
  <p>I am learning spring and have setup a Java Project in eclipse with all the required jars (Spring and Apache commons logging). I have the spring.xml in my classpath in the src folder. Have also tried downloading the latest jars (Spring 4.0.4 release, previously worked with 4.0.0) but now is not working. Cannot think of any solution to fix this.</p>
  
  <p>Error:</p>
  
  <pre><code>May 11, 2014 6:20:50 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
  INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@90832e: startup date [Sun May 11 18:20:50 EDT 2014]; root of context hierarchy
  May 11, 2014 6:20:50 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from class path resource [spring.xml]
  Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:88)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at com.springApplication.DrawingApplication.main(DrawingApplication.java:16)
  Caused by: java.lang.ExceptionInInitializerError
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1071)
      ... 13 more
  Caused by: java.lang.NullPointerException
      at org.springframework.beans.PropertyEditorRegistrySupport.&lt;clinit&gt;(PropertyEditorRegistrySupport.java:92)
      ... 14 more
  </code></pre>
  
  <p>DrawingApplication.java</p>
  
  <pre><code>package com.springApplication;
  
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.support.ClassPathXmlApplicationContext;
  
  
  public class DrawingApplication {
  
      public static void main(String[] args) {
  
          //The beanFactory reads from an XML file    
          //BeanFactory context = new XmlBeanFactory(new FileSystemResource("spring.xml"));
  
          //Application Context provides -- Event notification and more than Bean Factory
           ApplicationContext context =  new ClassPathXmlApplicationContext("spring.xml");
  
          //Here we pass the id of the bean from the XML given in the above line
           Shape shape =  (Shape)context.getBean("circle");
  
          //Calling the draw method through object local object created using Spring
           shape.draw();
      }
  
  }
  </code></pre>
  
  <p>Circle.java</p>
  
  <pre><code>package com.springApplication;
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.beans.factory.annotation.Qualifier;
  
  public class Circle implements Shape{
  
      private Point center;
  
      public Point getCenter() {
          return center;
      }
  
      @Autowired
      @Qualifier("circleRelated")
      public void setCenter(Point center) {
          this.center = center;
      }
  
      @Override
      public void draw() {
          System.out.println("Drawing a Circle");
          System.out.println("Center Point is: (" + center.getX() + ", " + center.getY() + ")");      
      }
  }
  </code></pre>
  
  <p>Point.java</p>
  
  <pre><code>package com.springApplication;
  
  public class Point {
  
      private int x;
      private int y;
  
      public int getX() {
          return x;
      }
      public void setX(int x) {
          this.x = x;
      }
      public int getY() {
          return y;
      }
      public void setY(int y) {
          this.y = y;
      }
  }    
  </code></pre>
  
  <p>spring.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
  &lt;bean id="pointA" class="com.springApplication.Point"&gt;
      &lt;qualifier value="circleRelated" /&gt;
      &lt;property name="x" value="0"/&gt;
      &lt;property name="y" value="0"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="PointB" class="com.springApplication.Point"&gt;
      &lt;property name="x" value="0"/&gt;
      &lt;property name="y" value="20"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="PointC" class="com.springApplication.Point"&gt;
      &lt;property name="x" value="-20"/&gt;
      &lt;property name="y" value="0"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="circle" class="com.springApplication.Circle"&gt;
  &lt;/bean&gt;
  
  &lt;!-- &lt;bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" /&gt; --&gt;
  &lt;context:annotation-config/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Please let me know if anything else is needed. Someone please help !</p>
  
  <p>Sorry about the wrong placing!!</p>
  
  <p>@Andrei Stefan<br>
  List of Jars ---------<br>
  commons-logging-1.1.3<br>
  spring-aop-4.0.4.RELEASE<br>
  spring-aop-4.0.4.RELEASE-javadoc<br>
  spring-aop-4.0.4.RELEASE-sources<br>
  spring-aspects-4.0.4.RELEASE<br>
  spring-aspects-4.0.4.RELEASE-javadoc<br>
  spring-aspects-4.0.4.RELEASE-sources<br>
  spring-beans-4.0.4.RELEASE<br>
  spring-beans-4.0.4.RELEASE-javadoc<br>
  spring-beans-4.0.4.RELEASE-sources<br>
  spring-build-src-4.0.4.RELEASE<br>
  spring-context-4.0.4.RELEASE<br>
  spring-context-4.0.4.RELEASE-javadoc<br>
  spring-context-4.0.4.RELEASE-sources<br>
  spring-context-support-4.0.4.RELEASE<br>
  spring-context-support-4.0.4.RELEASE-javadoc<br>
  spring-context-support-4.0.4.RELEASE-sources<br>
  spring-core-4.0.4.RELEASE<br>
  spring-core-4.0.4.RELEASE-javadoc<br>
  spring-core-4.0.4.RELEASE-sources<br>
  spring-expression-4.0.4.RELEASE<br>
  spring-expression-4.0.4.RELEASE-javadoc<br>
  spring-expression-4.0.4.RELEASE-sources<br>
  spring-framework-bom-4.0.4.RELEASE<br>
  spring-framework-bom-4.0.4.RELEASE-javadoc<br>
  spring-framework-bom-4.0.4.RELEASE-sources<br>
  spring-instrument-4.0.4.RELEASE<br>
  spring-instrument-4.0.4.RELEASE-javadoc<br>
  spring-instrument-4.0.4.RELEASE-sources<br>
  spring-instrument-tomcat-4.0.4.RELEASE<br>
  spring-instrument-tomcat-4.0.4.RELEASE-javadoc<br>
  spring-instrument-tomcat-4.0.4.RELEASE-sources<br>
  spring-jdbc-4.0.4.RELEASE<br>
  spring-jdbc-4.0.4.RELEASE-javadoc<br>
  spring-jdbc-4.0.4.RELEASE-sources<br>
  spring-jms-4.0.4.RELEASE<br>
  spring-jms-4.0.4.RELEASE-javadoc<br>
  spring-jms-4.0.4.RELEASE-sources<br>
  spring-messaging-4.0.4.RELEASE<br>
  spring-messaging-4.0.4.RELEASE-javadoc<br>
  spring-messaging-4.0.4.RELEASE-sources<br>
  spring-orm-4.0.4.RELEASE<br>
  spring-orm-4.0.4.RELEASE-javadoc<br>
  spring-orm-4.0.4.RELEASE-sources<br>
  spring-oxm-4.0.4.RELEASE<br>
  spring-oxm-4.0.4.RELEASE-javadoc<br>
  spring-oxm-4.0.4.RELEASE-sources<br>
  spring-test-4.0.4.RELEASE<br>
  spring-test-4.0.4.RELEASE-javadoc<br>
  spring-test-4.0.4.RELEASE-sources<br>
  spring-tx-4.0.4.RELEASE<br>
  spring-tx-4.0.4.RELEASE-javadoc<br>
  spring-tx-4.0.4.RELEASE-sources<br>
  spring-web-4.0.4.RELEASE<br>
  spring-web-4.0.4.RELEASE-javadoc<br>
  spring-web-4.0.4.RELEASE-sources<br>
  spring-webmvc-4.0.4.RELEASE<br>
  spring-webmvc-4.0.4.RELEASE-javadoc<br>
  spring-webmvc-4.0.4.RELEASE-sources<br>
  spring-webmvc-portlet-4.0.4.RELEASE<br>
  spring-webmvc-portlet-4.0.4.RELEASE-javadoc<br>
  spring-webmvc-portlet-4.0.4.RELEASE-sources<br>
  spring-websocket-4.0.4.RELEASE<br>
  spring-websocket-4.0.4.RELEASE-javadoc<br>
  spring-websocket-4.0.4.RELEASE-sources<br></p>
  
  <p>All of these plus other default system libraries are referenced. </p>