Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IOR problem......

11 views
Skip to first unread message

mka...@clemson.edu

unread,
Mar 1, 1998, 3:00:00 AM3/1/98
to

Hello corba gurus,
I was experimenting with interoperability issue in CORBA (to make a java
client talk with C++ server or vice-versa). So for this i started off writing
a program (BOTH client & server in JAVA). I tried getting IOR of a java server
& wrote it to a file & then tried reading that IOR thru the java client & then
access the server (I tried this- as the Orbixweb loaded on our system doesn't
have naming service classes (CosNaming..)).
But this doesn`t seem to work properly, i get an exception message saying -
*************************
java.lang.StackOverflowError
at java.lang.StringBuffer.<init>(StringBuffer.java)
at IE.Iona.OrbixWeb.CORBA.BaseObject._objref_assemble(BaseObject.java)
at
IE.Iona.OrbixWeb.CORBA.BaseObject.objref_from_markerserver(BaseObject.java)
at IE.Iona.OrbixWeb.CORBA.DaemonMgr._bind(DaemonMgr.java)
at IE.Iona.OrbixWeb.CORBA.ConnectTable.get_daemon(ConnectTable.java)
at IE.Iona.OrbixWeb.CORBA.ConnectTable.get_daemon(ConnectTable.java)
at IE.Iona.OrbixWeb.IIOP.IIOPProt.getIIOPDetails(IIOPProt.java)
at IE.Iona.OrbixWeb.CORBA.Request.initialiseBuffer(Request.java)
at IE.Iona.OrbixWeb.CORBA.Request.<init>(Request.java)
at IE.Iona.OrbixWeb.CORBA.BaseObject._IT_PING(BaseObject.java)
............
**************************
and the funny thing is- it keeps on printing these messages as if it went into
an infinite loop.

Now, these r my client & server program parts where i was trying the IOR
implementation -

my server pgm-
**********************
String fileName = new String("accountIO.ior");

OutputStream fOut = new FileOutputStream (fileName);
DataOutputStream outPut = new DataOutputStream (fOut);
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();

try {
AccountImplementation a_i = new AccountImplementation(0,"chris");
accImpl = new _tie_Account (a_i);
if (accImpl == null) {
System.out.println("accImpl is null..");
}
try {
stringifiedIOR = (String) orb.object_to_string(accImpl);
System.out.println("in server..."+stringifiedIOR); ****<--- L1
outPut.writeChars(stringifiedIOR);
fOut.close();
}
catch(org.omg.CORBA.SystemException se) {
System.out.println("Exception " + se.toString());
}
finally {
System.out.println("####### $$$$$"); *****<----- L2
}
_CORBA.Orbix.impl_is_ready("AccountSrv");

********************** there r couple of things to be noticed here- L1 prints
the IOR, which is :
IOR:000000000000001049444c3a4163636f756e743a312e300000000001000000000000005b0
00100000000001767616e64616c662e63732e636c656d736f6e2e656475000006230000000000
333a5c67616e64616c662e63732e636c656d736f6e2e6564753a4163636f756e745372763a303
a3a4946523a4163636f756e7400 I was wondering if this what i shud get (is
this the string format of IOR?) btw i compiled the IDL file using -m interOP
option so it uses IIOP.

also L2 is printed on the server console for some reason, i dont think there
shud be any exception raised in this part of the code, but i always get that
thing printed.

now my CLIENT JAVA looks something like-
**************************

String fileName = new String("accountIO.ior");

FileInputStream fIn = new FileInputStream(fileName);
DataInputStream inPut = new DataInputStream (fIn);
String tmp = inPut.readLine();
System.out.println (tmp); *****<-- L1
fIn.close();

org.omg.CORBA.Object o = null;
Account curAct = null;
try {
o = orb.string_to_object((String)tmp);
if (o == null) {
System.out.println("account objref is nill!");
}

}
catch (org.omg.CORBA.SystemException ex) {
System.out.println("exception during bind b'cos ");
System.out.println(ex.toString());
System.exit(1);
}
finally {
System.out.println("########## $$$$$$ "); ****<--- L2
}

try {
curAct = AccountHelper.narrow(o);
............

*****************************

note that the client program first prints L1 which matches the server printed
String (IOR).
Also L2 is printed & then the exception message which i listed in the begining
of this long mail is printed.

I have no clue what is going on here.
Help please......
thanks,

Murali

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading

Pongsatorn Sukhum

unread,
Mar 3, 1998, 3:00:00 AM3/3/98
to

I have a short program that has a server running on VisiBroker and
talks to a client running on OrbixWeb through IORs. Let me know if
you would like me to email it to you.

Regards, Peter.

------------------------------------------------------------------------
Pongsatorn P. Sukhum
Infowave (Thailand) Co., Ltd.

21/2 Sukhumvit 34
Bangkok 10110 Tel: +66-2 259-7555
Thailand Fax: +66-2 259-7558
------------------------------------------------------------------------
INTERNET suk...@waveman.com
------------------------------------------------------------------------
WWW http://www.waveman.com
------------------------------------------------------------------------

Frank Gruetzmacher

unread,
Mar 3, 1998, 3:00:00 AM3/3/98
to mka...@clemson.edu

In article <6dc8o0$dro$1...@nnrp1.dejanews.com>, mka...@clemson.edu writes:
xrn> my server pgm-
xrn> **********************
xrn> String fileName = new String("accountIO.ior");
xrn>
xrn> OutputStream fOut = new FileOutputStream (fileName);
xrn> DataOutputStream outPut = new DataOutputStream (fOut);
xrn> org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
xrn>
xrn> try {
xrn> AccountImplementation a_i = new AccountImplementation(0,"chris");
xrn> accImpl = new _tie_Account (a_i);
xrn> if (accImpl == null) {
xrn> System.out.println("accImpl is null..");
xrn> }
xrn> try {
xrn> stringifiedIOR = (String) orb.object_to_string(accImpl);
xrn> System.out.println("in server..."+stringifiedIOR); ****<--- L1
xrn> outPut.writeChars(stringifiedIOR);
xrn> fOut.close();
xrn> }
xrn> catch(org.omg.CORBA.SystemException se) {
xrn> System.out.println("Exception " + se.toString());
xrn> }
xrn> finally {
xrn> System.out.println("####### $$$$$"); *****<----- L2
xrn> }
xrn> _CORBA.Orbix.impl_is_ready("AccountSrv");
xrn>
xrn> ********************** there r couple of things to be noticed here- L1 prints
xrn> the IOR, which is :
xrn> IOR:000000000000001049444c3a4163636f756e743a312e300000000001000000000000005b0
xrn> 00100000000001767616e64616c662e63732e636c656d736f6e2e656475000006230000000000
xrn> 333a5c67616e64616c662e63732e636c656d736f6e2e6564753a4163636f756e745372763a303
xrn> a3a4946523a4163636f756e7400 I was wondering if this what i shud get (is
xrn> this the string format of IOR?) btw i compiled the IDL file using -m interOP
xrn> option so it uses IIOP.
xrn>

I would try to use impl_is_ready with a timeout of
zero .. write then the IOR and call processEvents
with the timeout you like !

Maybe this helps !

Good luck !

Frank

-------------------------------------------------------------
| Dipl.-Ing. Frank Gruetzmacher | TelefoN : (03677) 69 1167 |
| Technische Universitaet Ilmenau | (03677) 69 1168 |
| PSF 0565, 98684 Ilmenau | Telefax : (03677) 69 1163 |
|-------------------------------------------------------------|
| E-Mail : gr...@Inf-Technik.TU-Ilmenau.DE |
-------------------------------------------------------------

John Donaldson

unread,
Mar 3, 1998, 3:00:00 AM3/3/98
to


mka...@clemson.edu wrote:

Murali,

I have pretty much the same approach working here.
I am using VisiBroker it's true, but I think that your way
of outputting the IOR in the server is suspect.

> OutputStream fOut = new FileOutputStream (fileName);

> DataOutputStream outPut = new DataOutputStream (fOut);

> org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
>
> try {

> AccountImplementation a_i = new AccountImplementation(0,"chris");

> accImpl = new _tie_Account (a_i);

> if (accImpl == null) {


> System.out.println("accImpl is null..");
> }

> try {
> stringifiedIOR = (String) orb.object_to_string(accImpl);

> System.out.println("in server..."+stringifiedIOR); ****<--- L1

> outPut.writeChars(stringifiedIOR);
> fOut.close();

Instead of writeChars (which is trying to output wide chars I think),
change your DataOutputStream to a PrintWriter and do a print.

John D.

PS. here's the relevant part of my server...

OutputStream fOS = new FileOutputStream (fileName);
PrintWriter pW = new PrintWriter (fOS);

// output the objref for Hospital
String stringifiedIOR = orb.object_to_string( theHosp);
System.out.println( stringifiedIOR);
pW.print( stringifiedIOR);
pW.close();

// ready the object
boa.obj_is_ready( theHosp);
System.out.println( theHosp + "is ready");

0 new messages