From users-return-264326-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Thu Mar 29 22:53:48 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 41B9D180645 for ; Thu, 29 Mar 2018 22:53:48 +0200 (CEST) Received: (qmail 52565 invoked by uid 500); 29 Mar 2018 20:53:46 -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 52545 invoked by uid 99); 29 Mar 2018 20:53:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Mar 2018 20:53:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D32151A09FE for ; Thu, 29 Mar 2018 20:53:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.799 X-Spam-Level: X-Spam-Status: No, score=0.799 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id j7NIfgy44YIo for ; Thu, 29 Mar 2018 20:53:43 +0000 (UTC) Received: from thor.wissensbank.com (thor.wissensbank.com [81.169.250.120]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id D663A5FAC2 for ; Thu, 29 Mar 2018 20:53:42 +0000 (UTC) Received: from thor.wissensbank.com (localhost [127.0.0.1]) by thor.wissensbank.com (Postfix) with ESMTP id A15C11E103FFE for ; Thu, 29 Mar 2018 22:53:42 +0200 (CEST) Received: by thor.wissensbank.com (Postfix, from userid 500) id 915F01E10432C; Thu, 29 Mar 2018 22:53:42 +0200 (CEST) Received: from [192.168.245.144] (unknown [185.177.75.189]) (Authenticated sender: andre.warnier@ice-sa.com) by thor.wissensbank.com (Postfix) with ESMTPA id 3227E1E103FFE for ; Thu, 29 Mar 2018 22:53:42 +0200 (CEST) Subject: Re: On Tomcat 8.5.16, RemoteHostFilter throwing ServletException the property [allow] is not defined To: users@tomcat.apache.org References: <5ABD0A24.1010803@ice-sa.com> From: =?UTF-8?Q?Andr=c3=a9_Warnier_=28tomcat=29?= Message-ID: <5ABD5252.2080005@ice-sa.com> Date: Thu, 29 Mar 2018 22:53:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Hi. Sorry for top-posting, but maybe a real dev would want to have a look at this. If you scroll below to the original post, it seems that putting an invalid value (a bad regex) in the param-value of the "allow" param, triggers an error message that is at least confusing : >> Exception starting filter [Remote Host Filter] javax.servlet.ServletException: The property [allow] is not defined for filters of type [org.apache.catalina.filters.RemoteHostFilter] >> at org.apache.catalina.filters.FilterBase.init(FilterBase.java:52) ... That was for : >> >> allow >> *\.example\.com >> The OP cited Tomcat 8.5.16. On 29.03.2018 21:50, Scott Shipp wrote: > Gah! Well at least it was easy. Thanks Andre that was exactly right and can't believe I overlooked that. Thanks again, > > Scott > > > ________________________________ > From: Andr� Warnier (tomcat) > Sent: Thursday, March 29, 2018 8:45 AM > To: users@tomcat.apache.org > Subject: Re: On Tomcat 8.5.16, RemoteHostFilter throwing ServletException the property [allow] is not defined > > On 29.03.2018 16:36, Scott Shipp wrote: >> Hi everyone, >> >> >> I'm having a problem I haven't been able to address after reading the manual, googling and searching Stack Overflow, and asking around to other Tomcat users I know. >> >> >> I'm using Tomcat 8.5.16, and trying to set up a RemoteHostFilter. When I start the application with the RemoteHostFilter, it fails to startup with the following stack trace: >> >> >> Exception starting filter [Remote Host Filter] javax.servlet.ServletException: The property [allow] is not defined for filters of type [org.apache.catalina.filters.RemoteHostFilter] >> at org.apache.catalina.filters.FilterBase.init(FilterBase.java:52) >> at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285) >> at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266) >> at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108) >> at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4590) >> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5233) >> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) >> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) >> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) >> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) >> at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:988) >> at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1860) >> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) >> at java.util.concurrent.FutureTask.run(FutureTask.java:266) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >> at java.lang.Thread.run(Thread.java:748) >> >> I see the allow property mentioned in both the user guide documentation (here: https://tomcat.apache.org/tomcat-8.5-doc/config/filter.html#Remote_Host_Filter) and the javadoc (here: https://tomcat.apache.org/tomcat-8.5-doc/api/org/apache/catalina/filters/RemoteHostFilter.html). > Apache Tomcat 8 Configuration Reference (8.5.28 ... > tomcat.apache.org > The HTTP specification is clear that if no character set is specified for media sub-types of the "text" media type, the ISO-8859-1 character set must be used. > > >> RemoteHostFilter (Apache Tomcat 8.5.29 API Documentation) >> tomcat.apache.org >> Extract the desired request property, and pass it (along with the specified request and response objects and associated filter chain) to the protected process ... >> >> >> >> >> To troubleshoot, I set up a RemoteAddrFilter in my application's WEB-INF/web.xml using identical XML except for the value of the filter (obviously) and it works just fine. >> >> >> Does anyone know what the "property [allow] is not defined" message means? I would intuit that it means there is no "allow" property at all in the RemoteHostFilter code, but I suppose it may also mean that the init-param xml tag is not the right one to use or that the value is unintelligible to Tomcat somehow. >> >> >> Also, here's the relevant snippet from the web.xml, that I am trying to use: >> >> >> >> Remote Host Filter >> org.apache.catalina.filters.RemoteHostFilter >> >> allow >> *\.example\.com >> >> >> denyStatus >> 404 >> >> >> >> >> Remote Host Filter >> /url/path >> >> > > Hi. > I am not familiar with that filter, but I just looked at the doc you are pointing to, and > I believe that the ** that you indicate above is invalid. It should be a > regex, and the leading "*" there is wrong then. > Maybe it is just the error message that is wrong, and it is really complaining about the > value ? > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org