
www.Usenet.com
Group Index
Comp Thread Archive from Usenet.com
Re: Net Beans IDE + ORB
- __From__: Rob Ratcliff
- __Subject__: Re: Net Beans IDE + ORB
- __Date__: Sat, 22 Nov 2003 13:41:25 -0600
Jaroslaw,
Assuming that you have a naming service running from the command line like:
orbd -ORBInitialPort 1050 -ORBInitialHost yourHostname
You should be able to specify the parameters:
-ORBInitialHost yourhost -ORBInitialPort 1050
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;
public class Test {
public static void main(String[] args) {
try {
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]);
}
Object obj =
//orb.string_to_object("corbaloc:iiop:yourhost:1050/NameService");
//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?