[omniORB] Why don't I receive the exception, I have a try-catch block

ERIKSSON,TOBIAS (A-Sweden,ex1) tobias_eriksson@agilent.com
Tue, 27 Feb 2001 09:40:47 +0100


Hi
 For some reason I receive a OBJECT_NOT_EXISTS when I try to call run() on
the orb-object.
The rather strange behaviour is that the try-catch block I have surrounding
the run()-call, does not catch the exception, see the stack trace below
(source as well).
Two questions:
1) Why don't I receive the exception?
2) Why does this exception show up?
3) (bonus question) Is there a way to check if it is a valid object?

Regards
 Tobias



Program received signal SIGABRT, Aborted.
0x401a2931 in kill () from /lib/libc.so.6
(gdb) bt
#0  0x401a2931 in kill () from /lib/libc.so.6
#1  0x4001fee9 in pthread_kill () from /lib/libpthread.so.0
#2  0x40020365 in raise () from /lib/libpthread.so.0
#3  0x401a3c71 in abort () from /lib/libc.so.6
#4  0x40145fd8 in __terminate () from /usr/lib/libstdc++-libc6.1-2.so.3
#5  0x40145ff5 in __terminate () from /usr/lib/libstdc++-libc6.1-2.so.3
#6  0x40146b74 in __throw () from /usr/lib/libstdc++-libc6.1-2.so.3
#7  0x400c1953 in omniExHelper::OBJECT_NOT_EXIST ()
   from
/home/tobias/CORBA/omni/lib/i586_linux_2.0_glibc2.1/libomniORB3.so.0
#8  0x400a7575 in omniOrbORB::run ()
   from
/home/tobias/CORBA/omni/lib/i586_linux_2.0_glibc2.1/libomniORB3.so.0
#9  0x806d13c in ORBThread::run (this=0x81f4378, args=0x0) at
ORBThread.cpp:35
#10 0x4011e94f in omni_thread_wrapper ()
   from
/home/tobias/CORBA/omni/lib/i586_linux_2.0_glibc2.1/libomnithread.so.2
#11 0x4001dc8f in pthread_start_thread () from /lib/libpthread.so.0



void ORBThread::run( void* args )
{
  const char *funcname="ORBThread::run";
  IAmRunning=true;
  IveEnded=false;
  try
  {
    myOrb->run();
  }
  catch( CORBA::OBJECT_NOT_EXIST &ex )
  {
    mySettingsObj->log(APP_LOGERROR, funcname, "Caught a
CORBA::OBJECT_NOT_EXIS exception, could not start the ORB.");
  }
  catch(CORBA::SystemException&) {
    mySettingsObj->log(APP_LOGERROR, funcname, "Caught a
CORBA::SystemException exception, could not start the ORB.");
  }
  catch(CORBA::Exception&) {
    mySettingsObj->log(APP_LOGERROR, funcname, "Caught a CORBA::Exception
exception, could not start the ORB.");
  }
  catch(omniORB::fatalException& fe) {
    mySettingsObj->log(APP_LOGERROR, funcname, "Caught a
omniORB::fatalException exception, could not start the ORB, (omniORB
internal exception file;%s, line;%d, error message;%s)",fe.file(),
fe.line(),fe.errmsg() );
  }
  catch(...)
  {
    mySettingsObj->log(APP_LOGERROR, funcname, "Caught an unknown
exception, could not start the ORB.");
  }
  
  // try
  //   {
  //     while( IAmRunning )
  //     {
  //       // std::cerr << "Tick..." << std::endl;
  //       if( myOrb->work_pending() )
  // 	myOrb->perform_work();
  //        sleep(1);
  //     }
  //   }
  //   catch(...)
  //   {
  //     mySettingsObj->log(APP_LOGERROR,funcname,"Received an exception
in the ORB thread, will exit ORB-thread, note that no CORBA requests will
be handled. This can cause the system to hang. Preferably restart the
server." );
  //   }
  IveEnded = true;
}