Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 749E610765 for ; Mon, 10 Feb 2014 09:36:57 +0000 (UTC) Received: (qmail 6838 invoked by uid 500); 10 Feb 2014 09:36:55 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 6726 invoked by uid 500); 10 Feb 2014 09:36:55 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 6717 invoked by uid 99); 10 Feb 2014 09:36:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 09:36:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of demablogia@gmail.com designates 209.85.219.48 as permitted sender) Received: from [209.85.219.48] (HELO mail-oa0-f48.google.com) (209.85.219.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 09:36:49 +0000 Received: by mail-oa0-f48.google.com with SMTP id l6so7124814oag.7 for ; Mon, 10 Feb 2014 01:36:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=P3v7p4uwbIYOFXVIERnKmvhNQMYF/HkPuweD5xgSDz4=; b=IFIPXjlyvV5FGlhlKfRIfNDlHJ/7vrB4xVP6K3LUGFPIVikXJ5nf5Z/vjCqblkTAmh pzvlcfTeR73mWCgBOUh/Akb4GJuEX5E3FA0q3Q93qHPQOJBGsZzj/gHwy/rwFefGYzgK QmR5H8YaT4teqcUutZMVfvGukJiXgMB0ztzITT4cMNG+Fj5sNmigNpjP/6Ma19BXVwdk yzhL/VfTpoG9jDELEcSzPI2ZP+wTzfKFz6ETAfmbPcSXWQVRBlEwvfnP1+YsgZ+Sj6Q4 j4XcfnRlZwCXH5/kvLXYCghd+cqOKmoWjtL0XXcTvFs3AfiRyclebTyElmD8tO9Qs2tx 9qGQ== X-Received: by 10.60.246.104 with SMTP id xv8mr26336936oec.18.1392024989370; Mon, 10 Feb 2014 01:36:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.27.199 with HTTP; Mon, 10 Feb 2014 01:36:09 -0800 (PST) From: =?ISO-8859-1?Q?Jose_Mar=EDa_Zaragoza?= Date: Mon, 10 Feb 2014 10:36:09 +0100 Message-ID: Subject: Format message returned by REST service after schema-validation To: users@cxf.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hello: I'm using Apache CXF 2.7.3 and JAX-RS to deploy a REST webservice. The format of messages is only JSON I've enabled schema-validation and response looks like Response-Code: 400 Content-Type: text/plain Headers: {Content-Type=[text/plain], Date=[Mon, 10 Feb 2014 09:25:19 GMT]} Payload: JAXBException occurred : cvc-pattern-valid: Value 'xxxxxxxx' is not facet-valid ... I would like to capture this exception and format the payload I tried this CustomOutInterceptor http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java but it doesn't work for me: message content never is an exception My CustomOutInterceptor is invoked but it doesn't receive an exception despite of an exception is thrown in server side. 10:25:19.823 [http-8080-3] WARN [AbstractJAXBProvider] [handleExceptionStart] - javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException: cvc-pattern-valid: Value 'xxxxx' is not facet-valid any ideas ? any example ? Regards