Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-03-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
IcePack server registration madness

Hi there!

I've been struggling with the IcePack manual server registration for two days now and I'm no longer sure if this is due to incompetence (most likely) - documentation on that issue is, errr, challenging, to say the least.

So, here's the problem. I want do do indirect binding between a client and a collection of similar objects distributed in a network. The server registers with

Code:
      LoadFetcher* theFetcher=new LoadFetcher();
      IceUtil::ThreadControl tc=theFetcher->start();

      Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("AgentAdapter");

      Ice::ObjectPtr object = new AgentI(*theFetcher);

      Ice::ObjectPrx objPrx = adapter->add(object, Ice::stringToIdentity(IceUtil::generateUUID()));

      IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast(communicator()->stringToProxy("IcePack/Admin"));
      admin->addObjectWithType(objPrx, object->ice_id());

      cout << "Press Ctrl-C to terminate." << endl;
      adapter->activate();
The client (in its simplest form, just to show the issue) does this:

Code:
     
      ic = Ice::initializeWithProperties(argc, argv, properties);

      Ice::ObjectPrx base = ic->stringToProxy(argv[1]);
      CpuMonitor::AgentPrx agent = CpuMonitor::AgentPrx::checkedCast(base);
      
      cout << "CPU Load for agent is " << agent->fetchCpuLoad() << endl;
When I register the first server and then fetch its identity via IcePackAdmin, everything works like a charm:

bash$ direct-client 10A5509D-819D-4371-970D-C01105D5284D
Contacting CPU Load server...
[ Location: retrieved endpoints from locator, adding to locator table
adapter =
endpoints = tcp -h 192.168.1.1 -p 12000 ]
[ Location: retrieved endpoints from locator, adding to locator table
adapter = AgentAdapter
endpoints = tcp -h 192.168.1.1 -p 9593 ]
CPU Load for agent is 0.99
bash$

But when I register a second server, the whole machinery seems to get out of sync. Ignoring which of the two IDs I use as direct-client argument, the output is either the load of the second server or the following:

Contacting CPU Load server...
[ Location: retrieved endpoints from locator, adding to locator table
adapter =
endpoints = tcp -h 192.168.1.1 -p 12000 ]
[ Location: retrieved endpoints from locator, adding to locator table
adapter = AgentAdapter
endpoints = tcp -h 192.168.1.1 -p 9593 ]
Outgoing.cpp:348: Ice::ObjectNotExistException:
object does not exist
identity: 280E2AA5-96C6-4C81-948A-7AC679B50CBF
facet:
operation: ice_isA

Do it another one, two or three times and you're back at the second server's load, just as if IcePack has a bookkeeping problem ?!

Anyone an idea?

Cheers,
Mobi.
Reply With Quote
  #2 (permalink)  
Old 11-03-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Please see this thread regarding our support policy:

Important note: Change in support policy
Reply With Quote
  #3 (permalink)  
Old 11-04-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
Quote:
Originally Posted by marc
Please see this thread regarding our support policy:

Important note: Change in support policy
Hmmmm.... I actually can't see the link between my company association and my IcePack problem, but if you feel you can't give hints without it, here's my sig.

Mobi.
__________________
Dr. Stefan Müller-Wilken
Senior Manager
Resco GmbH

Author of 'Verteilte Internet-Anwendungen mit Ice', iX 07/2005
Author of 'Webbasierte Anwendungen mit IcePHP', iX, 06/2006
Reply With Quote
  #4 (permalink)  
Old 11-04-2005
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,060
I'm sorry but its not really clear how you are trying to do the distribution with your example below, or what the problem you are running into exactly is. Did you read my connections articles on IcePack? It goes through a step by step example of how to setup a chat service with IcePack.
Reply With Quote
  #5 (permalink)  
Old 11-04-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,540
I suspect that you have configured the adapter of each server to use the same adapter id (which is configured with the <adapter name>.AdapterId property). Each adapter should have a distinct adapter id. If that's not the problem, we would need to know a bit more about what you're trying to do and the configuration of your client and servers.

Benoit.
Reply With Quote
  #6 (permalink)  
Old 11-04-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
Quote:
Originally Posted by matthew
I'm sorry but its not really clear how you are trying to do the distribution with your example below, or what the problem you are running into exactly is. Did you read my connections articles on IcePack? It goes through a step by step example of how to setup a chat service with IcePack.
Mat,

thanks for your reply. The point is that I actually don't actively distribute using IcePack but rather register existing Ice objects in a more traditional naming service registration approach. The approach should be visible in the code snippet:

Server side:
------------
- create the object adapter
- initialize the object adapter
- connect to icepackregistry admin interface
- register object proxy with type

Client side:
----------
- fetch object identitiy [ done manually using icepackadmin ]
- cast object identity to object reference
- call object

In the 'real' client, I connect to the icepackregistry query interface, fetch a sequence of all references with appropriate type and iterate over each of them. But as the problem is visible with the minimalistic approach, I sticked to it for the sake of simplicity. ;-)

Does that give you an idea of what I'm trying to do?

Cheers,
Mobi.
__________________
Dr. Stefan Müller-Wilken
Senior Manager
Resco GmbH

Author of 'Verteilte Internet-Anwendungen mit Ice', iX 07/2005
Author of 'Webbasierte Anwendungen mit IcePHP', iX, 06/2006
Reply With Quote
  #7 (permalink)  
Old 11-04-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
Quote:
Originally Posted by benoit
I suspect that you have configured the adapter of each server to use the same adapter id (which is configured with the <adapter name>.AdapterId property). Each adapter should have a distinct adapter id.

Benoit.
Okay. That's indeed the case as they all initialize using the same config property file. But how can that do harm? They each run in their own process and register with IcePack using a unique object identity and IP/Port combination. Isn't that enough to have the client find the right destination?

Mobi.
__________________
Dr. Stefan Müller-Wilken
Senior Manager
Resco GmbH

Author of 'Verteilte Internet-Anwendungen mit Ice', iX 07/2005
Author of 'Webbasierte Anwendungen mit IcePHP', iX, 06/2006
Reply With Quote
  #8 (permalink)  
Old 11-04-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,540
The proxy that you register with the registry is "indirect" (see the IcePack chapter in the manual for more information on direct and indirect binding). It looks like the following:

"10A5509D-819D-4371-970D-C01105D5284D @ AgentAdapter"

So when your client invokes on the identity-only proxy, the locator returns the proxy "10A5509D-819D-4371-970D-C01105D5284D @ AgentAdapter" to your client, and your client query the locator again to get the endoints of the adapter "AgentAdapter". And in your case, this returns the endpoints of the last activated "AgentAdapter" adapter.

You need to set different adapter ids for each object adapter. Or, you might actually not need to set it at all if you only want to use the locator to resolve this given object (if you don't set the adapter id you will register a "direct proxy" that contains the endpoints of the adapter).

Benoit.
Reply With Quote
  #9 (permalink)  
Old 11-04-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
Quote:
Originally Posted by benoit
The proxy that you register with the registry is "indirect" (see the IcePack chapter in the manual for more information on direct and indirect binding). It looks like the following:

"10A5509D-819D-4371-970D-C01105D5284D @ AgentAdapter"

So when your client invokes on the identity-only proxy, the locator returns the proxy "10A5509D-819D-4371-970D-C01105D5284D @ AgentAdapter" to your client, and your client query the locator again to get the endoints of the adapter "AgentAdapter". And in your case, this returns the endpoints of the last activated "AgentAdapter" adapter.
Okay, that makes sense. I had thought into that direction, but discarded that point because I (incorrectly) expected the IP/Port pair that must be hidden in the registration entry somewhere would make it unique.

So, the "@ AgentAdapter" part is caused by the AdapterId property and not by the object adapter creation parameter? I had thought so.

Cheers,
Mobi.
__________________
Dr. Stefan Müller-Wilken
Senior Manager
Resco GmbH

Author of 'Verteilte Internet-Anwendungen mit Ice', iX 07/2005
Author of 'Webbasierte Anwendungen mit IcePHP', iX, 06/2006
Reply With Quote
  #10 (permalink)  
Old 11-04-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,540
Correct. The object adapter creation parameter is the name of the adapter and the adapter id of the object adapter is configured with the property <adapter name>.AdapterId.

Benoit.
Reply With Quote
  #11 (permalink)  
Old 11-04-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
Okay, thanks for the clarification.

Cheers,
Mobi.

PS: By the way, have you noticed the typo on your web site? You've announced the november issue with date of '10-03-2005' which would have been a little early... ;-)
__________________
Dr. Stefan Müller-Wilken
Senior Manager
Resco GmbH

Author of 'Verteilte Internet-Anwendungen mit Ice', iX 07/2005
Author of 'Webbasierte Anwendungen mit IcePHP', iX, 06/2006
Reply With Quote
  #12 (permalink)  
Old 11-04-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Quote:
Originally Posted by Mobiwan
PS: By the way, have you noticed the typo on your web site? You've announced the november issue with date of '10-03-2005' which would have been a little early... ;-)
Oops... it is fixed now..
Reply With Quote
  #13 (permalink)  
Old 11-07-2005
Mobiwan Mobiwan is offline
Registered User
 
Name: Dr. Stefan Müller-Wilken
Organization: Resco GmbH
Project: High performance middleware environments
 
Join Date: Nov 2005
Posts: 14
Quote:
Originally Posted by benoit
I suspect that you have configured the adapter of each server to use the same adapter id (which is configured with the <adapter name>.AdapterId property). Each adapter should have a distinct adapter id. If that's not the problem, we would need to know a bit more about what you're trying to do and the configuration of your client and servers.

Benoit.
I reworked the config file this weekend and it started working instantly. :-)

Cheers,
Mobi.
__________________
Dr. Stefan Müller-Wilken
Senior Manager
Resco GmbH

Author of 'Verteilte Internet-Anwendungen mit Ice', iX 07/2005
Author of 'Webbasierte Anwendungen mit IcePHP', iX, 06/2006
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Registration with IceGrid pradeep Help Center 1 11-21-2006 10:12 AM
Can IcePack Service and server run in different hosts? eyexercise Help Center 11 12-19-2004 09:41 PM
How to register Ice server with IcePack RegistryH rc_hz Help Center 9 11-15-2004 08:30 AM
IcePack Registration notification brian Help Center 4 10-14-2004 03:28 AM
libpath failure for icepack server type java-icebox Tim Bug Reports 2 06-30-2004 05:40 PM


All times are GMT -4. The time now is 10:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.