Discussion:
[omniORB] Interoperability Problem omniorb c++ server and java client (j2se) - idl from sun
Sebastian Bickel
2006-08-03 01:59:41 UTC
Permalink
Client:
NamingContext nc =
NamingContextHelper.narrow(orb.resolve_initial_references(
"NameService"));

if(nc == null)
System.out.println("nc is NULL");
else
System.out.println("nc is not NULL");

NameComponent[] name = new NameComponent[1];
name[0] = new NameComponent("Login","Object");
org.omg.CORBA.Object o = nc.resolve(name);
CommunicationServer.Login l = LoginHelper.narrow(o);

if (l != null)
{
System.out.println("It's working.");
short ret = l.log_in(username, password);
System.out.println("Retruncode: " + ret);
} else
System.out.println("Not in the naming context");

Server:
CORBA::Short Login_impl::log_in (const char * user, const char * password)
{
std::cout << "Login_impl::log_in" << std::endl;
system("touch /tmp/login_impl");
CORBA::Short ret;
ret = 1;
return m_return;
}


I used omniORB in the actual release version; the java client has been done with jdk 1.5.

The line: System.out.println("Returncode: " + ret); should print:

Returncode: 1

but it is printing:

Returncode: 10709

What am I doing wrong? Am I doing something wrong or is it an implementation problem?

I did a dump with Ethereal/Wireshark, but it did not work.

<One OS to rule them all,
One OS to find them,
<One OS to bring them all
and in the darkness bind them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060802/91cc6e54/attachment.htm
Markus Sabin
2006-08-03 13:15:47 UTC
Permalink
Hi Sebastian,

stupid question: What happens if you return ret instead of m_return?

Regards

Markus
Post by Sebastian Bickel
NamingContext nc =
NamingContextHelper.narrow(orb.resolve_initial_references(
"NameService"));
if(nc == null)
System.out.println("nc is NULL");
else
System.out.println("nc is not NULL");
NameComponent[] name = new
NameComponent[1];
name[0] = new
NameComponent("Login","Object");
org.omg.CORBA.Object o =
nc.resolve(name);
CommunicationServer.Login l = LoginHelper.narrow(o);
if (l != null)
{
System.out.println("It's working.");
short ret =
l.log_in(username, password);
System.out.println("Retruncode: " + ret);
} else
System.out.println("Not
in the naming context");
CORBA::Short Login_impl::log_in (const char * user, const char * password)
{
std::cout << "Login_impl::log_in" << std::endl;
system("touch /tmp/login_impl");
CORBA::Short ret;
ret = 1;
return m_return;
}
I used omniORB in the actual release version; the java client has been done with jdk 1.5.
Returncode: 1
Returncode: 10709
What am I doing wrong? Am I doing something wrong or is it an
implementation problem?
I did a dump with Ethereal/Wireshark, but it did not work.
<One OS to rule them all,
One OS to find them,
<One OS to bring them all
and in the darkness bind them.
------------------------------------------------------------------------
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060803/0e0613b4/attachment.htm
Loading...