title: java.lang.VerifyError: class net.sf.cglib.core.DebuggingClassWriter
body: <p>I'm trying to prototype some pretty simple Hibernate code originating from a tutorial and am getting an error I don't understand deep in cglib2 (the full stack trace is at the end of this post). I am probably trying to create 'productBoProxy' per my simple <em>main()</em> and bean XML (below).</p>
  
  <p>I've tried many different versions of cglib to no avail. I'm very grateful to anyone who can help me find the right path to solving this.</p>
  
  <p><em>App.java</em>:</p>
  
  <pre><code>ApplicationContext appContext
      = new ClassPathXmlApplicationContext( "resources/config/BeanLocations.xml" );
  ...
  productBo = ( ProductBo ) appContext.getBean( "productBoProxy" );
  productBo.save( product, 100 );
  </code></pre>
  
  <p><em>Product.xml</em>:</p>
  
  <pre><code>...
  &lt;!-- This is a proxy factory bean; see App.java --&gt;
  &lt;bean id="productBoProxy"
        class="org.springframework.aop.framework.ProxyFactoryBean"&gt;
    &lt;property name="target" ref="productBo" /&gt;
    &lt;property name="interceptorNames"&gt;
      &lt;list&gt;
        &lt;value&gt;transactionInterceptor&lt;/value&gt;
      &lt;/list&gt;
    &lt;/property&gt;
  &lt;/bean&gt;
  ...
  </code></pre>
  
  <p>Stack trace:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanCreationException: \
      Error creating bean with name 'productBoProxy': \
      FactoryBean threw exception on object creation; nested exception is java.lang.VerifyError: \
      class net.sf.cglib.core.DebuggingClassWriter overrides final method visit. \
      (IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
  at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
  at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1441)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
  at com.mkyong.App.main(App.java:41)
  Caused by: java.lang.VerifyError: class net.sf.cglib.core.DebuggingClassWriter \
  overrides final method visit.(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
  at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  at net.sf.cglib.core.AbstractClassGenerator.&lt;init&gt;(AbstractClassGenerator.java:38)
  at net.sf.cglib.core.KeyFactory$Generator.&lt;init&gt;(KeyFactory.java:127)
  at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:112)
  at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
  at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
  at net.sf.cglib.proxy.Enhancer.&lt;clinit&gt;(Enhancer.java:69)
  at org.springframework.aop.framework.Cglib2AopProxy.createEnhancer(Cglib2AopProxy.java:229)
  at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:171)
  at org.springframework.aop.framework.ProxyFactoryBean.getProxy(ProxyFactoryBean.java:362)
  at org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(ProxyFactoryBean.java:316)
  at org.springframework.aop.framework.ProxyFactoryBean.getObject(ProxyFactoryBean.java:242)
  at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
  ... 6 more
  </code></pre>