Sheetal Badhe - 2012-08-08

I wrote rmi code.It runs successfully without obfuscate  .But after obfuscate  using proguard i got following error

Exception :java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
        java.lang.IllegalArgumentException: illegal remote method encountered: p

It gives me such error on any random method.

My code is:
Interface:

package com;

import java.rmi.*;

public interface AddServerIntf extends Remote{

double add(double d1,double d2)throws RemoteException;
double sub(double d1,double d2)throws RemoteException;
double mul(double d1,double d2)throws RemoteException;
}

Implementation :

package com;
import java.rmi.*;
import java.rmi.server.*;

public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf{

public AddServerImpl()throws RemoteException{
super();
}
public double add(double d1,double d2)throws RemoteException{
return d1+d2;
}
public double sub(double d1,double d2)throws RemoteException{
return d1-d2;
}
public double mul(double d1,double d2)throws RemoteException{
return d1*d2;
}
}

Server :
package com;
import java.net.*;
import java.rmi.*;

public class AddServer{
public static void main(String args){
try{
java.rmi.registry.LocateRegistry.createRegistry(1099);
Naming.rebind("AddServer",  new AddServerImpl());

}catch(Exception ex){
System.out.println("Exception :"+ex);
}
}
}

client :
package com;
import java.rmi.*;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class AddClient {
public static void main(String args){
try{
String url = "rmi://"+"192.168.1.14"+"/AddServer";
AddServerIntf asi = (AddServerIntf)Naming.lookup(url);

ValuesVO values = new ValuesVO();
values.setFirstNo(new Double(10));
values.setSecondNo(new Double(20));

System.out.println("Addition :"+asi.add(values.getFirstNo().doubleValue(), values.getSecondNo().doubleValue()));
System.out.println("Substraction :"+asi.sub(values.getFirstNo().doubleValue(), values.getSecondNo().doubleValue()));
System.out.println("Multiplication :"+asi.mul(values.getFirstNo().doubleValue(), values.getSecondNo().doubleValue()));
}catch(Exception ex){
ex.printStackTrace();
}
}
}