Discussion:
[omniORB] Problem with Persistent POA
srinath duraisamy
2009-10-29 18:02:27 UTC
Permalink
Hi All,

I am creating a POA with PERSISTENT policy and activating a servant in that
POA. Also I am binding that servant into Naming Service. On the client side
I am getting the reference to the object from the Naming Serive and method
invocation works.

Since Server POA is with PERSISTENT policy the reference of the object
should be valid even server gets restarted. But when I restart the server
and call a method with the same reference, I am getting the COMM_FAILURE
exception.

Have any one faced this error with omniorb ? or correct me if my
understanding is wrong.

Thanks and regards
Srinath.D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20091029/8b4e5c57/attachment.htm
Igor Lautar
2009-10-29 18:15:24 UTC
Permalink
Hi,
Post by srinath duraisamy
I am creating a POA with PERSISTENT policy and activating a servant in that
POA. Also I am binding that servant into Naming Service. On the client side
I am getting the reference to the object from the Naming Serive and method
invocation works.
Since Server POA is with PERSISTENT policy the reference of the object
should be valid even server gets restarted. But when I restart the server
and call a method with the same reference, I am getting the COMM_FAILURE
exception.
Have any one faced this error with omniorb ? or correct me if my
understanding is wrong.
So you're trying to achieve that your IOR are not changing when service is
restarted?

The only way to do it with omniORB (others, correct me if I'm wrong) is to use
omniINSPOA. Actually, we use it in that way and there is no need for naming
service then (as corbaloc URI can be used instead).

Regards,
Igor
Duncan Grisby
2009-10-29 20:00:58 UTC
Permalink
On Thu, 2009-10-29 at 14:14 +0100, Igor Lautar wrote:

[...]
Post by Igor Lautar
Post by srinath duraisamy
Since Server POA is with PERSISTENT policy the reference of the object
should be valid even server gets restarted. But when I restart the server
and call a method with the same reference, I am getting the COMM_FAILURE
exception.
Have any one faced this error with omniorb ? or correct me if my
understanding is wrong.
So you're trying to achieve that your IOR are not changing when service is
restarted?
The only way to do it with omniORB (others, correct me if I'm wrong) is to use
omniINSPOA. Actually, we use it in that way and there is no need for naming
service then (as corbaloc URI can be used instead).
omniINSPOA is an orthogonal thing to what Srinith is asking.

If you use a PERSISTENT POA, and want its object references to survive
restarts, you must also ensure it starts up with the same endPoints each
time, by setting the endPoint parameter suitably. For example, you can
make it always start listening on port 12345 by giving command line
arguments -ORBendPoint giop:tcp::12345

omniINSPOA allows you to create objects with simple string keys,
allowing you to use simple corbaloc URIs to refer to persistent objects.
If you do that, you probably also want to specify endPoints, otherwise
the port number will change each time.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
srinath duraisamy
2009-10-30 16:14:41 UTC
Permalink
Hi Duncan, Igor

Thanks for you suggestions.

@Duncan
I tried your suggestions.
I started my server with -ORBendPoint option. Run my client got a reference
for server from naming service.
When I restarted the server again I am getting the following error

$ build/Server.exe -ORBInitRef NameService=corbaname::localhost -ORBendPoint
giop:tcp:localhost:2810
omniORB: Failed to bind to address 127.0.0.1 port 2810. Address in use?
omniORB: Error: Unable to create an endpoint of this description:
giop:tcp:localhost:2810
Caught CORBA::INITIALIZE

It is not able rebind to the port again. Whether I have to do anything in
windows for rebinding the port.

Also I tried testing persistent_objref example in omniORB source code. I
redirected the output to a file and run the eg2_clt.exe with IOR as argument
first time it is working fine. when I restart the server(using ctrl+c)
client gives
Caught a CORBA::OBJECT_NOT_EXIST error.

What I am doing wrong here? is this problem with my version of omniORB(my
version is omniORB-4.1.3) or my assumption is wrong.

Thanks and regards
Srinath.D
Post by srinath duraisamy
[...]
Post by Igor Lautar
Post by srinath duraisamy
Since Server POA is with PERSISTENT policy the reference of the object
should be valid even server gets restarted. But when I restart the
server
Post by Igor Lautar
Post by srinath duraisamy
and call a method with the same reference, I am getting the
COMM_FAILURE
Post by Igor Lautar
Post by srinath duraisamy
exception.
Have any one faced this error with omniorb ? or correct me if my
understanding is wrong.
So you're trying to achieve that your IOR are not changing when service
is
Post by Igor Lautar
restarted?
The only way to do it with omniORB (others, correct me if I'm wrong) is
to use
Post by Igor Lautar
omniINSPOA. Actually, we use it in that way and there is no need for
naming
Post by Igor Lautar
service then (as corbaloc URI can be used instead).
omniINSPOA is an orthogonal thing to what Srinith is asking.
If you use a PERSISTENT POA, and want its object references to survive
restarts, you must also ensure it starts up with the same endPoints each
time, by setting the endPoint parameter suitably. For example, you can
make it always start listening on port 12345 by giving command line
arguments -ORBendPoint giop:tcp::12345
omniINSPOA allows you to create objects with simple string keys,
allowing you to use simple corbaloc URIs to refer to persistent objects.
If you do that, you probably also want to specify endPoints, otherwise
the port number will change each time.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20091030/a4cb6bf1/attachment.htm
Duncan Grisby
2009-11-05 23:32:22 UTC
Permalink
Post by srinath duraisamy
I started my server with -ORBendPoint option. Run my client got a
reference for server from naming service.
When I restarted the server again I am getting the following error
$ build/Server.exe -ORBInitRef NameService=corbaname::localhost
-ORBendPoint giop:tcp:localhost:2810
omniORB: Failed to bind to address 127.0.0.1 port 2810. Address in use?
giop:tcp:localhost:2810
Caught CORBA::INITIALIZE
That means something else is using the port. You can use netstat -ano to
see what. Are you sure the previous invocation of your server had
definitely terminated?

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
srinath duraisamy
2009-11-06 13:41:26 UTC
Permalink
@Duncan Thanks for replying.

My scenario is like when a server get crashed and restarted by watchdog.
For persisitent POA it should bind to the same port(using -ORBendPoint
2810).

After Server get crashed I used the netsat -nop TCP to find the port info.
The particular port is in FIN_WAIT_2 state.
Since server is getting crashed it will not be in a position to send the
final FIN. The opearting system should take care of cleaning the ports. In
my case Windows is not cleaning up that port.
When I searched for this problem I found out for the apache servers they are
configuring a time delay for flushing out this ports.

My question is there anything can be anything done on the ORB level for
cleaning up the ports like reducing the time delay, without depending on the
operating systems to clean up the ports while server getting crashed.

Thanks in advance.

Regards
Srinath.D
Post by Duncan Grisby
Post by srinath duraisamy
I started my server with -ORBendPoint option. Run my client got a
reference for server from naming service.
When I restarted the server again I am getting the following error
$ build/Server.exe -ORBInitRef NameService=corbaname::localhost
-ORBendPoint giop:tcp:localhost:2810
omniORB: Failed to bind to address 127.0.0.1 port 2810. Address in use?
giop:tcp:localhost:2810
Caught CORBA::INITIALIZE
That means something else is using the port. You can use netstat -ano to
see what. Are you sure the previous invocation of your server had
definitely terminated?
Cheers,
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20091106/2656854d/attachment-0001.htm
Loading...