0

Hello everyone,
I am getting NPE, and surprisingly I can't figure out why ... I am calling a method from a client using java rmi. The method on the server side is as follows :

public List<String> getPrinters() throws RemoteException {
        List<String> listPrinters= new ArrayList<String>();
        for(int i=0; i<printers.size();i++){
            listPrinters.add(printers.get(i).getName());
        }
        return listPrinters;
    }

and then from the client side I am trying to
System.out.println(rmiServer.getPrinters().size());

The connection is successful etc because i am sending some strings and replying back after so its all fine, gives me NPE on the client side while trying to print the size of the list that the method should return

Ideas? =)

1
Contributor
1
Reply
8
Views
2 Years
Discussion Span
Last Post by Slavi
1

Nevermind, dumb moment only had to restart the server as the method didn't exist before i started it :p

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.