Discussion:
[omniORB] Ways of passing IOR Reference. NamingService ?
Rajesh Khan
2011-12-28 17:25:28 UTC
Permalink
Hi , i recently constructed two applications a server in C++ which contains
the implementation , and a client in java. Both the applications are on
different computers and so far both work. However the client appication
requires IOR reference of the object to function properly and this IOR is
supplied by the server. Now there a couple of things that i have read and I
am having difficulty putting them altogether during integration such as the
naming service.

Now To avoid constantly inserting the IOR reference in the client , to
function and for the sake of practicality I came up with the following ideas

1-I read that string_to_object also accepts Object URIs (corbaloc and
corbaname) such as following:
*CORBALOC: corbaloc:iiop:myhost.example.com:1234/MyObjectKey*
CORBANAME: *corbaname::myhost/NameService#project/example/echo.obj

I am initially planning to go with CORBALOC just to get something working
Now the problem I am facing with CORBALOC is how do i determine what my
object key is . I read that the object key is embedded in the IOR reference
. Which i obtain by:
obj = ObjectNme->_this();
CORBA::String_var x;
x = orb->object_to_string(obj);
cout << x << endl; --------------------------------This is the IOR.

*Other than the above method I believe the most suitable method to use
would be a naming service. Since it takes you away from managing and
maintaining the IOR .
In this regard I wanted to know if it would be possibe for the C++ server
to binde objects to the naming service with ".id and .kind" names and the
client can access those objects through a particular string passed to the
*string_to_object* parameter ?? if so that would be best and how would that
string look like and an idea on how the server would need to be configured..
*




*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20111228/abe65e2e/attachment.htm
Thomas Lockhart
2011-12-28 21:35:41 UTC
Permalink
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20111228/2da24c85/attachment.htm
Rajesh Khan
2011-12-28 23:14:22 UTC
Permalink
Thanks Thomas for the great suggestion. Before diving into implementation
of java. I just tested my C++ Server and C++ Client using the naming
service on two different computers this time and unfortunately they do not
work.
Earlier I was testing the Server and the client on the same pc and they
were working. My earlier procedure was quiet simple , I would simply start
the naming service using *omniNames -start* and then run the server and the
client .The client would find the data registered by the server on the
naming service with no problem.Is there some other configuration details
that we have to deal with when the server and client are on different
computers on a network?? I think the client needs to know the ip address of
the server. Where would i insert that.. Any suggestions would be
appreciated.
...
**Other than the above method I believe the most suitable method to use
would be a naming service. Since it takes you away from managing and
maintaining the IOR .
In this regard I wanted to know if it would be possibe for the C++ server
to binde objects to the naming service with ".id and .kind" names and the
client can access those objects through a particular string passed to the
*string_to_object* parameter ?? if so that would be best and how would
that string look like and an idea on how the server would need to be
configured..
**
You would use a CosNaming::Name parameter and a call to resolve() to find
the object in the naming service. Then call to narrow() to convert it to
the specific object type you expect. string_to_object() should not be
involved when using the naming service.
hth
- Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20111228/06093198/attachment.htm
Thomas Lockhart
2011-12-29 02:40:28 UTC
Permalink
Post by Rajesh Khan
Thanks Thomas for the great suggestion. Before diving into
implementation of java. I just tested my C++ Server and C++ Client
using the naming service on two different computers this time and
unfortunately they do not work.
Earlier I was testing the Server and the client on the same pc and
they were working. My earlier procedure was quiet simple , I would
simply start the naming service using *omniNames -start* and then run
the server and the client .The client would find the data registered
by the server on the naming service with no problem.Is there some
other configuration details that we have to deal with when the server
and client are on different computers on a network?? I think the
client needs to know the ip address of the server. Where would i
insert that.. Any suggestions would be appreciated.
There are no extra details to worry about with "properly configured
computers". But the usual trouble is with DNS discrepancies. You will
find many threads here on tracking those down, but in my experience if
you look at the IOR published by the server, make sure that the client
understands the host name published in the IOR.

I usually use an IOR decoding tool to look at a "stringified IOR" from
the server. So have the server print that IOR when it starts up or look
at the IOR as published in the naming service.

hth

- Tom
Brian Neal
2011-12-29 05:56:49 UTC
Permalink
Thanks Thomas for the great suggestion. Before diving into implementation of
java. I just tested my C++ Server and C++ Client using the naming service on
two different computers this time and unfortunately they do not work.
Earlier I was testing the Server and the client on the same pc and they were
working. My earlier procedure was quiet simple , I would simply start the
naming service using omniNames -start and then run the server and the client
.The client would find the data registered by the server on the naming
service with no problem.Is there some other configuration details that we
have to deal with when the server and client are on different computers on a
network?? I think the client needs to know the ip address of the server.
Where would i insert that.. Any suggestions would be appreciated.
Did you configure the InitRef for the naming service in your
omniORB.cfg file to point to the remote machine?
Rajesh Khan
2011-12-29 12:04:39 UTC
Permalink
Hi brian , no none of my applications - server or the client had the
omniORB.cfg so i decided to make one .Starting with the server I inserted
the environment variable *OMNIORB_CONFIG* and gave it the path to the
omniORB.cfg. The content of the cfg file is
*
InitRef = NameService=XPA::192.168.56.102*
(XPA is the name of the system running the server application and its ip
add is next to it)

Now when I run the application i get the error
catch (CORBA::NO_RESOURCES&)
{
cerr << "Caught NO_RESOURCES exception. You must configure omniORB "
<< "with the location of the naming service." << endl;
std::cin.get();
return 0;
}

during
obj = orb->resolve_initial_references("NameService");

Any suggestions what must be causing it ??
Post by Rajesh Khan
Post by Rajesh Khan
Thanks Thomas for the great suggestion. Before diving into
implementation of
Post by Rajesh Khan
java. I just tested my C++ Server and C++ Client using the naming
service on
Post by Rajesh Khan
two different computers this time and unfortunately they do not work.
Earlier I was testing the Server and the client on the same pc and they
were
Post by Rajesh Khan
working. My earlier procedure was quiet simple , I would simply start the
naming service using omniNames -start and then run the server and the
client
Post by Rajesh Khan
.The client would find the data registered by the server on the naming
service with no problem.Is there some other configuration details that we
have to deal with when the server and client are on different computers
on a
Post by Rajesh Khan
network?? I think the client needs to know the ip address of the server.
Where would i insert that.. Any suggestions would be appreciated.
Did you configure the InitRef for the naming service in your
omniORB.cfg file to point to the remote machine?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20111228/82d64687/attachment.htm
Rajesh Khan
2011-12-29 18:22:13 UTC
Permalink
So after a little more experimentation and research I managed to remove the
NO_RESOURCES error , it seems that environment variables requires a
complete path along with the name of the cfg file to be included. Now
getting back to the issue of running the server and the client to exchange
data while running on two separate machines. Since initially i did not have
.cfg on either the server or the client I decided to include one as I was
recommended.Both the server and client contained this file

omniORB.cfg
NameService=corbaname::ComputerName
InitRef = NameService=corbaname::ComputerName:2809/NameService
(ComputerName is the name of the system running the respective application)

However even after including the .cfg files it seems that the Client is
unable to access the data at the system
Post by Rajesh Khan
Hi brian , no none of my applications - server or the client had the
omniORB.cfg so i decided to make one .Starting with the server I inserted
the environment variable *OMNIORB_CONFIG* and gave it the path to the
omniORB.cfg. The content of the cfg file is
*
InitRef = NameService=XPA::192.168.56.102*
(XPA is the name of the system running the server application and its ip
add is next to it)
Now when I run the application i get the error
catch (CORBA::NO_RESOURCES&)
{
cerr << "Caught NO_RESOURCES exception. You must configure omniORB "
<< "with the location of the naming service." << endl;
std::cin.get();
return 0;
}
during
obj = orb->resolve_initial_references("NameService");
Any suggestions what must be causing it ??
Post by Rajesh Khan
Post by Rajesh Khan
Thanks Thomas for the great suggestion. Before diving into
implementation of
Post by Rajesh Khan
java. I just tested my C++ Server and C++ Client using the naming
service on
Post by Rajesh Khan
two different computers this time and unfortunately they do not work.
Earlier I was testing the Server and the client on the same pc and they
were
Post by Rajesh Khan
working. My earlier procedure was quiet simple , I would simply start
the
Post by Rajesh Khan
naming service using omniNames -start and then run the server and the
client
Post by Rajesh Khan
.The client would find the data registered by the server on the naming
service with no problem.Is there some other configuration details that
we
Post by Rajesh Khan
have to deal with when the server and client are on different computers
on a
Post by Rajesh Khan
network?? I think the client needs to know the ip address of the server.
Where would i insert that.. Any suggestions would be appreciated.
Did you configure the InitRef for the naming service in your
omniORB.cfg file to point to the remote machine?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20111229/eddb120a/attachment.htm
Rajesh Khan
2011-12-29 19:26:55 UTC
Permalink
Just got it working .. had the wrong computer name next to the service...
Thanks again for the help
Post by Rajesh Khan
So after a little more experimentation and research I managed to remove
the NO_RESOURCES error , it seems that environment variables requires a
complete path along with the name of the cfg file to be included. Now
getting back to the issue of running the server and the client to exchange
data while running on two separate machines. Since initially i did not have
.cfg on either the server or the client I decided to include one as I was
recommended.Both the server and client contained this file
omniORB.cfg
NameService=corbaname::ComputerName
InitRef = NameService=corbaname::ComputerName:2809/NameService
(ComputerName is the name of the system running the respective application)
However even after including the .cfg files it seems that the Client is
unable to access the data at the system
Post by Rajesh Khan
Hi brian , no none of my applications - server or the client had the
omniORB.cfg so i decided to make one .Starting with the server I inserted
the environment variable *OMNIORB_CONFIG* and gave it the path to the
omniORB.cfg. The content of the cfg file is
*
InitRef = NameService=XPA::192.168.56.102*
(XPA is the name of the system running the server application and its ip
add is next to it)
Now when I run the application i get the error
catch (CORBA::NO_RESOURCES&)
{
cerr << "Caught NO_RESOURCES exception. You must configure omniORB "
<< "with the location of the naming service." << endl;
std::cin.get();
return 0;
}
during
obj = orb->resolve_initial_references("NameService");
Any suggestions what must be causing it ??
Post by Rajesh Khan
Post by Rajesh Khan
Thanks Thomas for the great suggestion. Before diving into
implementation of
Post by Rajesh Khan
java. I just tested my C++ Server and C++ Client using the naming
service on
Post by Rajesh Khan
two different computers this time and unfortunately they do not work.
Earlier I was testing the Server and the client on the same pc and
they were
Post by Rajesh Khan
working. My earlier procedure was quiet simple , I would simply start
the
Post by Rajesh Khan
naming service using omniNames -start and then run the server and the
client
Post by Rajesh Khan
.The client would find the data registered by the server on the naming
service with no problem.Is there some other configuration details that
we
Post by Rajesh Khan
have to deal with when the server and client are on different
computers on a
Post by Rajesh Khan
network?? I think the client needs to know the ip address of the
server.
Post by Rajesh Khan
Where would i insert that.. Any suggestions would be appreciated.
Did you configure the InitRef for the naming service in your
omniORB.cfg file to point to the remote machine?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20111229/524a2f0f/attachment.htm
Loading...