title: Cannot load configuration class
body: <p>I am following <a href="http://www.tutorialspoint.com/spring/spring_java_based_configuration.htm" rel="noreferrer">this</a> tutorial about how to use Spring and based on the provided example, I get the following exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalStateException: Cannot load configuration class: com.tutorialspoint.HelloWorldConfig
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:378)
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:263)
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:265)
      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:126)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:609)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
      at org.springframework.context.annotation.AnnotationConfigApplicationContext.&lt;init&gt;(AnnotationConfigApplicationContext.java:84)
      at com.tutorialspoint.MainApp.main(MainApp.java:9)
  Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException--&gt;null
      at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
      at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)
      at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:317)
      at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:128)
      at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:100)
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:368)
      ... 7 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
      at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
      ... 12 more
  Caused by: java.lang.SecurityException: class "com.tutorialspoint.HelloWorldConfig$$EnhancerBySpringCGLIB$$b5aece24"'s signer information does not match signer information of other classes in the same package
      at java.lang.ClassLoader.checkCerts(ClassLoader.java:952)
      at java.lang.ClassLoader.preDefineClass(ClassLoader.java:666)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:794)
      ... 18 more
  </code></pre>
  
  <p>I have researched my problem and have found <a href="https://stackoverflow.com/questions/11681188/spring-3-1-java-based-configuration-illegalstateexception">this</a>; someone also has had the same problem as me, and it has something to do with ensuring that ASM is compatible with CGLIB. However I have tried this solution and it has  not worked, I even went as far as using the exact same versions as the one provided (GBLIB 2.2.2 and ASM 3.3.1).</p>
  
  <p>What do I need to do in order to correct this?</p>
  
  <hr>
  
  <p>For simplicity, here are the files which I am using that were extracted from the provided tutorial.</p>
  
  <p>HelloWorldConfig.java</p>
  
  <pre><code>package com.tutorialspoint;
  import org.springframework.context.annotation.*;
  
  @Configuration
  public class HelloWorldConfig {
  
      @Bean
      public HelloWorld helloWorld() {
          return new HelloWorld();
      }
  }
  </code></pre>
  
  <p>HelloWorld.java</p>
  
  <pre><code>package com.tutorialspoint;
  
  public class HelloWorld {
      private String message;
  
      public void setMessage(String message) {
          this.message = message;
      }
  
      public void getMessage() {
          System.out.println("Your Message : " + message);
      }
  }
  </code></pre>
  
  <p>MainApp.java</p>
  
  <pre><code>package com.tutorialspoint;
  
  import org.springframework.context.ApplicationContext;
  import org.springframework.context.annotation.*;
  
  public class MainApp {
      public static void main(String[] args) {
          @SuppressWarnings("resource")
          ApplicationContext ctx = new AnnotationConfigApplicationContext(
                  HelloWorldConfig.class);
  
          HelloWorld helloWorld = ctx.getBean(HelloWorld.class);
  
          helloWorld.setMessage("Hello World!");
          helloWorld.getMessage();
      }
  }
  </code></pre>
  
  <p>Also by saying 'However I have tried this solution and it has  not worked' I mean that the exact same error is returned.</p>