import java.io.*; import org.omg.CosNaming.*; public class Server { public static void main(String[] args) { //java.util.Properties props = new java.util.Properties(); //props.put( "org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB" ); //props.put( "org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton" ); //props.put( "jacorb.log.default.verbosity", "4"); //org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props); org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); try { org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper.narrow( orb.resolve_initial_references("RootPOA")); poa.the_POAManager().activate(); org.omg.CORBA.Object o = poa.servant_to_reference(new lsImpl()); System.out.println("writing ior to iorfile.txt"); PrintWriter ps = new PrintWriter(new FileOutputStream(new File("iorfile.txt"))); ps.println(orb.object_to_string(o)); ps.close(); // TODO: if -ns on command line register with nameservice too. orb.run(); } catch (Exception e) { e.printStackTrace(); } } }