[omniORB] Problems with Java to C++ connection
Nadav Gelman
Nadav-g@orbotech.com
Sun Mar 30 11:30:03 2003
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C2F6A6.D3E80F00
Content-Type: text/plain;
charset="WINDOWS-1255"
Hi All,
I'm trying to establish a connection between a C++ sever and Java Client. my
configuration is:
1. Win2000 VC++ 6 and Jbuilder 5 JDK Version 1.4.0 Beta
2. omniORB 4.0 with omniNames as the NameServer
3. I ran the echo sever from the examples and an echo client in java.
My problems are:
1. I can't resolve an initial reference to the NameServer from Java. (I
overcame this obstacle using IOR string, but this is not a good solution )
2. I can't resolve a reference to my published object.I get a Marshal error.
(I overcame it using IOR as well but this is not a good solution...)
3. I can't invoke the echoString(string) method I get exception in the
following line:
public class _EchoStub extends org.omg.CORBA.portable.ObjectImpl implements
Echo
{
public String echoString (String mesg)
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("echoString",
true);
$out.write_string (mesg);
$in = _invoke ($out);
String $result = $in.read_string ();
return $result;
} catch (org.omg.CORBA.portable.ApplicationException $ex) {
$in = $ex.getInputStream ();
String _id = $ex.getId ();
throw new org.omg.CORBA.MARSHAL (_id);
} catch (org.omg.CORBA.portable.RemarshalException $rm) {
return echoString (mesg);
} finally {
_releaseReply ($in);
}
} // echoString
.................................................
I'll be happy if someone has an idea what I do wrong.
Thanks,
Nadav.
------_=_NextPart_001_01C2F6A6.D3E80F00
Content-Type: text/html;
charset="WINDOWS-1255"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DWINDOWS-1255">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>Problems with Java to C++ connection </TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">Hi All,</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I'm trying to establish a connection =
between a C++ sever and Java Client. my configuration is:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">1. Win2000 VC++ 6 and Jbuilder 5 JDK =
Version 1.4.0 Beta</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">2. omniORB 4.0 with omniNames as the =
NameServer</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial (Hebrew)">3</FONT><FONT SIZE=3D2 =
FACE=3D"Arial">. I ran the echo sever from the examples and an echo =
client in java.</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">My problems are:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">1. I can't resolve an initial =
reference to the NameServer from Java. (I overcame this obstacle using =
IOR string, but this is not a good solution )</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">2. I can't resolve a reference to my =
published object.I get a Marshal error. (I overcame it using IOR as =
well but this is not a good solution...)</FONT></P>
<P><FONT SIZE=3D2 FACE=3D"Arial">3. I can't invoke the =
echoString(string) method I get exception in the following line:</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">public class _EchoStub extends =
org.omg.CORBA.portable.ObjectImpl implements Echo</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">{</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial"> public String echoString =
(String mesg)</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> {</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
org.omg.CORBA.portable.InputStream $in =3D null;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> try {</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
</FONT><FONT COLOR=3D"#FF0000" SIZE=3D2 =
FACE=3D"Arial">org.omg.CORBA.portable.OutputStream $out =3D _request =
("echoString", true);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
$out.write_string (mesg);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
$in =3D _invoke ($out);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
String $result =3D $in.read_string ();</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
return $result;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> } catch =
(org.omg.CORBA.portable.ApplicationException $ex) {</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
$in =3D $ex.getInputStream ();</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
String _id =3D $ex.getId ();</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
throw new org.omg.CORBA.MARSHAL (_id);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> } catch =
(org.omg.CORBA.portable.RemarshalException $rm) {</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> =
return echoString (mesg);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> } finally {</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial"> _releaseReply =
($in);</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> }</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial"> } // echoString</FONT>
</P>
<P><FONT SIZE=3D2 =
FACE=3D"Arial">.................................................</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">I'll be happy if someone has an idea =
what I do wrong.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Thanks,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Nadav.</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C2F6A6.D3E80F00--