Discussion:
[omniORB] help!!!!!!!!!!!, an exception under vc6+sp6....................
l l
2008-01-04 13:27:13 UTC
Permalink
help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!:
i am using omniORB4.1.1 under msvc++6.0 + sp6,i test the example(echo),client execute hello fuction succefully ,when client exit ,then server display the exception below,but server does not exit and run continue:
First-chance exception in TestCorba.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
my program is below:
*********server***********
char* Echo_i::echoString(const char* mesg)
{
char RetStr[256];
strcpy(RetStr,mesg);
strcat(RetStr,"--from Server");
//return RetStr;
return CORBA::string_dup(RetStr);
}
int main(int argc, char** argv)
const char* options[][2] = { { "endPoint", "giop:tcp::1234" },{ 0, 0 } };
try
{
CORBA::ORB_var orb = CORBA::ORB_init(argc,
argv,"omniORB4",options);//,options
CORBA::Object_var obj = orb->resolve_initial_references("omniINSPOA");//RootPOA
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
Echo_i* myecho = new Echo_i();
PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId("EchoService");
poa->activate_object_with_id(oid, myecho);
obj = myecho->_this();
CORBA::String_var sior(orb->object_to_string(obj));
cerr << "" << (char*)sior << "" << endl;
myecho->_remove_ref();
PortableServer::POAManager_var pman = poa->the_POAManager();
pman->activate();
orb->run();
}
catch(CORBA::SystemException&)
{
cerr << "Caught CORBA::SystemException." << endl;
}
catch(CORBA::Exception&)
{
cerr << "Caught CORBA::Exception." << endl;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
catch(...) {
cerr << "Caught unknown exception." << endl;
}
return 0;
}

****client**********
int main(int argc, char** argv)
try {
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv,"omniORB4");
CORBA::Object_var obj = orb->string_to_object ("corbaloc:iiop:172.20.56.141:1234/EchoService");
Echo_var echoref = Echo::_narrow(obj);
if( CORBA::is_nil(echoref) )
{
cerr << "Can't narrow reference to type Echo (or it was nil)." << endl;
return 1;
}

// for (CORBA::ULong count=0; count<10; count++)
hello(echoref);
orb->destroy();
}
catch(CORBA::TRANSIENT&) {
cerr << "Caught system exception TRANSIENT -- unable to contact the "
<< "server." << endl;
}
catch(CORBA::SystemException& ex) {
cerr << "Caught a CORBA::" << ex._name() << endl;
}
catch(CORBA::Exception& ex) {
cerr << "Caught CORBA::Exception: " << ex._name() << endl;
}
catch(omniORB::fatalException& fe) {
cerr << "Caught omniORB::fatalException:" << endl;
cerr << " file: " << fe.file() << endl;
cerr << " line: " << fe.line() << endl;
cerr << " mesg: " << fe.errmsg() << endl;
}
return 0;
}


---------------------------------
ÑÅ»¢ÓÊÏ䎫µÝÐÂÄê×£ž££¬žöÐԺؿšËÍÇ×Åó£¡
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080104/07a72c58/attachment-0001.htm
Duncan Grisby
2008-01-10 22:34:00 UTC
Permalink
Careful, you might use up all your exclamation marks, and then not have
any left when you really need one...
Post by l l
i am using omniORB4.1.1 under msvc++6.0 + sp6,i test the
example(echo),client execute hello fuction succefully ,when client
exit ,then server display the exception below,but server does not
Microsoft C++ Exception.
You are mixing Visual C++ debug modes. Make sure you match the compiler
options in Visual C++ with the correct omniORB libraries. Look at the
compiler options used in the example makefiles to see what they should
be.

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...