473,385 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Correct Way of Handling Exception

Ami
We have an application where in SOAP is used as a middle layer to
communication between Java Front layer and DCE( Distributed Computing
Env) backend layer.
We are using Systinet Server for C++ to deploy our SOAP code and we
make DCE RPC call through our SOAP code in C++ to connect and SEND and
Retrieve Data from DCE.

Now we have to incorporate exception handling in such a way , if DCE
is down, then while making a DCERPC call SOAP Server should not dump
core.
IN our SIT testing , our SOAP Server is dumping while making a DCERPC
call.
Example for PRSJCalcDefAmt ( SOAP Mehtod ) which is making a DCE
call , from SOAP logs

Entering casclifService::PRSJCalcDefAmt method ...
16607 22/10/2007 6:27:0>>DCE Server is Running Fine for /.:/users/
trimsprd/dceOnlyERSMonEventServer
16608 22/10/2007 6:27:0>Before the ESLogEvent Call ...
16609 22/10/2007 6:27:0>After the ESLogEvent Call ...
16610 22/10/2007 6:27:0>>SECURE KEY Validation Successful
16611 22/10/2007 6:27:0>>Boff code from DCE.cpp = 0x40ff4dd3
16612 22/10/2007 6:27:0>>DCE Server is Running Fine for /.:/users/
trimsprd/dceOnlyFECSSrvr
16613 22/10/2007 6:27:0>>Before Calling the DCE Method
PRSJCalcDefAmt ...
16614 Unhandled exception; exiting!
16615 Exception kind is status,value is 382312502. Thread 9 .
16616 ^[[H^[[2JTRIMSSecret.ini File is successfully opened

382312502 corresponds to rpc_s_connection_closed error.

We do not have yet any mechnism to catch such exception .

The SOAP code which causes the core dump is as below
long tResult = PR_SJCalcDefAmt( hndlr,
(long)p_nbr_PartSyndCda,
p_str_part_synd_cda,
p_str_lc_details,
(long)p_nbr_Guarantors,
p_str_guarantors,
&p_str_guarantors_listOut,
&p_str_ErrorMsg,
(unsigned char *)p_txt_ApplErrorMsg,
(unsigned char *)user_id,
&p_cod_Error);

we tried the following
try
{
tResult = PR_SJCalcDefAmt(hndlr,
(long)p_nbr_PartSyndCda,
p_str_part_synd_cda,
p_str_lc_details,
(long)p_nbr_Guarantors,
p_str_guarantors,
&p_str_guarantors_listOut,
&p_str_ErrorMsg,
(unsigned char *)p_txt_ApplErrorMsg,
(unsigned char *)user_id,
&p_cod_Error);
}
catch(...)
{
PRINT("Un Handled Exception Occured");
TrimsCustomException * exc = new TrimsCustomException();
exc->msgId="SSCDCEEXP003";
exc->msgText="Unhandled Exception";
arm_stop(cas_start_handle,ARM_ABORT, 0, 0, 0);
free(p_str_part_synd_cda);
free(p_str_lc_details);
free(p_str_guarantors);
free(p_str_guarantors_listOut);
free(user_id);
throw exc;
}

The exception call is defined as below
// Exception Class Definition

public class TRIMSSOAPException extends javax.xml.soap.SOAPException
{
public String msgID;
public String msgText;

public TRIMSSOAPException ()
{
super("SOAP CUSTOM EXCEPTION");
}

public TRIMSSOAPException (String ID, String Text)
{
msgID=ID;
msgText=Text;
super("SOAP CUSTOM EXCEPTION");
}

public String getMsgID()
{
return msgID;
}
public String getMsgText()
{
return msgText;
}
}
the SOAP server will raise TRIMSSOAPException and populate msgID and
msgText appropriately which will be caught by Java client and further
action would be decided based on the msgID values and msgText may be
used to display error message to application user.

Still SOAP core is dumping in spite of adding above exception.
Please let me know other way of handling exception
Thanks
Dec 12 '07 #1
1 1999
On Dec 12, 2:27 am, Ami <Amit.Bas...@gmail.comwrote:
We have an application where in SOAP is used as a middle layer to
communication between Java Front layer and DCE( Distributed Computing
Env) backend layer.
This newsgroup discusses the C++ language itself. Please see
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
for newsgroup suggestions.

--
Jonathan Mcdougall
Dec 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
7
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
3
by: Master of C++ | last post by:
Hi, I am an absolute newbie to Exception Handling, and I am trying to retrofit exception handling to a LOT of C++ code that I've written earlier. I am just looking for a bare-bones, low-tech...
9
by: C# Learner | last post by:
Some time ago, I remember reading a discussion about the strengths and weaknesses of exception handling. One of the weaknesses that was put forward was that exception handling is inefficient (in...
4
by: Ele | last post by:
When Exception handling disabled compiler still spits out "C++ exception handler used." Why is that? Why does it ask for "Specify /EHsc"? Thanks! c:\Program Files\Microsoft Visual Studio...
9
by: Gustaf | last post by:
I'm confused about structured error handling. The following piece of code is a simplification of a class library I'm working on. It works, and it does what I want, but I'm still not convinced that...
7
by: yogeshnelwadkar | last post by:
Hello, i have a problem with replacing c++ exception handling with structured exception handling. How to replace the " catch(...) " in c++ exception handling with, __except , a structured...
6
by: VMI | last post by:
What's the correct way of using try...catch in my web application? For example, if I catch a connection error or something with the DB, how am I supposed to bubble it up to the web interface? Is...
2
by: Rob Meade | last post by:
Hi there, I have my own "way" I guess of coding, like we all do, whilst I try to maintain consistency throughout my own applications I often wonder whether there are better ways of doing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.