Image

Imagegrrlpower wrote in Imagejava_dev

RMI

Ugh, so I'm working on my first RMI project and it's giving me some trouble... wen I try to compile my client-side menu I get the following error:

Lab2.java:265: Can't make static reference to method Item 
findItem(java.io.BufferedReader, Inventory) in class Lab2.
             temp = findItem(read, invent);


where I reference the findItem method. The thing is, the method isn't static... I am guessing this may have to do with serializing the Item, but I'm not sure...

The method itself is:
public Item findItem(BufferedReader read, Inventory invent) 
                        throws IOException, RemoteException { 	 
	try {
	    String input = promptString(read, "Enter the UPC code of the item you want");
	     return invent.findItem(input);			
	}
	catch (NoSuchItemException nsi) {
	      System.out.println("No Such Item");
	}
			
	return null;	
	}

any thoughts? if anyone has any other ideas, let me know....