axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dino (JIRA)" <>
Subject [jira] Commented: (AXIS2-4280) Handle error handling of AxisFault better
Date Tue, 22 Sep 2009 19:16:16 GMT


Dino commented on AXIS2-4280:

I would just remove the log.error(e.getMessage()). I don't think you need a real patch for

It is not good coding practice to log an error and propagate the exception since it can be
treated by the client code in a specific manner.

This is especially true of faults since it is part of the contract of the web service call.

> Handle error handling of AxisFault better
> -----------------------------------------
>                 Key: AXIS2-4280
>                 URL:
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Improvement
>          Components: kernel
>    Affects Versions: 1.4.1
>         Environment: NA
>            Reporter: Dino
>            Priority: Critical
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> Every time I throw an application fault the error gets displayed in server side as an
> To reproduce: run the faulthandling example from the distribution (xis2-1.4.1/samples/faulthandling)
> In the server side you get:
> ERROR] Account does not exist!
> org.apache.axis2.AxisFault: Account does not exist!
>     at example.BankServiceMessageReceiverInOut.createAxisFault(
>     at example.BankServiceMessageReceiverInOut.invokeBusinessLogic(
>     at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(
>     at org.apache.axis2.receivers.AbstractMessageReceiver.receive(
>     at org.apache.axis2.engine.AxisEngine.receive(
>     at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
>     at org.apache.axis2.transport.http.HTTPWorker.service(
>     at org.apache.axis2.transport.http.server.AxisHttpService.doService(
>     at org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(
>     at
>     at
>     at$
>     at
> I tracked the source of the error and it is in class AxisEngine line 212 where it blindly
logs all faults as errors:
> catch (AxisFault e) {
>             log.error(e.getMessage(), e);  // <<<<<
>             msgContext.setFailureReason(e);
>             flowComplete(msgContext);
>             throw e;
>         }
> Now, the only way to deal with it now is to switch off logging which is never a good
idea. This is a serious bad issue if you want to use faults. 

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

View raw message