Marissa_D
asked on
Persistent Server (Corba Orb Question)
I am trying to initialize 2 orbs within the same persistent server. One orb communicates with a remote server and uses visibroker. The other orb is for the persistent server for the local clients on my server. Both are running on a UNIX platform. Currently, I can't get both orbs initialized. Has anyone tried this before? If so, please let me know what I am doing wrong. Below is a code example:
//------------------------ ---------- -
// HelloTestServer
//------------------------ ---------- -
import java.util.Properties;
import org.omg.CORBA.Object;
import org.omg.CORBA.ORB;
import org.omg.CosNaming.NameComp onent;
import org.omg.CosNaming.NamingCo ntextExt;
import org.omg.CosNaming.NamingCo ntextExtHe lper;
import org.omg.CORBA.Policy;
import org.omg.PortableServer.POA ;
import org.omg.PortableServer.*;
import org.omg.PortableServer.Ser vant;
public class HelloTestServer {
public static void main(String args[]) {
try{
// set far away orb properties
Properties p = new Properties();
p.put("org.omg.CORBA.ORBCl ass", "com.inprise.vbroker.orb.O RB");
p.put("org.omg.CORBA.ORBSi ngletonCla ss", "com.inprise.vbroker.orb.O RB");
p.put("SVCnameroot", "FARAWAY");
p.put("ORBagentAddr", "1.2.3.4");
System.out.println("Set properties for far away orb ...");
// Set local orb properties
Properties w = new Properties();
w.put("org.omg.CORBA.ORBIn itialHost" , "localhost");
w.put("org.omg.CORBA.ORBIn itialPort" , "1050");
System.out.println("Set properties for local orb ...");
// create and initialize the ORB - Local
ORB orb = ORB.init(args, w);
System.out.println("Initia lized local orb ...");
// create and initialize the ORB - far away
ORB farawayorb = ORB.init(args, p);
System.out.println("Initia lized far away orb ...");
// Instantiate the servant
HelloTestServant hellotestServant = new HelloTestServant(orb, farawayorb);
System.out.println("Instan tiated Local servant ...");
//------------------------
// HelloTestServer
//------------------------
import java.util.Properties;
import org.omg.CORBA.Object;
import org.omg.CORBA.ORB;
import org.omg.CosNaming.NameComp
import org.omg.CosNaming.NamingCo
import org.omg.CosNaming.NamingCo
import org.omg.CORBA.Policy;
import org.omg.PortableServer.POA
import org.omg.PortableServer.*;
import org.omg.PortableServer.Ser
public class HelloTestServer {
public static void main(String args[]) {
try{
// set far away orb properties
Properties p = new Properties();
p.put("org.omg.CORBA.ORBCl
p.put("org.omg.CORBA.ORBSi
p.put("SVCnameroot", "FARAWAY");
p.put("ORBagentAddr", "1.2.3.4");
System.out.println("Set properties for far away orb ...");
// Set local orb properties
Properties w = new Properties();
w.put("org.omg.CORBA.ORBIn
w.put("org.omg.CORBA.ORBIn
System.out.println("Set properties for local orb ...");
// create and initialize the ORB - Local
ORB orb = ORB.init(args, w);
System.out.println("Initia
// create and initialize the ORB - far away
ORB farawayorb = ORB.init(args, p);
System.out.println("Initia
// Instantiate the servant
HelloTestServant hellotestServant = new HelloTestServant(orb, farawayorb);
System.out.println("Instan
What is the error message you are getting?
ASKER
Currently, I am getting the following error:
FATAL: application error: Exception: null
__________________________ __________ __________ __
However, I was getting the following before I started using the "Properties" object:
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.inprise.vbroker.orb.OR B vmcid: 0x0 minor code: 0 completed: No
If it helps, I got both orbs initialized and communicating with each other in a transient server. However, I need both initialized in a persistent server.
FATAL: application error: Exception: null
__________________________
However, I was getting the following before I started using the "Properties" object:
org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.inprise.vbroker.orb.OR
If it helps, I got both orbs initialized and communicating with each other in a transient server. However, I need both initialized in a persistent server.
Hmmm, firstly I have to tell you that I am not a CORBA expert. All my knwoledge about CORBA comes only from a three-months period when I was doing some in one of my previous jobs.
With regards to your problem it seems to me that it has to do with the ORB that inprise uses by default. What I am thinking is that the VM cannot find it on startup and then it has to use the default Sun ORB, which might not be fully compliant with the vbroker's ORB.
What I suggest you do is to make sure the vbroker's ORB is indeed in your classpath and copy your orb.properties file in your JAVA_HOME/jre/lib folder.
Hope it helps.
With regards to your problem it seems to me that it has to do with the ORB that inprise uses by default. What I am thinking is that the VM cannot find it on startup and then it has to use the default Sun ORB, which might not be fully compliant with the vbroker's ORB.
What I suggest you do is to make sure the vbroker's ORB is indeed in your classpath and copy your orb.properties file in your JAVA_HOME/jre/lib folder.
Hope it helps.
ASKER
I just checked the Borland site and there is a compatability issue with j2sdk1.4.0 and Visibroker. That version of Java is not supported. Therefore, it will explain some of the problems that I have been having.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I switched to a supported version of java and that fixed my problem.
Hi Marissa thank you for the points. I am glad I helped :-)