RPCMessageReceiver logs business logic exceptions (=AxisFaults) using ERROR 
level
---------------------------------------------------------------------------------

                 Key: AXIS2-2808
                 URL: https://issues.apache.org/jira/browse/AXIS2-2808
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.2
         Environment: axis2 using ADB
            Reporter: Wolfgang Moestl
            Priority: Minor


If a WebService is about to throw a business logic based Exception it should 
throw an AxisFault (according to the Axis2 docs)

This AxisFault is cachted by the class 
org.apache.axis2.rpc.receivers.RPCMessageReceiver, method invokeBusinessLogic, 
as an InvocationTargetException, having the AxisFault set as cause:

catch (InvocationTargetException e) {
            String msg = null;
            Throwable cause = e.getCause();
            if (cause != null) {
                msg = cause.getMessage();
            }
            if (msg == null) {
                msg = "Exception occurred while trying to invoke service method 
" +
                        method.getName();
            }
            log.error(msg, e);
            if (cause instanceof AxisFault) {
                throw (AxisFault)cause;
            }
            throw new AxisFault(msg);
        }

The line "log.error(msg, e);" is ABOVE the line checking if the cause is an 
AxisFault or not, thus logging the business logic exception using the ERROR 
level.

Please put the logging line BELOW the line checking for the AxisFault. If it's 
not an AxisFault I'm with you, there should be an ERROR entry in the log.
Maybe a DEBUG logging entry WITHIN the 'if' would be suitefull for AxisFaults.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to