Looking Up an Object From the Naming Service This example looks up an object from the naming service. try { Object obj = ctx.lookup("Sample"); } catch (NamingException e) { }