public static void main(String[] args) { loggedUser = args[0]; try { ORB orb = ORB.init(args, null); // initialize ORB o = orb.resolve_initial_references("NameService"); // get reference to Deal object NamingContext ncRef = NamingContextHelper.narrow(o); NameComponent[] nc = new NameComponent[1]; nc[0] = new NameComponent(); nc[0].id = "Auction"; nc[0].kind = ""; a = AuctionHelper.narrow(ncRef.resolve(nc)); isr = new InputStreamReader(System.in); in = new BufferedReader(isr); int sel = 0; System.out.println("******* You have logged in Successfully! ********"); while (sel == 0) { System.out.println("Please make a selection"); System.out.println("\t1. Get all the listed auctions"); System.out.println("\t2. List a new item for auction."); System.out.println("\t3. Lookup an auction."); System.out.println("\t4. Place a bid on an auction."); System.out.println("\t5. Logout."); System.out.print("Please make your selection > "); String f = in.readLine(); try { sel = Integer.parseInt(f); } catch (Exception e) { sel = 42; } switch (sel) { case 1: allItems(); sel = 0; break; case 2: newAuction(); sel = 0; break; case 3: System.out.println("Stub"); sel = 0; break; case 4: placeBid(); sel = 0; break; case 5: a.logout(loggedUser); System.out.println("BYE!"); System.exit(0); default: System.out.println("You have not made a valid selection, please try again."); sel = 0; break; } } } catch (Exception e) { System.out.println("ERROR : " + e); e.printStackTrace(System.out); } }