erwin.wernsen
May 23rd, 2007, 11:49 AM
Hi,
I had DWR working for on one of my beans. Next I added the BeanNameAutoProxyCreator on that bean and then it broke. When I invoke a method I get an exception:
java.lang.IllegalArgumentException: object is not an instance of declaring class.
In the debugger I noticed that instead of the service-impl class I now have a proxy, the proxy however is proxied against the service interface while DefaultRemoter class from DWR expects it to be the service-impl class.
For example in my spring.xml:
<bean id="myService" class="MyServiceImpl">
<dwr:remote javascript="AjaxMyService">
<dwr:include method="doit"/>
</dwr:remote>
</bean>
<bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNa meAutoProxyCreator">
<property name="interceptorNames">
<value>transactionInterceptor</value>
</property>
<property name="beanNames">
<list>
<idref local="myService"/>
</list>
</property>
</bean>
Does anyone have any ideas how I can get DWR to work with proxied beans?
Regards,
Erwin
I had DWR working for on one of my beans. Next I added the BeanNameAutoProxyCreator on that bean and then it broke. When I invoke a method I get an exception:
java.lang.IllegalArgumentException: object is not an instance of declaring class.
In the debugger I noticed that instead of the service-impl class I now have a proxy, the proxy however is proxied against the service interface while DefaultRemoter class from DWR expects it to be the service-impl class.
For example in my spring.xml:
<bean id="myService" class="MyServiceImpl">
<dwr:remote javascript="AjaxMyService">
<dwr:include method="doit"/>
</dwr:remote>
</bean>
<bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNa meAutoProxyCreator">
<property name="interceptorNames">
<value>transactionInterceptor</value>
</property>
<property name="beanNames">
<list>
<idref local="myService"/>
</list>
</property>
</bean>
Does anyone have any ideas how I can get DWR to work with proxied beans?
Regards,
Erwin