Announcement Announcement Module
Collapse
No announcement yet.
NoClassDefFoundError from Proxy class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoClassDefFoundError from Proxy class

    I originally posted this on the Spring Batch forum and Dave mentioned that it might be worth posting here as well. Here's the original post for reference: http://forum.springsource.org/showthread.php?t=83981

    Whats happening is I'm late binding some properties to classes I have written and all is working well. When I try to late bind a property to a Spring Batch class I'm receiving the following stack trace (cut down to fit into the post):

    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftpLogProcessStep': Cannot resolve reference to bean 'ftpLogFileReader' while setting bean property 'itemReader'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftpLogFileReader' defined in BeanDefinition defined in URL [bundleentry://99.fwk1945132040/META-INF/spring/lattice-job-ftp-process.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class $Proxy323
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    	... 70 common frames omitted
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ftpLogFileReader' defined in BeanDefinition defined in URL [bundleentry://99.fwk1945132040/META-INF/spring/lattice-job-ftp-process.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class $Proxy323
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    	... 80 common frames omitted
    Caused by: java.lang.NoClassDefFoundError: Could not initialize class $Proxy323
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:588)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.getProxy(JdkDynamicAopProxy.java:117)
    	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)
    	at org.springframework.aop.scope.ScopedProxyFactoryBean.setBeanFactory(ScopedProxyFactoryBean.java:109)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1422)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1389)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
    	... 86 common frames omitted
    When I run the bundle normally (without the offending late bind piece of xml) I can see that the bundle has successfully loaded and in its imported packages I can see the Spring Batch bundles, the Spring AOP bundle and also the AOP Alliance bundle. So I know it does work, but as soon as I try to bind to a Spring Batch class it all goes wrong.

    I'm using:
    - Spring Batch 2.1.0.M4
    - Spring 3.0.0.RELEASE
    All running on Spring DM Server: 2.0.0.RELEASE

    Any help would be appreciated

  • #2
    make sure you have jar files in place. If cglib is being used for proxy.

    -Hetal

    Comment


    • #3
      This has been resolved now, for the answer see the post in Spring Batch: http://forum.springsource.org/showth...873#post281873

      Comment

      Working...
      X