[omniORB] PortableServer::ObjectId_to_string crashes the client.
Duncan Grisby
dgrisby@uk.research.att.com
Mon, 23 Jul 2001 10:32:10 +0100
On Friday 20 July, Alfonso =?iso-8859-1?q?Tam=E9s?= wrote:
> CORBA::String_var oid_str = PortableServer::ObjectId_to_string(oid);
>
> inside a preinvoke method of the servant_locator class of the poa example it
> crashes the client with error:
>
> Caught a CORBA::SystemException
Most likely, you are using a POA with the system id policy, meaning
that the object ids often contain embedded nulls. Section 1.39 of the
C++ mapping says
"If conversion of an ObjectId to a string would result in illegal
characters in the string (such as NUL), ObjectId_to_string throws
the CORBA::BAD_PARAM exception."
You should only use ObjectId_to_string with user id POAs, and make
sure you use ObjectIds without embedded nulls.
Since you don't catch BAD_PARAM within your preinvoke()
implementation, the exception is propagated to the client.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --