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 A9DF419A62 for ; Tue, 26 Apr 2016 08:29:52 +0000 (UTC) Received: (qmail 17491 invoked by uid 500); 26 Apr 2016 08:29:52 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 17424 invoked by uid 500); 26 Apr 2016 08:29:52 -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 17412 invoked by uid 99); 26 Apr 2016 08:29:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Apr 2016 08:29:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 706B21804A8 for ; Tue, 26 Apr 2016 08:29:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 5eGpFGm5ghYq for ; Tue, 26 Apr 2016 08:29:49 +0000 (UTC) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id F21F25F489 for ; Tue, 26 Apr 2016 08:29:48 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id u206so23668694wme.1 for ; Tue, 26 Apr 2016 01:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=xCpRYgNbb25D3CyR7YgYQOF4juGfvlQo2CC6ABF7qwA=; b=qHOy6WPkGFhU1RyMFTqhSM5f6p+hq+xQkHAtuwXQrgmpzFSDNsk2NlOlyUexWBpKPS KqIyJ7UIQDaP1kDFjZNdSnYXNLa4LPIamvB2DIGwElBdEU/OKnaP+tf4ENssE2vOD0uS SXnWTzZzZzvfp3xfxRKEQ+8IuJ52fwGBbHZ9lsurpuEoNXRW2V71IjiapvwsE5Oin3H/ ZGCcfe9BATeZdjrXb7KnszGTlNN0G0b5pSr4cPZpmRsB0tAFMiFoUK7KeRVPJidTBQHZ RedBaaN3IpBOnZeewC+le+LjqyCFvcFecXSvzp+4PfWJyw0ZPnyqbnAunCpzvyWZk9eS 6raA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=xCpRYgNbb25D3CyR7YgYQOF4juGfvlQo2CC6ABF7qwA=; b=JOANGZVChV3GMEvc6v/G0EPOQnh0QfulW4nXHzJWlWRhVT3Es/9LLAGOLboJ3JDXQw aFFdenzZIRECuUx5lCG/lGZ7VG5v5//SGvuEh1WsTxu2KDYAj/ohJDauxpU8HtO3Pi5f TjqFyJauldEGnvHbB1qYoj3u/udyUJ9P0q1tn07PzBsdV16bjxijLarWAL64JOrh71DL +8KT6rSR6ivNHyDG2/+hnMmMPhcPmZFQIIwlGuV2netzJvSkdWJvy0uixQh3n76d1zfH RNNU26DUBC8vQArqrbb3t3c4jfmZUDRdqeeWJfZ3AcHf6A0PiQ1QJ+7OeVk8wEcjG2MY w1Ww== X-Gm-Message-State: AOPr4FVmwDM5hKbkJYE7rB82iTpYsum3brqIN5qTLZT5g0eCrq5IesAhEH/axRle2htcHA== X-Received: by 10.194.88.201 with SMTP id bi9mr1497864wjb.147.1461659387874; Tue, 26 Apr 2016 01:29:47 -0700 (PDT) Received: from [192.168.2.7] (31-187-45-19.dynamic.upc.ie. [31.187.45.19]) by smtp.googlemail.com with ESMTPSA id ck9sm27609634wjc.22.2016.04.26.01.29.46 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Apr 2016 01:29:46 -0700 (PDT) Subject: Re: How to use javax.ws.rs.core.Feature with SpringComponentScanServer To: users@cxf.apache.org References: From: Sergey Beryozkin Message-ID: <571F26E9.20606@gmail.com> Date: Tue, 26 Apr 2016 09:29:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for reopening CXF-6879 Cheers, Sergey On 25/04/16 05:58, Nicolas Mongrain-Lacombe wrote: > I am trying to use a JAX-RS Feature (javax.ws.rs.core.Feature, not the CXF > org.apache.cxf.feature.Feature) with SpringComponentScanServer > (org.apache.cxf.jaxrs.spring.SpringComponentScanServer). > > Is there any support for that? > > Here is how I tried to configure CXF: > > import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;import > com.mycustomapp.restexception.providers.RestExceptionFeature;import > org.apache.cxf.jaxrs.spring.SpringComponentScanServer;import > org.springframework.context.annotation.Bean;import > org.springframework.context.annotation.Configuration;import > org.springframework.context.annotation.Import; > @Configuration@Import(SpringComponentScanServer.class)public class > CxfConfiguration{ > @Bean > public RestExceptionFeature restExceptionFeature() > { > return new RestExceptionFeature(); > } > > @Bean > public JacksonJsonProvider jacksonJsonProvider() > { > return new JacksonJsonProvider(); > }} > > Here is my custom feature: > > import javax.ws.rs.core.Feature;import > javax.ws.rs.core.FeatureContext;import javax.ws.rs.ext.Provider; > @Providerpublic class RestExceptionFeature implements Feature{ > @Override > public boolean configure(FeatureContext context) > { > context.register(RestExceptionBodyReader.class); > context.register(RestExceptionMapper.class); > context.register(RestExceptionCxfClientMapper.class); > > return true; > }} > > RestExceptionFeature.configure() is never called. > > I created a stackoverflow question if anyone wants to answer there: > http://stackoverflow.com/questions/36832092/how-to-use-javax-ws-rs-core-feature-with-cxf > -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/