XML-RPC

XMLRPC is too agressive about logging exceptions

Created: 25/Feb/08 02:16 PM   Updated: 28/Nov/08 08:53 PM
Return to search
Component/s: None
Affects Version/s: 3.1.1
Fix Version/s: 3.1.1

Time Tracking:
Not Specified

Resolution Date: 05/Aug/08 02:30 PM


 Description  « Hide
XmlRpcStreamServer.java contains the following code in execute():

                        try {
                                istream = getInputStream(pConfig, pConnection);
                                XmlRpcRequest request = getRequest(pConfig, istream);
                                result = execute(request);
                                istream.close();
                                istream = null;
                                error = null;
                                log.debug("execute: Request performed successfully");
                        } catch (Throwable t) {
                                log.error("execute: Error while performing request", t);
                                result = null;
                                error = t;
                        } finally {
                                if (istream != null) { try { istream.close(); } catch (Throwable ignore) {} }
                        }


On initial inspection this looks reasonable, the problem is that if the server calls a handler which throws an application-level exception which will result in the XMLRPC <fault> response being returned to the client, it ends up triggering the log.error() action. This causes lots of spurious error messages in logs - at an application level it may be necessary to throw exceptions to trigger a <fault> response to the client, this doesn't mean there is any sort of fault that XMLRPC should concern itself with.

There should be different mechanisms for handling application-level exceptions, which XMLRPC should propagate as <fault> responses and not otherwise concern itself with, and true XMLRPC exceptions (e.g. no response from remote end) which it should deal with. At present there is no distinction between these two types of error.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #682723 Tue Aug 05 14:28:44 UTC 2008 jochen PR: XMLRPC-156
Added the XmlRpcErrorLogger, which allows to customize the error logging.
Files Changed
ADD /webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcErrorLogger.java
MODIFY /webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java
MODIFY /webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/XmlRpcServlet.java
MODIFY /webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcStreamServer.java

Jochen Wiedmann added a comment - 05/Aug/08 02:30 PM
Fixed by adding the XmlRpcErrorLogger. Create a subclass and set it on the XmlRpcStreamServer.

Jochen Wiedmann made changes - 05/Aug/08 02:30 PM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s 3.1.1 [ 12312839 ]
Assignee Jochen Wiedmann [ jochen@apache.org ]
Status Open [ 1 ] Resolved [ 5 ]
Jochen Wiedmann added a comment - 28/Nov/08 08:53 PM
Closing issues which have been released.

Jochen Wiedmann made changes - 28/Nov/08 08:53 PM
Status Resolved [ 5 ] Closed [ 6 ]