[omniORB] Initiating orbs in multiple environments.

Robert Summerlin robert.summerlin at us.solution6.com
Thu Oct 9 18:41:52 BST 2003


Help,

I am attempting to initialize 3 orbs  ( which will reside on three separate
,i.e, dev08:2809, dev10:2809, dev11:2809) using the below code segment.
Server names and port combinations are passed from the arrayList.  My code
is compiling successfully however during run-time only the first orb is
working properly.

Based on the code segment below can you tell why my orbs 2 & 3 are not
communicating?

I setup omninames the exact same way on all three servers.   If I remove one
of the servers from the list and try to initialize two servers, only the
first init works.  Example if I initialize an  arrayList which contains
dev10:2809 and dev11:2809, only dev10:2809 will work properly.

Thank you for your assistance!!!

------------------------------------------------Code Segment Below
------------------------------------------------------------

stringTokenizer(serverList, arrayList, &serverCount);

		cacheServers =
(com::novient::nfc::gen::cache::CacheRemoteMgr_var*) malloc(serverCount *
sizeof(com::novient::nfc::gen::cache::CacheRemoteMgr_var));
	
		memset(cacheServers, (int) NULL, serverCount *
sizeof(com::novient::nfc::gen::cache::CacheRemoteMgr_var));

		for (int i = 0; i < serverCount; i++) {
				
			strcpy(str,"NameService=corbaloc::");
			strcat(str,arrayList[i]);
			strcat(str,"/NameService");
			
			argument[0] = "";
			argument[1] = "-ORBInitRef";
			argument[2] = str;

			printMessage(pSrvProc, str);
			
			orb = CORBA::ORB_init(nArg, argument, "omniORB3");

			CORBA::Object_var obj = orb->string_to_object();

			rootContext =
CosNaming::NamingContext::_narrow(orb->resolve_initial_references("NameServi
ce"));

			name.length(3);

			name[0].id = (const char *) "Novient";
			name[1].id = (const char *) "Cache";
			name[2].id = (const char *) "CacheMgr";
						
			resname = rootContext->resolve(name);
			
			cacheserver =
com::novient::nfc::gen::cache::CacheRemoteMgr::_narrow(resname);

			cacheServers[i] = cacheserver;

		}

_________________________
visit <http://www.solution6.com>
This email message (and attachments) may contain information that is confidential to Solution 6.
If you are not the intended recipient you cannot use, distribute or copy the message or attachments.
In such a case, please notify the sender by return email immediately and erase all copies of the message and attachments.
Opinions, conclusions and other information in this message and attachments that do not relate to the official business of Solution 6 are neither given nor endorsed by it.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20031009/759e8e7c/attachment-0001.htm


More information about the omniORB-list mailing list