Problem with ORBit2 Client connecting to Jacorb Name Server



Hi,

I am attempting to get a ORBit2  client  to connect an use an object 
from a Jacorb name server. I am getting a segmentation fault
and I am wondering if anybody can help me. The following shows the 
software versions the source code and the error messages that I get.

ORBit2.2.9.1
JacORB 1.4.1

Source Code

CORBA_ORB g_orb;
CORBA_Environment g_ev;
CORBA_string *g_securitytag;


int main( argc, argv)
int argc;
char *argv[];
{
    CosNaming_NamingContextExt l_name_server;
    CORBA_Object l_usermanager;
    struct ConfigDetails l_config;
    pool l_pool;
    CORBA_long l_retval;
    CORBA_char *l_temp;

    fprintf(stderr, "Starting Server\n");

    CORBA_exception_init(&g_ev);
    fprintf(stderr, "Successfully setup Corba Exceptions Environment\n");
    g_orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", &g_ev);

    fprintf(stderr, "Successfully inited Corba\n");

    if ( g_ev._major != CORBA_NO_EXCEPTION ) {
       fprintf(stderr, "Error Initializing ORB\n");
    }

    l_name_server = (CosNaming_NamingContextExt) 
CORBA_ORB_resolve_initial_references(g_orb, "NameService", &g_ev);
    if ( g_ev._major != CORBA_NO_EXCEPTION ) {
       fprintf(stderr, "Error With Name Server\n");
    }
    fprintf(stderr, "Successfully got the nameserver\n");
    if ((l_name_server == CORBA_OBJECT_NIL) || (l_name_server == NULL)) {
       fprintf(stderr, "not!!\n");
    }
    CORBA_Object_is_a(l_name_server, 
"IDL:omg.org/CosNaming/NamingContextExt:1.0", &g_ev);
    if ( g_ev._major != CORBA_NO_EXCEPTION ) {
       fprintf(stderr, "Not a Ext Name Server\n");
    }

    fprintf(stderr, "About to try getting a user manager\n");
    l_usermanager = 
CosNaming_NamingContextExt_resolve_str(l_name_server, 
CORBA_string_dup("UserManager"), &g_ev);
    if ( g_ev._major != CORBA_NO_EXCEPTION ) {
       fprintf(stderr, "No User Manager\n");
    } else {
       fprintf(stderr, "Successfully got the UserManager\n");
    }

     //Do stuff
}

I run the program with the following arguments
 -ORBDebugFlags=traces:types:timings:errors:messages:objects:giop:refs 
-ORBIIOPIPv4=1 -ORBInitRef NameService=`cat /home/greg/ns.ior`
Starting Server
Successfully setup Corba Exceptions Environment
Have safe dir '/tmp/orbit-greg'
** WARNING **: Ignoring incoming code_sets component
Lookup 'IDL:omg.org/CosNaming/NamingContextExt:1.0' (0x8050998) == (nil)
Profiles: Segmentation fault

and  the IOR looks like

IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E300000000000020000000000000074000102000000000E3139322E3136382E312E31303100815B0000001F5374616E646172644E532F4E616D655365727665722D504F412F5F726F6F7400000000020000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000010000002C0000000000000001000000010000001C00000000000100010000000105010001000101090000000105010001

Any help would be most appreciated as I can't see what I have done wrong.

Thanks in advance
    Greg






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]