Spring 4.3.5 - DWR compatibility

classic Classic list List threaded Threaded
2 messages Options
nm
Reply | Threaded
Open this post in threaded view
|

Spring 4.3.5 - DWR compatibility

nm
Hi,

I am facing issues in my app integrating Spring 4.3.5 with DWR 3.0.2-RELEASE. The app was previously using Spring 3.0.2.RELEASE version with 3.0.0-rc3-SNAPSHOT, and it was working fine.

Could you please tell me if these two versions (Spring 4.3.5 with DWR 3.0.2-RELEASE) are compatible. If not, what is the max Spring framework version supported by DWR? 
Below are the details of the issue I am facing :

It looks like I am getting errors related to org.directwebremoting.spring.BeanCreator class when I try to start my application.

Below is a sample of the error I am getting :

Severe:   WebModule[/TrueData]StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '__dwrConfiguration': Cannot resolve reference to bean '__systemService' while setting bean property 'creators' with key [systemService]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '__systemService': Cannot create inner bean '(inner bean)#7bbb021e' of type [org.directwebremoting.spring.BeanCreator] while setting bean property 'creator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7bbb021e': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.AopUtils.isCglibProxyClass(Ljava/lang/Class;)Z
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:407)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:165)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1492)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1237)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)

When I looked at the BeanCreator class, I found that it is using the below method in the afterPropertiesSet() method, which could be be causing the problem (Not sure if this class is the only place it is used) :

        // make sure to handle cglib proxies correctly
        if (ClassUtils.isCglibProxyClass(this.beanClass))
        {
            this.beanClass = this.beanClass.getSuperclass();
        }

Can you please help me fix this issue, or guide me regarding which Spring version is supported with the latest version of DWR ?

Regards,
Nitesh.N.M
Reply | Threaded
Open this post in threaded view
|

Re: Spring 4.3.5 - DWR compatibility

david@butterdev.com
It doesn't seem like you are using DWR 3.0.2-RELEASE. 

https://directwebremoting.atlassian.net/browse/DWR-650

Related commit:
https://github.com/directwebremoting/dwr/commit/a42daa95e93a084af355a168fed1e05223f57301

If you look at the latest source you will see we are using ClassUtils, not AopUtils.  isCglibProxyClass was removed in AopUtils, but still exists in ClassUtils:
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/util/ClassUtils.html

If you can describe how you are pulling in dwr that would be helpful.

On 03/15/2017 07:49 AM, Nitesh M wrote:
Hi,

I am facing issues in my app integrating Spring 4.3.5 with DWR 3.0.2-RELEASE. The app was previously using Spring 3.0.2.RELEASE version with 3.0.0-rc3-SNAPSHOT, and it was working fine.

Could you please tell me if these if (ClassUtils.isCglibProxyClass(this.beanClass)) two versions (Spring 4.3.5 with DWR 3.0.2-RELEASE) are compatible. If not, what is the max Spring framework version supported by DWR? 
Below are the details of the issue I am facing :

It looks like I am getting errors related to org.directwebremoting.spring.BeanCreator class when I try to start my application.

Below is a sample of the error I am getting :

Severe:   WebModule[/TrueData]StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '__dwrConfiguration': Cannot resolve reference to bean '__systemService' while setting bean property 'creators' with key [systemService]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '__systemService': Cannot create inner bean '(inner bean)#7bbb021e' of type [org.directwebremoting.spring.BeanCreator] while setting bean property 'creator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7bbb021e': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.support.AopUtils.isCglibProxyClass(Ljava/lang/Class;)Z
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:407)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:165)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1492)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1237)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)

When I looked at the BeanCreator class, I found that it is using the below method in the afterPropertiesSet() method, which could be be causing the problem (Not sure if this class is the only place it is used) :

        // make sure to handle cglib proxies correctly
        if (ClassUtils.isCglibProxyClass(this.beanClass))
        {
            this.beanClass = this.beanClass.getSuperclass();
        }

Can you please help me fix this issue, or guide me regarding which Spring version is supported with the latest version of DWR ?

Regards,
Nitesh.N.M