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? =)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.