Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B30910843 for ; Thu, 24 Oct 2013 16:04:05 +0000 (UTC) Received: (qmail 19076 invoked by uid 500); 24 Oct 2013 16:04:04 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 18955 invoked by uid 500); 24 Oct 2013 16:04:02 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 18942 invoked by uid 99); 24 Oct 2013 16:04:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 16:04:01 +0000 Date: Thu, 24 Oct 2013 16:04:01 +0000 (UTC) From: "Ivan Bondarenko (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-5360) Resource classes are selected incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13804345#comment-13804345 ] Ivan Bondarenko commented on CXF-5360: -------------------------------------- This bug is related to solved #CXF-2439 However I think default behavior must be more robust > Resource classes are selected incorrectly > ----------------------------------------- > > Key: CXF-5360 > URL: https://issues.apache.org/jira/browse/CXF-5360 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.7.7 > Reporter: Ivan Bondarenko > Priority: Blocker > > The problem: the resource is selected incorrectly when multiple classes can 'visually' handle request. For example if we have two classes > @Path("/") class Foo { > @GET @Path("bar") public String bar() { return "bar"; } > } > @Path("/") class Real { > @GET @Path("hello") public String hello() { return "hello"; } > } > and their instances are registered in this order (e.g. in jaxrs:serviceBeans), when I GET the "/hello" path, the Foo will be selected, while it is not even able to handle this request. > The starting point to investigate the problem is org.apache.cxf.jaxrs.utils.JAXRSUtils.selectResourceClass(List, String, MultivaluedMap, Message), where 'candidateList' variable is filled incorrectly. Unfortunately I'm not so familiar with CXF code to provide a patch, but resource class must be selected basing on full class description (all methods and annotations must be taken into account). > Why this is a problem: except obvious reason (unexpected behavior), this bug disallows to make REST service modular. For example we may want to provide different feature sets for different servers. Right now it is not possible to implement. -- This message was sent by Atlassian JIRA (v6.1#6144)