public static void main(String args[]) {

		org.omg.CORBA.Object objRef;

		try{

			// create and initialize the ORB
			ORB orb = ORB.init(args, null);

			// get reference to rootpoa & activate the POAManager
			POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
			rootpoa.the_POAManager().activate();

			// get the naming service
			objRef = orb.resolve_initial_references("NameService");
			NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

			// get object reference from the servant
			BankImpl bankImpl = new BankImpl(rootpoa);
			objRef = rootpoa.servant_to_reference(bankImpl);
			ncRef.rebind(ncRef.to_name("bank1"), objRef);

			BankImpl bankImpl2 = new BankImpl(rootpoa);
			objRef = rootpoa.servant_to_reference(bankImpl2);;
			ncRef.rebind(ncRef.to_name("bank2"), objRef);

			// wait for invocations from clients
			System.out.println("BankServer ready and waiting...");
			orb.run(); // blocking...
		} 

		catch (Exception e) {
			System.err.println("ERROR: " + e);
			e.printStackTrace(System.out);
		}

	}