Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting Visibroker C++ to Standard Java ORB Implementation

Status
Not open for further replies.

slrp

Programmer
Jan 21, 2001
2
0
0
US
I am really in need of some help here! I have Visibroker for C++ running on HP-UX. I have a java client attempt to connect to the server using the standard Java ORB implementation with the following code:
<B>Properties props = new Properties();
props.put(&quot;org.omg.CORBA.ORBClass&quot;, &quot;com.sun.corba.se.internal.iiop.ORB&quot;);
props.put(&quot;org.omg.CORBA.ORBSingletonClass&quot;, &quot;com.sun.corba.se.internal.iiop.ORB&quot;);
props.put(&quot;ORBInitialHost&quot;, &quot;10.80.62.30&quot;);
props.put(&quot;ORBInitialPort&quot;, &quot;140015&quot;);
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init((String[])null, props);
org.omg.CORBA.Object objRef = orb.resolve_initial_references(&quot;NameService&quot;);
</B>

An exception is thrown when I hit this line:
<B> org.omg.CORBA.Object objRef = orb.resolve_initial_references(&quot;NameService&quot;);
</B>

The exception is:
org.omg.CORBA.COMM_FAILURE: minor code: 1398079490 completed: No
at com.sun.corba.se.internal.iiop.IIOPConnection.writeLock(IIOPConnection.java:919)
at com.sun.corba.se.internal.iiop.IIOPConnection.send(IIOPConnection.java:980)

Has anyone been able to connect the standard Java ORB Implementation with Visibroker for C++?

Can anyone provide any examples of what the process is to do so?

Any help would be greatly appreciated!
 
hai,
iam too facing the same prob.do let me know the way if u have solved the problem,
bye
lake
 
//Visibroker Test Stub (idl2java)
import ksc_objects_vb.*;
import java.io.*;
import org.omg.CosNaming.*;

public class nvb_testStub
{
public static void main(String args[])
{
try {
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);

String filename = &quot;ns.ior&quot;;
FileInputStream fis = new FileInputStream(filename);
DataInputStream dis = new DataInputStream(fis);
String ior = dis.readLine();

org.omg.CORBA.Object rootObj = orb.string_to_object(ior);

NamingContextExt root = NamingContextExtHelper.narrow(rootObj);
NameComponent nc = new NameComponent(&quot;arborManager&quot;, &quot;&quot;);
NameComponent[] n = {nc};
org.omg.CORBA.Object obj = ((NamingContext)root).resolve(n);

Arbor arbor = ArborHelper.narrow(obj);
long cnt = arbor.getCount();

System.out.println(cnt);

} catch(Exception e) {
System.out.println(&quot;STUPID Error : &quot; + e);
e.printStackTrace(System.out);
}
}
}


too little too late most likely but here is a working example... Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top