Archived

This forum has been archived. Please start a new discussion on GitHub.

client glacier2 issues

hello,my platform is vs 2008 mfc + ice3.3.1 .
the problem comes when i use glacier2.

here is my init code:
InitData.properties = Ice::createProperties();
InitData.properties->setProperty("Ice.Default.Router", "UClientServer/router:tcp -p 4063 -h 122.227.164.41 -t 10000");
InitData.properties->setProperty("Ice.ACM.Client", "0");
InitData.properties->setProperty("Ice.RetryIntervals", "-1");

communicator_default = Ice::initialize(argc,0,InitData);
////////////////////////////////
Glacier2::RouterPrx LoginRouter;
Glacier2::SessionPrx LoginTrySessionPrx;
try{
Glacier2::RouterPrx LoginRouter = Glacier2::RouterPrx::uncheckedCast(m_communicator->getDefaultRouter());

Glacier2::SessionPrx LoginTrySessionPrx = NULL;
}catch(Ice::Exception &e)
{
CString reason = ChoujieclientApp::String2Wide(std::string(e.what()));
AfxMessageBox(reason);
logingdlg->ShowWindow(SW_HIDE);
this->ShowWindow(SW_SHOW);
}
///////////////////////
and the block in which exception occurs :
LoginTrySessionPrx = LoginRouter->createSession(username,password);

exception type is iceutil::NullHandleException

////////////////////
the server is wrien in java. i also got a client from my classmate which is writen in java,the java client are same configured as my mfc client .but it ran without any problems.

/////////////
so any possibily reason can lead to my mfc app throwing the NullHandleException?
can anyone help me ?thx.

Comments

  • further information

    i have made it sure that in the block:
    Glacier2::RouterPrx LoginRouter = Glacier2::RouterPrx::uncheckedCast(m_communicator->getDefaultRouter());

    m_communicator->getDefaultRouter() return Null