
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
Assuming that you have a naming service running from the command line like: orbd -ORBInitialPort 1050 -ORBInitialHost yourHostname
in the Properties/Execution/Arguments field corresponding to your program from within NetBeans. (Just right click on the program node in the "Explorer" tree to locate the Properties dialog.) Also, make sure all your jar files are mounted in the Explorer. (Do you have an error message from your run?)
Here's a sample program that worked fine for me from within NetBeans using JDK 1.4.2:
import java.util.Properties; import org.omg.CORBA.ORB; import org.omg.CORBA.Object; import org.omg.CosNaming.NamingContext; import org.omg.CosNaming.NamingContextExtHelper;
Properties props = System.getProperties();
//props.put("org.omg.CORBA.ORBInitialPort","1050");
//props.put("org.omg.CORBA.ORBInitialHost","yourhost");
final ORB orb = ORB.init(args,props); String[] services = orb.list_initial_services();
for (int i = 0; i < services.length; i++) {
System.out.println(services[i]);
}//orb.string_to_object("corbaloc:iiop:[EMAIL PROTECTED]:9001/NameService");
// locate Mico NameService
orb.resolve_initial_references("NameService");
System.out.println(" naming object = " + obj); if (obj != null ) {
NamingContext rootContext =
NamingContextExtHelper.narrow(obj);
System.out.println(" naming object = " + rootContext);
System.out.println(rootContext._non_existent());
} } catch (Exception ex) {
ex.printStackTrace();
}
}
}
Jaroslaw Staszak wrote:
Hallo
Do u know how to start orb server under IDE?
I run my program in commandline in this way:
jre\bin\java -classpath classes;jars\parlay3gpp.jar;security.jar com.ericsson.wda.common.Main -ORBInitialPort 1500 -ORBInitialHost 127.0.0.1
But if I try do this using my IDE ORB doesnt start. I send proper arguments:
In window Build/Set Arguments...) I put:
"ORBInitialPort 1500" "ORBInitialHost 127.0.0.1"
What schould I do to run my ORB?
| <-- __Chronological__ --> | <-- __Thread__ --> |