I was having the same problem with JaxRpcPortProxyFactoryBean and Axis. As soon as you have more than one thread using the JaxRpcPortProxyFactoryBean, all kinds of weird Exceptions occur. I was getting NullPointer and ClassCast exceptions. I'm not sure how you can pool JaxRpcPortProxyFactoryBean since it can only be declared as a singleton.
My solution was to just make the proxy bean synchronized.
And the SynchronizationDecorator looks like this:
<bean id="xDslService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean">
<bean id="synchronizationDecorator" class="SynchronizationDecorator" />
<property name="target"><ref local="xDslService"/></property>
Now if you use the xDslServiceSync bean, the concurrency problems go away, at the price of possibly slowing your application down because now only one thread at a time can access the web service.
public class SynchronizationDecorator implements MethodInterceptor
/** Creates a new instance of SynchronizationDecorator */
sem = new Semaphore(1);
public Object invoke(MethodInvocation invocation) throws Throwable
// System.out.println("Wait for semaphore queue (" + sem.getQueueLength() + ")");
Object retVal = invocation.proceed();