Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 83807 invoked from network); 6 May 2008 16:37:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 May 2008 16:37:19 -0000 Received: (qmail 5301 invoked by uid 500); 6 May 2008 16:37:21 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 5288 invoked by uid 500); 6 May 2008 16:37:21 -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 5277 invoked by uid 99); 6 May 2008 16:37:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2008 09:37:21 -0700 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 May 2008 16:36:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0BFB3234C114 for ; Tue, 6 May 2008 09:36:56 -0700 (PDT) Message-ID: <942238590.1210091816047.JavaMail.jira@brutus> Date: Tue, 6 May 2008 09:36:56 -0700 (PDT) From: "Brad Moody (JIRA)" To: issues@cxf.apache.org Subject: [jira] Created: (CXF-1572) @Path is not mapping to required methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org @Path is not mapping to required methods ---------------------------------------- Key: CXF-1572 URL: https://issues.apache.org/jira/browse/CXF-1572 Project: CXF Issue Type: Bug Components: REST Affects Versions: 2.1 Environment: Win XP, Sun JDK 1.5_011 Reporter: Brad Moody Priority: Minor Fix For: 2.1.1 Hi Hi, I'm getting an issue where my @Path annotations aren't mapping to the required URLs. Here's a rough outline of my test class: @Path(value="/{domain}/{network}/{user}/mail") public class MailService { @GET @ConsumeMime({"application/xml", "application/json"}) @ProduceMime({"application/xml", "application/json"}) public MailFolderDocument listMail(@PathParam("domain")String domain, @PathParam("network")String network, @PathParam("user")String user, @HeaderParam("token")String token){ .... } @Path(value="/{messageId}", limited=true) @GET @ConsumeMime({"application/xml", "application/json"}) @ProduceMime({"application/xml", "application/json"}) public MessageDocument readMessage(@PathParam("user")String user, @PathParam("messageId")String messageId, @HeaderParam("token")String token){ .... } } The problem I'm seeing is that when i invoke the URL http://localhost:8081/cxf/rest/test/domain/network/brad/mail, it invokes the readMessage method instead of listMail. Am I using the correct format for my annotations here? The annontations seem fine. Can you confirm please, as your're debugging, that listMail() is also added to the list of candidates ? I'm actually not sure what exactly JAX_RS says in this regard, the only piece I can see is this one (section 3.6, 2.f) : "Sort E using the number of literal characters in each member as the primary key (descending order), ..., number of capturing groups as the secondary key, and the source of each member ..." In both cases it's a resource method, so the source is the same. Number of captuting groups for listMail is 3 as opposed to 2 for readEmail(), and the number of literal characters is different. It seems like only this bit of the specification which governs the dispatch in this case, but I''ll need to verify it... One possible workaround is to 1. Have another root class created, but with slightly different Path. In the end, I believe it's the CXF bug rather than the ambiguity of the JAX-RS spec...Can you please open a JIRA ? Anyway, just in case I have got it right (*pig flies by*) I stepped through JAXRSUtils.findTargetMethod and I was left wondering if this line is correct: private static final String URITEMPLATE_VARIABLE_REGEX = "(.*?)"; I'm no regex expert but I did find this in the Java 1.5 API docs: X*? X, zero or more times X+? X, one or more times Would that value make more sense as "(.+?)" ? This is required by the spec, every template parameter is substituted by this reg expression. The rationale I believe is that it makes it possible for a given method act as a subresource locator... Cheers, Sergey Thanks, Brad. ---------------------------- IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.