<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.60">
<TITLE>Initiating orbs in multiple environments.</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">Help,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">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.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Based on the code segment below can you tell why my orbs 2 & 3 are not communicating?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">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.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Thank you for your assistance!!!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">------------------------------------------------Code Segment Below ------------------------------------------------------------</FONT></P>
<P><FONT SIZE=2 FACE="Arial">stringTokenizer(serverList, arrayList, &serverCount);</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">cacheServers = (com::novient::nfc::gen::cache::CacheRemoteMgr_var*) malloc(serverCount * sizeof(com::novient::nfc::gen::cache::CacheRemoteMgr_var));</FONT></P>
<P>
<BR> <FONT SIZE=2 FACE="Arial">memset(cacheServers, (int) NULL, serverCount * sizeof(com::novient::nfc::gen::cache::CacheRemoteMgr_var));</FONT></P>
<P> <FONT SIZE=2 FACE="Arial">for (int i = 0; i < serverCount; i++) {</FONT>
<BR>
<BR> <FONT SIZE=2 FACE="Arial">strcpy(str,"NameService=corbaloc::");</FONT>
<BR> <FONT SIZE=2 FACE="Arial">strcat(str,arrayList[i]);</FONT>
<BR> <FONT SIZE=2 FACE="Arial">strcat(str,"/NameService");</FONT>
<BR>
<BR> <FONT SIZE=2 FACE="Arial">argument[0] = "";</FONT>
<BR> <FONT SIZE=2 FACE="Arial">argument[1] = "-ORBInitRef";</FONT>
<BR> <FONT SIZE=2 FACE="Arial">argument[2] = str;</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">printMessage(pSrvProc, str);</FONT>
<BR>
<BR> <FONT SIZE=2 FACE="Arial">orb = CORBA::ORB_init(nArg, argument, "omniORB3");</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">CORBA::Object_var obj = orb->string_to_object();</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">rootContext = CosNaming::NamingContext::_narrow(orb->resolve_initial_references("NameService"));</FONT></P>
<P> <FONT SIZE=2 FACE="Arial">name.length(3);</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">name[0].id = (const char *) "Novient";</FONT>
<BR> <FONT SIZE=2 FACE="Arial">name[1].id = (const char *) "Cache";</FONT>
<BR> <FONT SIZE=2 FACE="Arial">name[2].id = (const char *) "CacheMgr";</FONT>
<BR>
<BR> <FONT SIZE=2 FACE="Arial">resname = rootContext->resolve(name);</FONT>
<BR>
<BR> <FONT SIZE=2 FACE="Arial">cacheserver = com::novient::nfc::gen::cache::CacheRemoteMgr::_narrow(resname);</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">cacheServers[i] = cacheserver;</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">}</FONT>
</P>
</BODY>
<P align=left><FONT face=Tahoma size=2><FONT color=#0000ff></FONT></FONT>_________________________<BR><FONT face=Arial size=1>visit <</FONT><A href="http://www.solution6.com"><FONT face=Arial size=1>http://www.solution6.com</FONT></A><FONT face=Arial size=1>><BR>This email message (and attachments) may contain information that is confidential to Solution 6.<BR>If you are not the intended recipient you cannot use, distribute or copy the message or attachments.<BR>In such a case, please notify the sender by return email immediately and erase all copies of the message and attachments.<BR>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.</FONT><BR> </P></HTML>