ORB Initialization ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

ORB Initialization ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Post by Phant » Wed, 16 Oct 2002 16:13:58



HI,

I'm using VC++ 6.0 - MICO - WINXP.

The server code is by Orbix and I compile the IDL suing MICO in VC.

My program ( Symposium sample code actually) builds ,compiles
andlinks fine with the MICO and stub libraries

CODE:

#include <tchar.h>
#include <conio.h>
#include <stdio.h>
#include "rtd.hh"
#include "CosNaming.hh"

extern "C" int _tmain (int argc, TCHAR **argv, TCHAR **envp);

int _tmain (int argc, TCHAR **argv, TCHAR **envp)
{
        CORBA::Environment env;
        CORBA::ORB_var orbVar;
        CORBA::Object_var objVar;
        CosNaming::NamingContext_var rootContext;
        CosNaming::Name nsName(3);
        RsmSrv_var RsmServerVar;
        SkillsetRtd_var SkillsetRtdVar;
        NI_Version clVersion;
        NI_UserId UserId;
        NI_seqSkillsetName seqSkillsetNameVarBd(1);
        NI_seqSklId seqSklIdVarBd(1);
        NI_seqSkillsetName * seqSkillsetNameVarUb;
        NI_seqSklId * seqSklIdVarUb;
        char chInput;
        int iNumOfChar = 0;
        int iArgc = 0;
// Obtain the RtdSrv object
        _tprintf(_TEXT("Binding to RSM.\n"));
        try
        {
/****************The next line throws an exception*/
                orbVar = CORBA::ORB_init(iArgc, NULL,"Orbix");
                objVar = orbVar->resolve_initial_references("NameService");
                if (rootContext = CosNaming::NamingContext::_narrow(objVar))
                {
                        nsName.length(3);
/*...and so on*/
        }
        catch (const CORBA::Exception& x)
        {
                _tprintf(_TEXT("Initialize Corba connection failed.\n"));
                cout<<x <<endl;
                getch();
                return -1;
        }
        _tprintf(_TEXT("Bind to RSM Server succeeded.\n"));
/*..do something*/
        return 0;

Quote:}

The program throws the following exception:

Binding to RSM.
Initialize Corba connection failed.
IDL:omg.org/CORBA/INITIALIZE:1.0 (0, not-completed)

What is worong with the code?? or should I use Orbix instead of MICO??
I'm completely new to CORBA though not to VC++.

Help me!!

Phantom

 
 
 

ORB Initialization ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Post by bjorn rohde jense » Wed, 16 Oct 2002 16:51:22


Hi there,

  I am no expert on Orbix or Mico, but i am quite sure,
that Mico chokes on this line;

 > orbVar = CORBA::ORB_init(iArgc, NULL,"Orbix");

You should use the corresponding Mico orb identifier
or use the generic CORBA::ORB_init(argc,argv) form.
Mico can not create an Orbix orb for you;)

Yours sincerely,

Bjorn