so it seems that in order to fix this the following patch should be applied.
in HessianProxyFactoryBean.afterPropertiesSet()
instead of
Code:
this.serviceProxy = new ProxyFactory(getServiceInterface(), this).getProxy(getBeanClassLoader());
this should be used
Code:
ProxyFactory pf = new ProxyFactory(getServiceInterface(), this);
pf.setTargetSource(new SingletonTargetSource(hessianProxy) {
@Override
public Class<?> getTargetClass() {
return getObjectType();
}
});
this.serviceProxy = pf.getProxy(getBeanClassLoader());
also HessianClientInterceptor.hessianProxy should be made protected so that you don't need to reflectionally access the field
.
for RMI in RmiProxyFactoryBean i suppose that the same should be done using RmiClientInterceptor.getStub().
in case of HttpInvokerProxyFactoryBean we don't really have the underlying proxy, so i don't know if it causes problems
.