Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 49553 invoked from network); 2 May 2007 16:05:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 May 2007 16:05:45 -0000 Received: (qmail 28643 invoked by uid 500); 2 May 2007 16:05:45 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 28562 invoked by uid 500); 2 May 2007 16:05:45 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 28485 invoked by uid 99); 2 May 2007 16:05:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2007 09:05:45 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 May 2007 09:05:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 579F471407E for ; Wed, 2 May 2007 09:05:16 -0700 (PDT) Message-ID: <8852093.1178121916356.JavaMail.jira@brutus> Date: Wed, 2 May 2007 09:05:16 -0700 (PDT) From: "Deepal Jayasinghe (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Assigned: (AXIS2-2592) AxisServlet does not respect Servlet Context paths with slashes In-Reply-To: <27098780.1177530915282.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2-2592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Deepal Jayasinghe reassigned AXIS2-2592: ---------------------------------------- Assignee: Deepal Jayasinghe > AxisServlet does not respect Servlet Context paths with slashes > --------------------------------------------------------------- > > Key: AXIS2-2592 > URL: https://issues.apache.org/jira/browse/AXIS2-2592 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Components: kernel > Affects Versions: nightly > Environment: Tomcat 6 or Glassfish 9 on Windows XP. > Reporter: Steven E. Harris > Assigned To: Deepal Jayasinghe > > AxisServlet.initContextRoot() inspects the Servlet parameter "axis2.find.context" to figure out whether it should use the "contextRoot" parameter specified in axis2.xml, or attempt to discover the Servlet's context path from the current request, per this discussion: > "svn commit: r468722 ..." > http://mail-archives.apache.org/mod_mbox/ws-axis-cvs/200610.mbox/%3c20061028184831.2FB6B1A9846@eris.apache.org%3e > The problem lies with the following portion of initContextRoot(): > if (contextRoot == null || contextRoot.trim().length() == 0) { > String[] parts = JavaUtils.split(req.getContextPath(), '/'); > if (parts != null) { > for (int i = 0; i < parts.length; i++) { > if (parts[i].length() > 0) { > contextRoot = parts[i]; > break; > } > } > } > if (contextRoot == null || req.getContextPath().equals("/")) { > contextRoot = "/"; > } > configContext.setContextRoot(contextRoot); > } > For some reason, this code takes the current request's reported context path and splits it on slashes, taking only the first token as the context path. This fails with Servlets deployed with context paths containing slashes. > As an example, my Servlet is deployed with a context path of "2007/04" and an Axis2 "servicePath" of "ws". That is, services should be found via > http:///2007/04/ws/ > I specified "2007/04" in axis2.xml as my "contextRoot", but Axis2 winds up ignoring this parameter anyway if the "axis2.find.context" Servlet parameter is not set to "false". Upon the first real request arriving, AxisServlet.initContextRoot() runs. It decides to try to honor the Servlet's context path, and retrieves it via HttpServletRequest.getContextPath(). This function returns "/2007/04". But the "split" operation chops this up and selects "2007" as the the context root, then proceeds to set this as the configurationContext's contextRoot. > This causes the configurationContext's serviceContextPath value to get rewritten as "2007/ws", which fails to locate a service. > The fix is to not try splitting up the HttpServletRequest's context path. Perhaps you want to remove the leading slash, but there's no reason that we should be only honoring the name components before the first slash beyond the leading one. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org