<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">Hello
OmniORB experts,</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2">First
of all thanks for your wonderful <span style="font-weight: bold;">OmniORB product </span>and supports that
you are providing.</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">Let me ask you one question regarding UserException, as a part of our
upcoming project we are evaluating omniORB and we are struggling to
evaluate the UserException scenario.</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">please
see the below details and suggest me your solution ,</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">1)
In IDL we have provided the User exceptions with in the <b>raises</b>
function as like below,</font></font></p>
<p style="margin-bottom: 0in">
</p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2"><b>void
terminate() raises ( ExecutableDevice::InvalidProcess )</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">with
<b>InvalidProcess</b> having members of,</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>short
ErrorNumber;</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>string
ErrorMsg;</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">2)At
the <b>server side</b> we have implemented <b>ExecutableDeviceImpl
and InvalidProcessImpl </b><span style="font-weight: normal">objects</span></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">and
with in the <b>ExecutableDeviceImpl </b><span style="font-weight: normal">object
we have created the </span>function terminate () and throwing the
UserException as like below ,</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>void
terminate() throw ( ExecutableDevice::InvalidProcess )</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>{</b></font></font></p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2"><b>throw
( InvalidProcessImpl( 2, "Error in Terminating the process "));</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>}</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><i><b>Note
:- this InvalidProcessImpl is inherited from InvalidProcess and
std::runtime_error exception.</b></i></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">3)
At the<b> client side </b> when we are calling the terminate process
then getting the UserException correctly ,but we are not able to see
the error message that raised at server side ie, <b>ErrorNumber</b>
and <b>ErrorMsg</b>. Please see the code I have written client side.</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>//after
ORB initialization and NameResolving of ExecutableDevice we are
calling the terminate function,</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>try</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>{</b></font></font></p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2"><b>ExecutableDevice_mgr->terminate();</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>}</b></font></font></p>
<p style="margin-bottom: 0in">
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>catch(
CORBA::UserException& ex)</b></font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>{</b></font></font></p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2"><b>cerr<<"\n
CORBA user Exception ";</b></font></font></p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2"><b>cerr<<ex._rep_id();</b></font></font></p>
<p style="margin-bottom: 0in"> <font face="Arial, sans-serif"><font size="2"><b>cerr<<ex._name();</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font color="#ff0000"><font face="Arial, sans-serif"><font size="2"><b>//CF::ExecutableDevice::InvalidProcess*
//inval=CF::ExecutableDevice::InvalidProcess::_downcast(&ex);</b></font></font></font></p>
<p style="margin-bottom: 0in"><font color="#ff0000"><font face="Arial, sans-serif"><font size="2"><b>//cerr<<"\n
THE DATA="<<inval->ErrorMsg;</b></font></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font color="#ff0000"><font face="Arial, sans-serif"><font size="2"><b>//CF::ExecutableDevice::InvalidProcess
//exeDev=CF::ExecutableDevice::InvalidProcess::_narrow(ex);</b></font></font></font></p>
<p style="margin-bottom: 0in"><font color="#ff0000">
<font face="Arial, sans-serif"><font size="2"><b>//cerr<<exeDev.ErrorMsg;</b></font></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>}</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">i
am getting the output at client side like below,which is correct but
not able to print the ErrorMsg and ErrorNumber of InvalidProcess .</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>Output
at client :- CORBA UserException:-
IDL:CF/ExecutableDevice/InvalidProcess:1.0InvalidProcess</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">i
have tried with down cast and narrow methods to print the
InvalidProcess Exception details, which you can see in my code above
but was not successful,</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2"><b>do
u find any mistake in my approach ?? or do i have to do any
additional methods to get the UserException data at client side.?</b></font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">awaiting
for your valuable information,</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">thanks</font></font></p>
<p style="margin-bottom: 0in"><font face="Arial, sans-serif"><font size="2">Ratheesh</font></font></p>
<p style="margin-bottom: 0in"><br>
</p>
</td></tr></table>