uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

8.4.7 Acquiring Error Information

If an error occurs at the request-destination service component, the HCSC server, or the EJB container, acquire the error information and take corrective action according to the information.

You can acquire error information by acquiring the CSCMsgServerException class on the service requester side. For details about the CSCMsgServerException class, see 8.4.7(2) CSCMsgServerException class. For details on how errors are informed, see the contents related to the troubleshooting when SessionBean is executed in the manual Cosminexus Service Platform System Setup and Operation Guide.

To acquire error details, you use the getErrorMessage and getErrorCode methods. To acquire error information (SOAPFault) from Web Services, you use the checkSoapFault method.

Organization of this subsection
(1) Service requester-side installation example
(2) CSCMsgServerException class

(1) Service requester-side installation example

A service requester-side installation example for acquiring the CSCMsgServerException class is shown below.

 
          ...
} catch (CSCMsgServerException e) {
    System.err.println("Exception ErrorMessage = "
                + e.getErrorMessage() );
    System.err.println("Exception ErrorCode = "
                + e.getErrorCode() );
    if (e.checkFaultMessage() == true) {
        System.err.println("Exception ProcessInstanceID = "
                + e.getProcessInstanceID() );
        System.err.println("Exception FaultCode = "
                + e.getFaultCode() );
        System.err.println("Exception FaultString = "
                + e.getFaultString() );
        System.err.println("Exception FaultActor = "
                + e.getFaultActor() );
        System.err.println("Exception FaultDetails = "
                + new String(e.getFaultDetail(), "UTF-8"));
    System.err.println("Exception FaultName = "
                + e.getFaultName() );
    }
}
          ...
 

(2) CSCMsgServerException class

This is an exception class acquired by the service requester.

(a) Class definition

Package
jp.co.Hitachi.soft.csc.msg.message.reception

Class
public class CSCMsgServerException
extends java.lang.Exception
(b) Field list
Field name Data type Explanation
errorMessage java.lang.String Contents of the following exceptions:
  • Exceptions detected inside HCSC-Messaging
  • Fault from a service component or business process
errorCode java.lang.String Error code corresponding to the following exceptions:
  • Exceptions detected inside HCSC-Messaging
  • Fault from a service component or business process
processInstanceID java.lang.String Instance ID information of a business process
A value is set when an error occurs in the business process.
cscmsgFaultCode java.lang.String FaultCode information from a service component (Web Services), business process, or custom adapter
cscmsgFaultString java.lang.String FaultString information from a service component (Web Services), business process, or custom adapter
cscmsgFaultActor java.lang.String FaultActor information from a service component (Web Services), business process, or custom adapter
cscmsgFaultDetail byte[] Detail information from a service component (Web Services), business process, or custom adapter
faultName java.lang.String Fault name (exception name) information from a service (Web Services or SessionBean) or business process
A value is set in the following cases:
  • In the case of SOAP Fault of a user-defined exception from a service component (Web services or SessionBean)
  • In the case of a fault from business process
No value is set in the case of the SOAP Fault error from Web services that define URI of targetNamespace in the SOAP Fault operation definition file. For details about the SOAP Fault operation definition file, see the manual Cosminexus Service Platform Reference.
(c) Method list
Method name Data type Explanation
getErrorMessage java.lang.String Acquires error messages.
getErrorCode java.lang.String Acquires error codes.
checkFaultMessage Boolean Determines whether there is fault information from a service component, business process, or custom adapter.
getFaultCode java.lang.String Acquires FaultCode information.
getFaultString java.lang.String Acquires FaultString information.
getFaultActor java.lang.String Acquires FaultActor information.
getFaultDetail byte[] Acquires Detail information.
getProcessInstanceID java.lang.String Acquires the instance ID of a business process.
getFaultName java.lang.String Acquires a fault name (exception name).
(d) Method detail

[Figure]getErrorMessage
Explanation
Acquires error messages.
Use this method for acquiring the contents of the following exceptions:
  • Exceptions detected inside HCSC-Messaging
  • Fault from a service component or business process
Format
public java.lang.String getErrorMessage()
Parameter
None
Return value
Error message
Exception
None

[Figure]getErrorCode
Explanation
Acquires error codes.
Use this method for acquiring the error codes corresponding to the following exceptions:
  • Exceptions detected inside HCSC-Messaging
  • Fault from a service component or business process
Format
public java.lang.String getErrorCode()
Parameter
None
Return value
Error code
Exception
None

[Figure]checkFaultMessage
Explanation
Determines whether there is fault information from a service component, business process, or custom adapter.
If the service component or business process is Web Services, determines whether the contents of the error returned as SOAPFault is included.
Also determines whether an individual error from a custom adapter is included.
Format
public boolean checkFaultMessage()
Parameter
None
Return value
true: Fault message information exists.
false: Fault message information does not exist.
Exception
None

[Figure]getFaultCode
Explanation
Acquires FaultCode information from a service component (Web services), business process, or custom adapter.
Format
public java.lang.String getFaultCode()
Parameter
None
Return value
faultcode
Exception
None

[Figure]getFaultString
Explanation
Acquires FaultString information from a service component (Web Services), business process, or custom adapter.
Format
public java.lang.String getFaultString()
Parameter
None
Return value
faultstring
Exception
None

[Figure]getFaultActor
Explanation
Acquires FaultActor information from a service component (Web Services), business process, or custom adapter.
Format
public java.lang.String getFaultActor()
Parameter
None
Return value
faultactor
Exception
None

[Figure]getFaultDetail
Explanation
Acquires Detail information from a service component (Web Services), business process, or custom adapter.
Transfers the Detail information set up by the service component to the service requester in a byte array. Therefore, the acquired byte array must be converted to a character string.
Format
public byte[] getFaultDetail()
Parameter
None
Return value
detail
Exception
None

[Figure]getProcessInstanceID
Explanation
Acquires the instance ID of a business process.
Format
public String getProcessInstanceID()
Parameter
None
Return value
String
Exception
None

[Figure]getFaultName
Explanation
Acquires a fault name (exception name).
Format
public String getFaultName()
Parameter
None
Return value
String
Exception
None
(e) Subclass list
Class name Subclass name and explanation
CSCMsgServerException

CSCMsgServiceException
Service component exception

CSCMsgServiceUserException
Fault information or Exception from a service component

CSCMsgBusinessProcessUserException
Fault information or Exception from a business process

CSCMsgServiceExecuteException
Exception when an exception that is not a user-defined exception is returned from a service component (Web Services)

CSCMsgServiceDeliveryException
Service component request delivery error

CSCMsgLocationSearchException
Location search failure

CSCMsgRoutingExecException
Routing failure

CSCMsgDelivererExecException
Message delivery failure

CSCMsgDBQServiceDeliveryException
Exception when a standard reception of an asynchronous database queue invokes a database queue service component

CSCMsgServerParameterException
Input parameter error
--

CSCMsgServerInternalException
Error other than those described above
--

Legend:
--: No subclass is available.