try {
// Initialize the ORB
ORB orb = ORB.init(argv, null);
// Get the root naming context. Do NOT use "bind",
// which is a VisiBroker non-standard extension.
// (but a very convenient one!)
org.omg.CORBA.Object objRef =
orb.resolve_initial_references("NameService");
NamingContext ncRef = NamingContextHelper.narrow(objRef);
// Find an object that supports Supply
NameComponent nc = new NameComponent("Supply", "");
NameComponent path[] = {nc};
Supply mySupply = SupplyHelper.narrow(ncRef.resolve(path));
// Interact with Object
int x = mySupply.dispenseCup();
} catch (Exception e) { // Any CORBA Exceptions?
System.out.println("Error: " + e) ;
e.printStackTrace(System.err);
}