[omniORB] Inserting CORBA::UserExceptions into an Any
Visscher, Bruce
VISSCHB@rjrt.com
Tue Dec 10 22:18:01 2002
Hello list,
>From time to time there have been discussions on this list regarding
the best way to report the actual type of a CORBA::Exception. IIRC,
the consensus was that the best (most portable, etc.) way was to
insert the exception into a CORBA::Any then use the CORBA::Any::id()
member function to report the exact type of exception.
I have seen the error of my ways and have been trying to use this
method. (I used to use omniORB specific methods that tend to change
from version to version or else I would use C++ RTTI which isn't
actually quite right either.)
Unfortunately, I am having problems using this method with user defined
exceptions in omniORB 3.0.4 on OpenVMS.
Specifically, I am trying to insert a CosNaming::NamingContext::NotFound
exception into a CORBA::Any. I see the following message on the display
when I try to do this:
Error: function to insert the user exception into an Any is not available
Tracking this down further I see that CORBA::Exceptions have a pointer to
a function that is supposed to insert the exception into a CORBA::Any.
This member appears to be initialized to 0 in NamingSK.cc but in
NamingDynSK.cc there is a singleton class that has a constructor that
apparently is supposed to override this. A static instance of this class
is declared in this file.
Unfortunately, if you don't do anything to load NamingDynSK.cc into the
executable then this singleton instance won't ever be created. Which
explains why I see the above message.
Am I missing something? Does omniORB 4 fix this?
Bruce
-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be unlawful.