Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-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 7914CDCA3 for ; Sun, 26 Aug 2012 23:01:01 +0000 (UTC) Received: (qmail 20085 invoked by uid 500); 26 Aug 2012 23:00:57 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 19874 invoked by uid 500); 26 Aug 2012 23:00:57 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 19863 invoked by uid 99); 26 Aug 2012 23:00:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Aug 2012 23:00:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Aug 2012 23:00:52 +0000 Received: by vbip1 with SMTP id p1so4684798vbi.18 for ; Sun, 26 Aug 2012 16:00:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=zumhn7SlcxyikQ6W8cHhOAS8ssk065p68SciIh1NCrA=; b=gm0dRIxITDv8BeqXnCOTiCi/Nyu2mA6GsFpeO4RFUpdOGUsVDi2JAteZ2ylFG/H4Yr WcHc8vSV+TomjbE/b5zDLqRMSYfIYmfcCGIukZftBpEdTnfxk96vr5/EdmKJCCE4rFPV tQam+VANJzS540JmOMivpGjIcmHcYOvi/4DpdYmCACtPPP0NVMrtG91A+wNT5JsqUgnv LNmhvcIsMMBL4eGNVWxTi6YCRxtRzMEfsWDPhHxWdCk3RzGPnWkmbtRjejoUvQzcDncQ ZjiiQm1Z89JUONoTX3UqbdAXEhRbI9jTWtFLGaeMtn+hNvGA4sLTKHPQK93QZ4rWlw1u rOnQ== MIME-Version: 1.0 Received: by 10.220.150.15 with SMTP id w15mr10019440vcv.68.1346022030803; Sun, 26 Aug 2012 16:00:30 -0700 (PDT) Received: by 10.220.8.198 with HTTP; Sun, 26 Aug 2012 16:00:29 -0700 (PDT) In-Reply-To: References: Date: Mon, 27 Aug 2012 01:00:29 +0200 Message-ID: Subject: Re: problem with filters on Tomcat 7.0.16 and above From: Ivan Polak To: Tomcat Users List Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkmoBnH6b5bK67am703P5jRZZprSY8TvKIIOuyjlCSL+zC2eTcUqPXCElTKLYj+mUKOYO9N X-Virus-Checked: Checked by ClamAV on apache.org On 26 August 2012 23:05, Konstantin Kolinko wrote: > 2012/8/27 Ivan Polak : >> I have found, where is the problem. >> >> problem is in StandardContextValve.java in >> >> @Override >> public final void invoke(Request request, Response response) >> throws IOException, ServletException { >> >> .... >> >> // Select the Wrapper to be used for this Request >> Wrapper wrapper = request.getWrapper(); >> if (wrapper == null || wrapper.isUnavailable()) { >> response.sendError(HttpServletResponse.SC_NOT_FOUND); >> return; >> } >> ..... >> >> if request is : http://localhost:8080/app/index.html (direct link to >> Spring MVC controller), object wrapper is not null, >> >> and if request is : http://localhost:8080/app/invitations/ (served by >> UrlRewrite filter), object wrapper is NULL! >> >> in CoyoteAdapter.java on line 649: >> >> request.setWrapper((Wrapper) request.getMappingData().wrapper); >> >> is set NULL. >> > > Can you stop top-posting? > http://en.wikipedia.org/wiki/Posting_style#Choosing_the_proper_posting_style > > What is your list of welcome files? > > How a wrapper can be null? > 1) For a directory path like yours, > the welcome files come into play and the servlet that serves them is > selected as the wrapper. > 2) There is always DefaultServlet (servlet mapped to "/") that is > selected when nothing else matches the request. > > When your breakpoint is on "if (wrapper == null || > wrapper.isUnavailable()) {" line, > what is the value of the local variable "requestPathMB" ? > > >> request.setWrapper((Wrapper) request.getMappingData().wrapper); > > Mapping is performed in > org.apache.tomcat.util.http.mapper.Mapper#map(..) (there are two > public map() methods) > > Best regards, > Konstantin Kolinko > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > Hi, 1. local variable requestPathMB = null (in Tomcat 7.0.14 requestPathMB = "/invitations") 2. index.jsp 3. As I wrote on the last mail, the problem is in StandardContextValve.java in method: public final void invoke(Request request, Response response) throws IOException, ServletException { ... Wrapper wrapper = request.getWrapper(); ... in Mapper class on line 988 // Rule 7 -- Default servlet if (mappingData.wrapper == null && !checkJspWelcomeFiles) { if (contextVersion.defaultWrapper != null) { contextVersion.defaultWrapper is NULL. in Tomcat 7.0.14 (where everything is OK) is not null. in Mapper.java, on line 708, method: private final void internalMap(CharChunk host, CharChunk uri, String version, MappingData mappingData) throws Exception { on line 725: contexts = hosts[pos].contextList.contexts; there are 2 contexts: 1. [0]:name="", versions.MapperContextVersion.defaultWrapper not null 2. [1]:name="app", versions.MapperContextVersion.defaultWrapper is null [in Tomcat 7.0.14, there are 2 contexts, too, but all have defaultWrapper not null] variable pos=1, context = contexts[pos]; selected context has defaultWrapper null, variable contextVersion.defaultWrapper is null. Ivan --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org