Spring RMI Remoting Maven Build ClassCast Execption

We have used spring remoting using RMI feature, where the service and client are deployed on same server. I am using JndiRmiServiceExporter and JndiRmiProxyFactoryBean. It works fine if i deploy the applications through weblogic workshop. But it fails at runtime when a maven build is done and deployed throwing an error